diff options
Diffstat (limited to 'lib/audio.py')
| -rw-r--r-- | lib/audio.py | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/lib/audio.py b/lib/audio.py index f1f53ff..613a0cb 100644 --- a/lib/audio.py +++ b/lib/audio.py | |||
| @@ -42,7 +42,6 @@ class OggStripper(parser.GenericParser): | |||
| 42 | Check if the "metadata" block is present in the file | 42 | Check if the "metadata" block is present in the file |
| 43 | ''' | 43 | ''' |
| 44 | mfile = OggVorbis(self.filename) | 44 | mfile = OggVorbis(self.filename) |
| 45 | print mfile.tags | ||
| 46 | if mfile.tags == []: | 45 | if mfile.tags == []: |
| 47 | return True | 46 | return True |
| 48 | else: | 47 | else: |
| @@ -54,8 +53,7 @@ class OggStripper(parser.GenericParser): | |||
| 54 | ''' | 53 | ''' |
| 55 | metadata = {} | 54 | metadata = {} |
| 56 | mfile = OggVorbis(self.filename) | 55 | mfile = OggVorbis(self.filename) |
| 57 | for key, value in mfile.tags: | 56 | [metadata[key] = value for key, value in mfile.tags] |
| 58 | metadata[key] = value | ||
| 59 | return metadata | 57 | return metadata |
| 60 | 58 | ||
| 61 | class Apev2Stripper(parser.GenericParser): | 59 | class Apev2Stripper(parser.GenericParser): |
| @@ -90,10 +88,8 @@ class Apev2Stripper(parser.GenericParser): | |||
| 90 | ''' | 88 | ''' |
| 91 | metadata = {} | 89 | metadata = {} |
| 92 | mfile = APEv2File(self.filename) | 90 | mfile = APEv2File(self.filename) |
| 93 | if mfile.tags is None: | 91 | if mfile.tags is not None: |
| 94 | return metadata | 92 | [metadata[key] = value for key, value in mfile.tags] |
| 95 | for key, value in mfile.tags: | ||
| 96 | metadata[key] = value | ||
| 97 | return metadata | 93 | return metadata |
| 98 | 94 | ||
| 99 | 95 | ||
| @@ -130,10 +126,8 @@ class FlacStripper(parser.GenericParser): | |||
| 130 | ''' | 126 | ''' |
| 131 | metadata = {} | 127 | metadata = {} |
| 132 | mfile = FLAC(self.filename) | 128 | mfile = FLAC(self.filename) |
| 133 | if mfile.tags is None: | 129 | if mfile.tags is not None: |
| 134 | return metadata | 130 | [metadata[key] = value for key, value in mfile.tags] |
| 135 | for key, value in mfile.tags: | 131 | if mfile.pictures != []: |
| 136 | metadata[key] = value | 132 | metadata['picture :'] = 'yes' |
| 137 | if mfile.pictures != []: | ||
| 138 | metadata['picture :'] = 'yes' | ||
| 139 | return metadata | 133 | return metadata |
