Skip to content

Commit c3a9f51

Browse files
authored
[script.module.mutagen] 1.47.0 (#2521)
1 parent 8c5219a commit c3a9f51

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+1773
-3653
lines changed

script.module.mutagen/README.rst

Lines changed: 0 additions & 28 deletions
This file was deleted.

script.module.mutagen/addon.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2-
<addon id="script.module.mutagen" name="Mutagen" version="1.44.0+matrix.1" provider-name="Christoph Reiter">
2+
<addon id="script.module.mutagen" name="Mutagen" version="1.47.0" provider-name="Christoph Reiter">
33
<requires>
4-
<import addon="xbmc.python" version="3.0.0"/>
4+
<import addon="xbmc.python" version="3.0.0" />
55
</requires>
66
<extension point="xbmc.python.module" library="lib" />
77
<extension point="xbmc.addon.metadata">
@@ -12,7 +12,7 @@
1212
<website>https://mutagen.readthedocs.io/en/latest/</website>
1313
<source>https://github.com/quodlibet/mutagen</source>
1414
<assets>
15-
<icon>icon.png</icon>
15+
<icon>resources/icon.png</icon>
1616
</assets>
1717
</extension>
1818
</addon>

script.module.mutagen/lib/mutagen/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21
# Copyright (C) 2005 Michael Urman
32
#
43
# This program is free software; you can redistribute it and/or modify
@@ -23,7 +22,7 @@
2322
from mutagen._file import FileType, StreamInfo, File
2423
from mutagen._tags import Tags, Metadata, PaddingInfo
2524

26-
version = (1, 44, 0)
25+
version = (1, 47, 0)
2726
"""Version tuple."""
2827

2928
version_string = ".".join(map(str, version))

script.module.mutagen/lib/mutagen/_compat.py

Lines changed: 0 additions & 94 deletions
This file was deleted.

script.module.mutagen/lib/mutagen/_constants.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21
#
32
# This program is free software; you can redistribute it and/or modify
43
# it under the terms of the GNU General Public License as published by

script.module.mutagen/lib/mutagen/_file.py

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21
# Copyright (C) 2005 Michael Urman
32
#
43
# This program is free software; you can redistribute it and/or modify
@@ -7,9 +6,9 @@
76
# (at your option) any later version.
87

98
import warnings
9+
from typing import List
1010

1111
from mutagen._util import DictMixin, loadfile
12-
from mutagen._compat import izip
1312

1413

1514
class FileType(DictMixin):
@@ -83,9 +82,9 @@ def __delitem__(self, key):
8382
if self.tags is None:
8483
raise KeyError(key)
8584
else:
86-
del(self.tags[key])
85+
del self.tags[key]
8786

88-
def keys(self):
87+
def keys(self) -> list:
8988
"""Return a list of keys in the metadata tag.
9089
9190
If the file has no tags at all, an empty list is returned.
@@ -132,12 +131,13 @@ def save(self, filething=None, **kwargs):
132131
if self.tags is not None:
133132
return self.tags.save(filething, **kwargs)
134133

135-
def pprint(self):
134+
def pprint(self) -> str:
136135
"""
137136
Returns:
138137
text: stream information and comment key=value pairs.
139138
"""
140139

140+
assert self.info is not None
141141
stream = "%s (%s)" % (self.info.pprint(), self.mime[0])
142142
try:
143143
tags = self.tags.pprint()
@@ -146,7 +146,7 @@ def pprint(self):
146146
else:
147147
return stream + ((tags and "\n" + tags) or "")
148148

149-
def add_tags(self):
149+
def add_tags(self) -> None:
150150
"""Adds new tags to the file.
151151
152152
Raises:
@@ -157,7 +157,7 @@ def add_tags(self):
157157
raise NotImplementedError
158158

159159
@property
160-
def mime(self):
160+
def mime(self) -> List[str]:
161161
"""A list of mime types (:class:`mutagen.text`)"""
162162

163163
mimes = []
@@ -168,7 +168,7 @@ def mime(self):
168168
return mimes
169169

170170
@staticmethod
171-
def score(filename, fileobj, header):
171+
def score(filename, fileobj, header) -> int:
172172
"""Returns a score for how likely the file can be parsed by this type.
173173
174174
Args:
@@ -196,7 +196,7 @@ class StreamInfo(object):
196196

197197
__module__ = "mutagen"
198198

199-
def pprint(self):
199+
def pprint(self) -> str:
200200
"""
201201
Returns:
202202
text: Print stream information
@@ -221,13 +221,13 @@ def File(filething, options=None, easy=False):
221221
filething (filething)
222222
options: Sequence of :class:`FileType` implementations,
223223
defaults to all included ones.
224-
easy (bool): If the easy wrappers should be returnd if available.
224+
easy (bool): If the easy wrappers should be returned if available.
225225
For example :class:`EasyMP3 <mp3.EasyMP3>` instead of
226226
:class:`MP3 <mp3.MP3>`.
227227
228228
Returns:
229229
FileType: A FileType instance for the detected type or `None` in case
230-
the type couln't be determined.
230+
the type couldn't be determined.
231231
232232
Raises:
233233
MutagenError: in case the detected type fails to load the file.
@@ -268,10 +268,12 @@ def File(filething, options=None, easy=False):
268268
from mutagen.smf import SMF
269269
from mutagen.tak import TAK
270270
from mutagen.dsf import DSF
271+
from mutagen.dsdiff import DSDIFF
272+
from mutagen.wave import WAVE
271273
options = [MP3, TrueAudio, OggTheora, OggSpeex, OggVorbis, OggFLAC,
272274
FLAC, AIFF, APEv2File, MP4, ID3FileType, WavPack,
273275
Musepack, MonkeysAudio, OptimFROG, ASF, OggOpus, AAC, AC3,
274-
SMF, TAK, DSF]
276+
SMF, TAK, DSF, DSDIFF, WAVE]
275277

276278
if not options:
277279
return None
@@ -289,7 +291,7 @@ def File(filething, options=None, easy=False):
289291
results = [(Kind.score(filething.name, fileobj, header), Kind.__name__)
290292
for Kind in options]
291293

292-
results = list(izip(results, options))
294+
results = list(zip(results, options))
293295
results.sort()
294296
(score, name), Kind = results[-1]
295297
if score > 0:

0 commit comments

Comments
 (0)