Fix UseFileMetadata when scanning (#2138)

This commit is contained in:
bnkai
2021-12-19 05:03:46 +02:00
committed by GitHub
parent 65b8a3fe96
commit f830d9cf13
2 changed files with 2 additions and 1 deletions

View File

@@ -38,6 +38,7 @@ func (t *ScanTask) scanScene() *models.Scene {
VideoFileCreator: &instance.FFProbe, VideoFileCreator: &instance.FFProbe,
PluginCache: instance.PluginCache, PluginCache: instance.PluginCache,
MutexManager: t.mutexManager, MutexManager: t.mutexManager,
UseFileMetadata: t.UseFileMetadata,
} }
if s != nil { if s != nil {

View File

@@ -263,7 +263,7 @@ func (scanner *Scanner) ScanNew(file file.SourceFile) (retScene *models.Scene, e
if scanner.UseFileMetadata { if scanner.UseFileMetadata {
newScene.Details = sql.NullString{String: videoFile.Comment, Valid: true} newScene.Details = sql.NullString{String: videoFile.Comment, Valid: true}
newScene.Date = models.SQLiteDate{String: videoFile.CreationTime.Format("2006-01-02")} _ = newScene.Date.Scan(videoFile.CreationTime)
} }
if err := scanner.TxnManager.WithTxn(context.TODO(), func(r models.Repository) error { if err := scanner.TxnManager.WithTxn(context.TODO(), func(r models.Repository) error {