tangled
alpha
login
or
join now
arimelody.space
/
vodular
0
fork
atom
Helper tool for stitching together livestream VOD segments and uploading them to YouTube!
0
fork
atom
overview
issues
pulls
pipelines
move templates to user config dir
arimelody.space
1 month ago
1d03bdeb
34065bd0
+6
-7
2 changed files
expand all
collapse all
unified
split
main.go
youtube
youtube.go
+1
-1
main.go
···
151
151
}
152
152
153
153
// good to have early on
154
154
-
templates, err := yt.FetchTemplates()
154
154
+
templates, err := yt.FetchTemplates(path.Join(userConfigDir, "vodular", "templates"))
155
155
if err != nil {
156
156
log.Fatalf("Failed to fetch templates: %v", err)
157
157
os.Exit(1)
+5
-6
youtube/youtube.go
···
113
113
CATEGORY_ENTERTAINMENT: YT_CATEGORY_ENTERTAINMENT,
114
114
}
115
115
116
116
-
var templateDir = "templates"
117
117
-
var tagsPath = path.Join(templateDir, "tags.txt")
118
118
-
var titlePath = path.Join(templateDir, "title.txt")
119
119
-
var descriptionPath = path.Join(templateDir, "description.txt")
120
120
-
121
116
const defaultTitleTemplate =
122
117
"{{.Title}} - {{FormatTime .Date \"02 Jan 2006\"}}"
123
118
const defaultDescriptionTemplate =
···
135
130
},
136
131
}
137
132
138
138
-
func FetchTemplates() (*Template, error) {
133
133
+
func FetchTemplates(templateDir string) (*Template, error) {
139
134
tmpl := Template{}
135
135
+
136
136
+
var tagsPath = path.Join(templateDir, "tags.txt")
137
137
+
var titlePath = path.Join(templateDir, "title.txt")
138
138
+
var descriptionPath = path.Join(templateDir, "description.txt")
140
139
141
140
// tags
142
141
if tagsFile, err := os.ReadFile(tagsPath); err == nil {