Helper tool for stitching together livestream VOD segments and uploading them to YouTube!

move templates to user config dir

+6 -7
+1 -1
main.go
··· 151 151 } 152 152 153 153 // good to have early on 154 - templates, err := yt.FetchTemplates() 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 - var templateDir = "templates" 117 - var tagsPath = path.Join(templateDir, "tags.txt") 118 - var titlePath = path.Join(templateDir, "title.txt") 119 - var descriptionPath = path.Join(templateDir, "description.txt") 120 - 121 116 const defaultTitleTemplate = 122 117 "{{.Title}} - {{FormatTime .Date \"02 Jan 2006\"}}" 123 118 const defaultDescriptionTemplate = ··· 135 130 }, 136 131 } 137 132 138 - func FetchTemplates() (*Template, error) { 133 + func FetchTemplates(templateDir string) (*Template, error) { 139 134 tmpl := Template{} 135 + 136 + var tagsPath = path.Join(templateDir, "tags.txt") 137 + var titlePath = path.Join(templateDir, "title.txt") 138 + var descriptionPath = path.Join(templateDir, "description.txt") 140 139 141 140 // tags 142 141 if tagsFile, err := os.ReadFile(tagsPath); err == nil {