mirror of https://github.com/stashapp/stash.git
Don't try to migrate non-existent vtt files (#5216)
This commit is contained in:
parent
fb82866512
commit
7c09f24f34
|
@ -65,6 +65,17 @@ func migrateSceneFiles(oldName, newName string) {
|
||||||
|
|
||||||
// #2481: migrate vtt file contents in addition to renaming
|
// #2481: migrate vtt file contents in addition to renaming
|
||||||
func migrateVttFile(vttPath, oldSpritePath, newSpritePath string) {
|
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)
|
contents, err := os.ReadFile(vttPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Errorf("Error reading %s for vtt migration: %v", vttPath, err)
|
logger.Errorf("Error reading %s for vtt migration: %v", vttPath, err)
|
||||||
|
|
Loading…
Reference in New Issue