Rename marker folders when hash changes (#3988)

This commit is contained in:
WithoutPants
2023-08-02 16:15:37 +10:00
committed by GitHub
parent bd28aa6fd9
commit 107d1113e5
2 changed files with 28 additions and 3 deletions

View File

@@ -16,14 +16,18 @@ func newSceneMarkerPaths(p Paths) *sceneMarkerPaths {
return &sp
}
func (sp *sceneMarkerPaths) GetFolderPath(checksum string) string {
return filepath.Join(sp.Markers, checksum)
}
func (sp *sceneMarkerPaths) GetVideoPreviewPath(checksum string, seconds int) string {
return filepath.Join(sp.Markers, checksum, strconv.Itoa(seconds)+".mp4")
return filepath.Join(sp.GetFolderPath(checksum), strconv.Itoa(seconds)+".mp4")
}
func (sp *sceneMarkerPaths) GetWebpPreviewPath(checksum string, seconds int) string {
return filepath.Join(sp.Markers, checksum, strconv.Itoa(seconds)+".webp")
return filepath.Join(sp.GetFolderPath(checksum), strconv.Itoa(seconds)+".webp")
}
func (sp *sceneMarkerPaths) GetScreenshotPath(checksum string, seconds int) string {
return filepath.Join(sp.Markers, checksum, strconv.Itoa(seconds)+".jpg")
return filepath.Join(sp.GetFolderPath(checksum), strconv.Itoa(seconds)+".jpg")
}