mirror of
https://github.com/stashapp/stash.git
synced 2025-12-16 20:07:05 +03:00
Don't try to migrate non-existent vtt files (#5216)
This commit is contained in:
@@ -65,6 +65,17 @@ func migrateSceneFiles(oldName, newName string) {
|
||||
|
||||
// #2481: migrate vtt file contents in addition to renaming
|
||||
func migrateVttFile(vttPath, oldSpritePath, newSpritePath string) {
|
||||
// #3356 - don't try to migrate if the file doesn't exist
|
||||
exists, err := fsutil.FileExists(vttPath)
|
||||
if err != nil && !os.IsNotExist(err) {
|
||||
logger.Errorf("Error checking existence of %s: %s", vttPath, err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
if !exists {
|
||||
return
|
||||
}
|
||||
|
||||
contents, err := os.ReadFile(vttPath)
|
||||
if err != nil {
|
||||
logger.Errorf("Error reading %s for vtt migration: %v", vttPath, err)
|
||||
|
||||
Reference in New Issue
Block a user