mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 12:24:38 +03:00
Migrate generated files when a scene is rescanned (#1106)
This commit is contained in:
@@ -380,10 +380,17 @@ func (t *ScanTask) scanScene() *models.Scene {
|
||||
// scene, then recalculate the checksum and regenerate the thumbnail
|
||||
modified := t.isFileModified(fileModTime, s.FileModTime)
|
||||
if modified || !s.Size.Valid {
|
||||
oldHash := s.GetHash(config.GetVideoFileNamingAlgorithm())
|
||||
s, err = t.rescanScene(s, fileModTime)
|
||||
if err != nil {
|
||||
return logError(err)
|
||||
}
|
||||
|
||||
// Migrate any generated files if the hash has changed
|
||||
newHash := s.GetHash(config.GetVideoFileNamingAlgorithm())
|
||||
if newHash != oldHash {
|
||||
MigrateHash(oldHash, newHash)
|
||||
}
|
||||
}
|
||||
|
||||
// We already have this item in the database
|
||||
|
||||
Reference in New Issue
Block a user