Commit graph

115 commits

Author SHA1 Message Date
Bruno Cauet
a8477264ac MediaFile: improve cover art detection
Filter media file images on their type.
Detection is still not deterministic when 0 or multiple image
have type ImageType.front.

Fix #1332.
2015-02-20 12:53:43 +01:00
Bruno Cauet
2dec90de7a Fix assertTags() in mediafile tests 2015-02-20 12:52:59 +01:00
Adrian Sampson
b8dab9cf9f Merge pull request #1247 from brunal/future
Use all __future__ imports in beets core

Conflicts:
	beetsplug/web/__init__.py
	test/test_embedart.py
2015-01-26 17:02:07 -08:00
Matthias Kiefer
b16898743d Fixed IndexError on reading embedded cover art with invalid cover type 2015-01-23 13:44:08 +01:00
Bruno Cauet
02d8e88ef1 Replace all mentions of 'str' with 'bytes' 2015-01-20 12:48:15 +01:00
Bruno Cauet
9c41c39913 Do __name__ comparison with bytes and not unicode 2015-01-20 12:03:57 +01:00
Bruno Cauet
2dab8e5fd6 Import unicode_literals in beets package 2015-01-19 21:41:33 +01:00
Bruno Cauet
90b388b775 Use __future__ imports but unicode_literals everywhere
Include import of __future__ features division, absolute_imports and
print_function everywhere. Don't add unicode_literals yet for it is
harder to convert.

Goal is smoothing the transition to python 3.
2015-01-19 12:25:16 +01:00
Bruno Cauet
2902cda036 tests: use absolute imports everywhere 2015-01-19 12:25:15 +01:00
Frederik “Freso” S. Olesen
4b1f0cbf48 Happy 2015. ;)
See 7a410f636b

Command used:

    git grep -l 'Copyright 201'|xargs sed -i -E 's/Copyright 201./Copyright 2015/'`
2015-01-08 21:37:09 +01:00
Thomas Scholtes
9d3729dc5e mediafile: Test deleting images and implement it for MP3s 2014-12-01 17:20:16 +01:00
Adrian Sampson
68770f85e3 Update ALAC tests for Mutagen 1.26
The metadata extraction is now more accurate for ALACs, but we lost the
ability to distinguish them from AAC.
2014-11-10 10:06:21 -08:00
Adrian Sampson
8ed76298e3 Merge pull request #1043 from kiefermat/mediafile_comments_and_year
Added slash separator to DateField and more comments styles to MediaFile
2014-10-28 11:30:07 -07:00
Matthias Kiefer
610942b1a5 Fixed getting description for wma file with standard WMA attributes 2014-10-28 10:28:12 +01:00
Matthias Kiefer
b02da5e150 Added test for date with slashed and fixed date regex 2014-10-28 08:52:03 +01:00
Matthias Kiefer
f8abb03b40 Added support for APEv2 cover tags 2014-10-27 16:10:17 +01:00
Thomas Scholtes
98ae8cbbc9 Make tests conform to PEP8 2014-09-09 22:31:46 +02:00
Adrian Sampson
79aef50c25 AIFF support (fix #250)
Thanks to @EvanPurkhiser, AIFF is now supported in Mutagen 1.23! Now we can
support it too.
2014-05-17 21:13:40 -07:00
Thomas Scholtes
c01fc542ed Support for initial_key with EchoNest 2014-04-11 21:03:11 +02:00
Thomas Scholtes
52dc84f43a Set literal not available in py26 2014-04-09 23:28:11 +02:00
Thomas Scholtes
a6839603cd Return None for missing tags.
Instead of returning a special "None value" if a tag does not exist, we return
none directly.
2014-04-09 23:28:11 +02:00
Thomas Scholtes
663d91c4b2 Delete tags from media files 2014-04-09 23:28:11 +02:00
Adrian Sampson
443b8089d5 remove unnecessary IndexableEnum
This is not really critical since list(Type)[i] works just as well. This fixes
a couple other problems from the enum transition:
- The name of TYPES was not really consistent with its new role as an enum
  type. Renamed this ImageType.
- Fix a rather egregious bug in embedart (undefined reference to Image).
2014-04-08 16:59:50 -07:00
Adrian Sampson
9a21f555be MediaFile.update() no longer writes files
You now call update() followed by save(). This is mainly because the
implementation no longer performs lazy updates, so the need to pair tag
setting and writing together was diminished. Benefits in cleanliness:
- No need to duplicate the id3v2 option.
- Exception handling can be more precise.
- More closely resembles dict.update().
2014-04-07 20:34:48 -07:00
Adrian Sampson
b3f31cbc0a rename Item.media_fields to _media_fields
Following the convention of the other field sets and such. This helps avoid
any confusion with user-specified fields (although it's unlikely people will
want to name a flexible field "media_fields" :).
2014-04-07 20:21:20 -07:00
Thomas Scholtes
e62d36aa69 Remove lazy update from MediaFile 2014-04-04 13:40:10 +02:00
Thomas Scholtes
eb4c323bcb Plugins can now extend MediaField 2014-04-04 00:48:29 +02:00
Thomas Scholtes
3c7dd13b72 Add Item.media_fields
This new property controls which fields to read from a media file.
2014-04-03 23:35:33 +02:00
Thomas Scholtes
c4f0928bf5 Read custom fields into database 2014-04-03 14:01:56 +02:00
Thomas Scholtes
b262edd972 Migrate ITEM_KEYS_META 2014-04-03 14:01:56 +02:00
Thomas Scholtes
43ae730a6a Use readable_fields() to replace ITEM_KEYS_META 2014-04-03 14:01:56 +02:00
Thomas Scholtes
863b9fb4af MediaFile can be extended with custom fields 2014-04-03 14:01:55 +02:00
Thomas Scholtes
a2a8b244d7 Add LazySave tests for MediaFile 2014-04-03 14:01:55 +02:00
Thomas Scholtes
bedad53c27 Test that we can migrate ITEM_KEYS_WRITABLE
The test show that we can replace the hard-coded `ITEM_KEYS_WRITABLE` constant
with the computed value derived from `MediaField.fields()` and ITEM_KEYS. This
will be done in the next commit.
2014-04-03 14:01:55 +02:00
Thomas Scholtes
bcb72becf8 Add MediaFile.update() method to supersede save() 2014-04-03 14:01:55 +02:00
Thomas Scholtes
b026d60c31 Add MediaFile.fields() method 2014-04-03 14:01:55 +02:00
Thomas Scholtes
100b3d4d65 Make mediafile tests independent of image order
For MP3s mutagen stores image tags in a hash with the `APIC:...` key. The order
of the images is therefore not well defined. A similar issue occurs with WMAs.
2014-04-02 22:15:00 +02:00
Adrian Sampson
ddddbbb919 some more thorough documentation for #614 2014-03-21 17:51:50 -07:00
Andrew Sutherland
e290f8dfad Use _safe_cast to avoid dying on illegal dates. 2014-03-18 01:38:04 -04:00
Thomas Scholtes
41045ec33d Remove tests for editing list of tags by reference
See discussion in #605

Commit 3000: Wooho
2014-03-12 13:35:49 +01:00
Thomas Scholtes
4abc849a51 Genre list support for WMA 2014-03-09 14:27:49 +01:00
Thomas Scholtes
610e4f14eb Merge branch 'image-tags'
Conflicts:
	beets/mediafile.py
2014-03-09 14:13:12 +01:00
Thomas Scholtes
9fe212feea Add support for different coverart mime types 2014-03-09 13:09:26 +01:00
Thomas Scholtes
28bab0a9a3 Test invalid image format for MP4 2014-03-09 13:01:14 +01:00
Thomas Scholtes
d2b627cc1c Make sure the png_data method is available 2014-03-09 12:50:24 +01:00
Thomas Scholtes
57d7a51b5c Rename TagImage to Image 2014-03-09 12:47:38 +01:00
Thomas Scholtes
c435fd7446 Implement ImageListField for MP4 2014-03-09 12:46:51 +01:00
Thomas Scholtes
63def728dc Implement ImageListField for WMA 2014-03-09 01:48:56 +01:00
Thomas Scholtes
806d3cc6e9 Implement ImageListField for Vorbis comments 2014-03-09 00:56:44 +01:00
Thomas Scholtes
a99dea1d9b Add tests for legacy coverart tag in ogg
Added a `coverart.ogg` fixture file that contains raw image data encoded as
base64 in the COVERART tag. We test that the `art` property on mediafiles
correctly reads these tags and transforms them into METADATA_BLOCK_PICTURE tags
on write.
2014-03-09 00:38:05 +01:00