Commit graph

240 commits

Author SHA1 Message Date
Adrian Sampson
bf553eae34 MediaFile: detect missing numbers (fix #901) 2014-08-18 10:17:01 -07:00
Adrian Sampson
7de6259c1d MediaFile: make id3v23 a constructor parameter
For #899, we need to change MediaFile's behavior (pre-write) based on whether
we're doing ID3v2.3 or not. So we need a field on the object, not a parameter
to `save()`.
2014-08-15 12:09:18 -07:00
Thomas Scholtes
fe6c7819d3 More informative MediaFile exceptions
* Remove generic messages for `UnreadableFileError`. The class
  carries that information—so we see it if the exceptions crashes the
  program. If the exception is caught (in `library`, `importer`,
  and `autotag`) the type of the exceptions is logged.

* Attach file path to the exceptions. This allows us to determine
  the file that crashed the application.

See #788
2014-05-23 11:29:17 +02:00
Adrian Sampson
943cbe0838 MediaFile: allow setting date fields to None 2014-05-18 15:14:36 -07: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
Adrian Sampson
48ee713584 MediaFile: fix deletion of FLAC image fields
This was a no-op before but raises an exception on Mutagen 1.23. This fixes
the behavior (I'm not sure if we were using it anywhere) and the failing test.
2014-05-17 13:30:58 -07:00
Adrian Sampson
309c5c1a58 fix #705: unicode in SoundCheck fields 2014-04-17 18:10:16 -07:00
Adrian Sampson
033cf9ec21 spell check 2014-04-15 21:17:23 -07:00
Thomas Scholtes
c01fc542ed Support for initial_key with EchoNest 2014-04-11 21:03:11 +02:00
Thomas Scholtes
a09b092c78 Don't accidentaly delete fallback id3 frame 2014-04-11 15:10:35 +02:00
Thomas Scholtes
d44adea9d3 Delete 'None' properties from media file 2014-04-10 14:35:37 +02:00
Thomas Scholtes
90dbefabd3 flake8 fixes 2014-04-10 01:17:29 +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
Thomas Scholtes
bc55747abc More flake fixes 2014-04-09 19:16:38 +02:00
Thomas Scholtes
b88319da05 type_index for mediafile images defaults to "other"
The `Image.type_index` property is only used for tags that require an integer
to store the cover type like ID3v2. If the type of an image is not set we let
`type_index` return the integer for an "other" image. Other than a default
"front" value, this makes sure we do not inadvertidly add an image that will
be displayed in a player.
2014-04-09 18:12:47 +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
1eb6ccf0ab Merge pull request #642 from ktkonrad/enum34
use the new python enum instead of hand-rolled version
2014-04-08 15:24:04 -07:00
Adrian Sampson
7456f556fb fix Sphinx syntax in docstrings 2014-04-07 20:50:41 -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
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
43ae730a6a Use readable_fields() to replace ITEM_KEYS_META 2014-04-03 14:01:56 +02:00
Thomas Scholtes
9474686d68 Use indexed format with python26 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
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
Kyle Konrad
c4e6f38963 use the new python enum instead of hand-rolled version 2014-04-02 10:23:48 -07:00
Adrian Sampson
d778443ea0 don't wrap standard errors during Mutagen save() 2014-03-25 22:44:15 -07:00
Adrian Sampson
ddddbbb919 some more thorough documentation for #614 2014-03-21 17:51:50 -07:00
Adrian Sampson
3b403937d6 Merge pull request #614 from asutherland/survive-bad-dates
Return 0 dates instead of throwing on bad dates.
2014-03-21 17:43:30 -07:00
Adrian Sampson
1fb2584a06 avoid crashes on Mutagen bugs in save() (#622) 2014-03-20 14:35:45 -07:00
Andrew Sutherland
e290f8dfad Use _safe_cast to avoid dying on illegal dates. 2014-03-18 01:38:04 -04:00
Thomas Scholtes
2dc0e4998d Determine StorageStyle from mutagen class
Further decouples MediaFile from MediaFiled and StorageStyle. The latter know
only has knowledge of mutagen.
2014-03-12 13:59:39 +01:00
Adrian Sampson
c64e9ed789 MediaFile: remove out_type from StorageStyle
This eliminates a little bit of state redundancy in which StorageStyles needed
to know about their field's externally visible type. Now the MediaField itself
is *solely* responsible for external-type-related conversions; StorageStyles
need only worry about their *internal* types.

(I hope I didn't mess up any essential design decisions, @geigerzaehler.)
2014-03-11 22:09:22 -07:00
Thomas Scholtes
d95d4428fe Add more documentation to MediaFile 2014-03-11 16:28:47 +01:00
Adrian Sampson
b70b133f6e fill in some code documentation in MediaFile 2014-03-10 22:05:57 -07:00
Thomas Scholtes
4abc849a51 Genre list support for WMA 2014-03-09 14:27:49 +01:00
Thomas Scholtes
ee40050d4b Remove unused methods 2014-03-09 14:08:43 +01:00
Thomas Scholtes
0a3e47c965 Add deserialize method to storage styles 2014-03-09 13:45:29 +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
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
a11bae9386 Implement ImageListField for FLAC 2014-03-09 00:11:46 +01:00
Thomas Scholtes
f16c997d9c Add documentation and clean up code 2014-03-08 23:44:54 +01:00