human readable video names

This commit is contained in:
Niko Storni 2018-04-25 15:43:20 -04:00
parent 1c6428f1ab
commit 72039623e0

View file

@ -59,10 +59,10 @@ func (v YoutubeVideo) PublishedAt() time.Time {
} }
func (v YoutubeVideo) getFilename() string { func (v YoutubeVideo) getFilename() string {
return v.dir + "/" + v.id + ".mp4" return v.dir + "/" + v.getClaimName() + ".mp4"
} }
func (v YoutubeVideo) getClaimName(attempt int) string { func (v YoutubeVideo) getClaimName() string {
maxLen := 40 maxLen := 40
reg := regexp.MustCompile(`[^a-zA-Z0-9]+`) reg := regexp.MustCompile(`[^a-zA-Z0-9]+`)