mirror of
https://github.com/fergalmoran/picard.git
synced 2026-03-22 13:15:13 +00:00
PICARD-1672: Flag MP4 files with the hdvd tag as video
This commit is contained in:
@@ -349,5 +349,5 @@ class MP4File(File):
|
||||
filename = file.filename
|
||||
if isinstance(filename, bytes):
|
||||
filename = filename.decode()
|
||||
if filename.lower().endswith(".m4v"):
|
||||
if filename.lower().endswith(".m4v") or 'hdvd' in file.tags:
|
||||
metadata['~video'] = '1'
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import mutagen
|
||||
import unittest
|
||||
|
||||
from picard.formats import ext_to_format
|
||||
|
||||
@@ -83,6 +84,14 @@ class M4ATest(CommonMP4Tests.MP4TestCase):
|
||||
}
|
||||
unexpected_info = ['~video']
|
||||
|
||||
@unittest.skipUnless(mutagen.version >= (1, 43, 0), "mutagen >= 1.43.0 required")
|
||||
def test_hdvd_tag_considered_video(self):
|
||||
tags = mutagen.mp4.MP4Tags()
|
||||
tags['hdvd'] = [1]
|
||||
save_raw(self.filename, tags)
|
||||
metadata = load_metadata(self.filename)
|
||||
self.assertEqual('1', metadata["~video"])
|
||||
|
||||
|
||||
class M4VTest(CommonMP4Tests.MP4TestCase):
|
||||
testfile = 'test.m4v'
|
||||
|
||||
Reference in New Issue
Block a user