fix: token reload

This commit is contained in:
Rogee
2024-12-15 01:19:03 +08:00
parent ed3d8b0e6c
commit 4a606bd824
9 changed files with 62 additions and 23 deletions

View File

@@ -95,12 +95,8 @@ func (d *DiscoverMedias) processVideo(video, to, hash string) (media_store.Video
return info, errors.Wrapf(err, "ensure directory: %s", to)
}
if err := d.ensureDirectory(filepath.Join(to, "posters")); err != nil {
return info, errors.Wrapf(err, "ensure directory: %s", to)
}
// extract poster
posterFile := filepath.Join(to, "posters", hash+".jpg")
posterFile := filepath.Join(to, hash+".jpg")
if err := d.ffmpegVideoToPoster(video, posterFile); err != nil {
return info, errors.Wrapf(err, "ffmpeg video to poster: %s", posterFile)
}
@@ -269,6 +265,10 @@ func (d *DiscoverMedias) runCleanup(to string) {
if err := os.RemoveAll(filepath.Join(to, dir)); err != nil {
d.log.Errorf("Remove dir: %s", dir)
}
if err := os.RemoveAll(filepath.Join(to, dir+".jpg")); err != nil {
d.log.Errorf("Remove poster: %s", dir+".jpg")
}
}
}