mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 12:24:38 +03:00
Calculate and print job totals for scan and generate tasks (#188)
* Calculate and print job totals for scan and generate tasks * Cosmetic print fixes
This commit is contained in:
@@ -75,3 +75,27 @@ func (t *GenerateMarkersTask) Start(wg *sync.WaitGroup) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (t *GenerateMarkersTask) isMarkerNeeded() int {
|
||||
|
||||
markers := 0
|
||||
qb := models.NewSceneMarkerQueryBuilder()
|
||||
sceneMarkers, _ := qb.FindBySceneID(t.Scene.ID, nil)
|
||||
if len(sceneMarkers) == 0 {
|
||||
return 0
|
||||
}
|
||||
|
||||
for _, sceneMarker := range sceneMarkers {
|
||||
seconds := int(sceneMarker.Seconds)
|
||||
videoPath := instance.Paths.SceneMarkers.GetStreamPath(t.Scene.Checksum, seconds)
|
||||
imagePath := instance.Paths.SceneMarkers.GetStreamPreviewImagePath(t.Scene.Checksum, seconds)
|
||||
videoExists, _ := utils.FileExists(videoPath)
|
||||
imageExists, _ := utils.FileExists(imagePath)
|
||||
|
||||
if (!videoExists) || (!imageExists) {
|
||||
markers++
|
||||
}
|
||||
|
||||
}
|
||||
return markers
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user