mirror of https://github.com/stashapp/stash.git
fix issue #144
This commit is contained in:
parent
edef99711a
commit
40b270eb49
|
@ -81,7 +81,31 @@ func (t *ScanTask) scanScene() {
|
|||
qb := models.NewSceneQueryBuilder()
|
||||
scene, _ := qb.FindByPath(t.FilePath)
|
||||
if scene != nil {
|
||||
// We already have this item in the database, keep going
|
||||
// We already have this item in the database, check for thumbnails,screenshots
|
||||
|
||||
thumbPath := instance.Paths.Scene.GetThumbnailScreenshotPath(scene.Checksum)
|
||||
normalPath := instance.Paths.Scene.GetScreenshotPath(scene.Checksum)
|
||||
|
||||
thumbExists, _ := utils.FileExists(thumbPath)
|
||||
normalExists, _ := utils.FileExists(normalPath)
|
||||
|
||||
if !thumbExists || !normalExists {
|
||||
checkvideoFile, err := ffmpeg.NewVideoFile(instance.FFProbePath, t.FilePath)
|
||||
|
||||
if err != nil {
|
||||
logger.Error(err.Error())
|
||||
return
|
||||
}
|
||||
if !thumbExists {
|
||||
logger.Infof("Recreating thumbnail for %s", t.FilePath)
|
||||
t.makeScreenshot(*checkvideoFile, thumbPath, 5, 320)
|
||||
}
|
||||
|
||||
if !normalExists {
|
||||
logger.Infof("Recreating screeenshot for %s", t.FilePath)
|
||||
t.makeScreenshot(*checkvideoFile, normalPath, 2, checkvideoFile.Width)
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue