Handle null video durations in migration (#3021)

This commit is contained in:
WithoutPants 2022-10-20 10:58:42 +11:00 committed by GitHub
parent c4c6a3f9c0
commit 7104bb67ca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View File

@ -75,5 +75,6 @@ func (d *Decorator) IsMissingMetadata(ctx context.Context, fs file.FS, f file.Fi
return vf.VideoCodec == unsetString || vf.AudioCodec == unsetString ||
vf.Format == unsetString || vf.Width == unsetNumber ||
vf.Height == unsetNumber || vf.FrameRate == unsetNumber ||
vf.Duration == unsetNumber ||
vf.BitRate == unsetNumber || interactive != vf.Interactive
}

View File

@ -458,7 +458,7 @@ INSERT INTO `video_files`
)
SELECT
`files`.`id`,
`scenes`.`duration`,
COALESCE(`scenes`.`duration`, -1),
-- special values for unset to be updated during scan
COALESCE(`scenes`.`video_codec`, 'unset'),
COALESCE(`scenes`.`format`, 'unset'),