mirror of
https://github.com/beetbox/beets.git
synced 2025-12-07 17:16:07 +01:00
Fix PNG metadata type: string only
instead of int
This commit is contained in:
parent
39183cd539
commit
d299f40a72
2 changed files with 4 additions and 2 deletions
|
|
@ -163,7 +163,7 @@ class ThumbnailsPlugin(BeetsPlugin):
|
||||||
See http://standards.freedesktop.org/thumbnail-spec/latest/x142.html
|
See http://standards.freedesktop.org/thumbnail-spec/latest/x142.html
|
||||||
"""
|
"""
|
||||||
metadata = {"Thumb::URI": PurePosixPath(album.artpath).as_uri(),
|
metadata = {"Thumb::URI": PurePosixPath(album.artpath).as_uri(),
|
||||||
"Thumb::MTime": os.stat(album.artpath).st_mtime}
|
"Thumb::MTime": unicode(os.stat(album.artpath).st_mtime)}
|
||||||
try:
|
try:
|
||||||
self.write_metadata(image_path, metadata)
|
self.write_metadata(image_path, metadata)
|
||||||
except Exception:
|
except Exception:
|
||||||
|
|
|
||||||
|
|
@ -57,10 +57,12 @@ class ThumbnailsTest(unittest.TestCase, TestHelper):
|
||||||
plugin = ThumbnailsPlugin()
|
plugin = ThumbnailsPlugin()
|
||||||
plugin.write_metadata = Mock()
|
plugin.write_metadata = Mock()
|
||||||
album = Mock(artpath=b"/path/to/cover")
|
album = Mock(artpath=b"/path/to/cover")
|
||||||
|
mock_stat.return_value.st_mtime = 12345
|
||||||
|
|
||||||
plugin.add_tags(album, b"/path/to/thumbnail")
|
plugin.add_tags(album, b"/path/to/thumbnail")
|
||||||
|
|
||||||
metadata = {"Thumb::URI": b"file:///path/to/cover",
|
metadata = {"Thumb::URI": b"file:///path/to/cover",
|
||||||
"Thumb::MTime": mock_stat.return_value.st_mtime}
|
"Thumb::MTime": "12345"}
|
||||||
plugin.write_metadata.assert_called_once_with(b"/path/to/thumbnail",
|
plugin.write_metadata.assert_called_once_with(b"/path/to/thumbnail",
|
||||||
metadata)
|
metadata)
|
||||||
mock_stat.assert_called_once_with(album.artpath)
|
mock_stat.assert_called_once_with(album.artpath)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue