Commit graph

128 commits

Author SHA1 Message Date
Johnny Robeson
7b66dfec4b use renamed test assertions from six 2016-06-23 04:40:18 -04:00
Johnny Robeson
66431ab4de treat tag values as strings in ReadWriteTestBase 2016-06-17 23:58:35 -04:00
Johnny Robeson
a1609ec548 use strings for *StorageStyle keys, not bytes 2016-06-17 23:39:17 -04:00
Johnny Robeson
fd01faa241 add missing bytestring_path import :( 2016-06-16 04:02:19 -04:00
Johnny Robeson
4e5ac89b2a bytstringify path in _mediafile_fixture 2016-06-16 04:00:43 -04:00
Johnny Robeson
ffa46a185c bytestring normalization
Make sure many/most strings that touch the filesystem are
converted explicitly to bytestrings rather than implictly.
2016-06-13 05:39:09 -04:00
Johnny Robeson
be474b3f52 wrap a call to filter in a list()
There are other filters like this in the master branch, but
2to3 converts them into list comprehensions. We'll deal with those
later
2016-06-06 17:26:06 -04:00
Adrian Sampson
71b9fd785c Revert "Do __name__ comparison with bytes and not unicode"
This reverts commit 9c41c39913.
That commit used byte strings for the `if __name__ == '__main__'` pattern,
which was necessary when we were doing unicode_literals. But it is wrong on
Python 3, and now that we're liberated from unicode_literals, we need to go
back to native strings for this comparison.
2016-05-29 19:19:59 -07:00
Jack Wilsdon
b1c58e99ec Update code to match pep8 naming standards 2016-04-27 20:15:10 +01:00
Adrian Sampson
e54c7eec3d Standardize __future__ imports without parentheses
Since the list is short enough now, we don't need parentheses for the line
wrap. This is a little less ugly.
2016-02-28 15:03:51 -08:00
Peter Kessen
00a8ffe49b Removed unicode_literals from test_mediafile 2016-02-23 18:35:14 +01:00
Jack Wilsdon
12cd5306b7 Update copyright dates to 2016 2015-12-30 15:42:06 +00:00
Peter Kessen
3eb8008b11 added encoding as comment in files
added line like
# -*- coding: utf-8 -*-
to all files with correct license in header
2015-11-19 18:41:01 +01:00
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