mirror of
https://git.vectorsigma.ru/public/photoview.git
synced 2026-08-03 22:19:07 +00:00
* names, constants of reusable strings, removed unneeded `if`, replaced deprecated imports * more deprecated imports replaced * What is this?)) * Fix a path and quote a var in Dockerfile * Addressing review comments --------- Co-authored-by: Konstantin Koval <kkb@ukr.net>
22 lines
597 B
Go
22 lines
597 B
Go
package cleanup_tasks
|
|
|
|
import (
|
|
"github.com/photoview/photoview/api/graphql/models"
|
|
"github.com/photoview/photoview/api/scanner/scanner_task"
|
|
"github.com/photoview/photoview/api/scanner/scanner_utils"
|
|
)
|
|
|
|
type MediaCleanupTask struct {
|
|
scanner_task.ScannerTaskBase
|
|
}
|
|
|
|
func (t MediaCleanupTask) AfterScanAlbum(ctx scanner_task.TaskContext, changedMedia []*models.Media, albumMedia []*models.Media) error {
|
|
|
|
cleanupErrors := CleanupMedia(ctx.GetDB(), ctx.GetAlbum().ID, albumMedia)
|
|
for _, err := range cleanupErrors {
|
|
scanner_utils.ScannerError("delete old media: %s", err)
|
|
}
|
|
|
|
return nil
|
|
}
|