Improve handling of moved and added video files (#4598)

* If old file path is not in library, treat as move
* Use existing phash if file with same oshash exists
This commit is contained in:
WithoutPants
2024-02-20 14:04:31 +11:00
committed by GitHub
parent 8b1d4ccc97
commit 76e5598876
4 changed files with 75 additions and 18 deletions

View File

@@ -19,14 +19,17 @@ import (
)
func useAsVideo(pathname string) bool {
if instance.Config.IsCreateImageClipsFromVideos() && config.StashConfigs.GetStashFromDirPath(instance.Config.GetStashPaths(), pathname).ExcludeVideo {
stash := config.StashConfigs.GetStashFromDirPath(instance.Config.GetStashPaths(), pathname)
if instance.Config.IsCreateImageClipsFromVideos() && stash != nil && stash.ExcludeVideo {
return false
}
return isVideo(pathname)
}
func useAsImage(pathname string) bool {
if instance.Config.IsCreateImageClipsFromVideos() && config.StashConfigs.GetStashFromDirPath(instance.Config.GetStashPaths(), pathname).ExcludeVideo {
stash := config.StashConfigs.GetStashFromDirPath(instance.Config.GetStashPaths(), pathname)
if instance.Config.IsCreateImageClipsFromVideos() && stash != nil && stash.ExcludeVideo {
return isImage(pathname) || isVideo(pathname)
}
return isImage(pathname)