Skip to content

Commit

Permalink
[script.module.mutagen] 1.47.0
Browse files Browse the repository at this point in the history
  • Loading branch information
L2501 committed Sep 14, 2023
1 parent 4766b1b commit 5577967
Show file tree
Hide file tree
Showing 72 changed files with 1,773 additions and 3,653 deletions.
File renamed without changes.
28 changes: 0 additions & 28 deletions script.module.mutagen/README.rst

This file was deleted.

6 changes: 3 additions & 3 deletions script.module.mutagen/addon.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="script.module.mutagen" name="Mutagen" version="1.44.0+matrix.1" provider-name="Christoph Reiter">
<addon id="script.module.mutagen" name="Mutagen" version="1.47.0" provider-name="Christoph Reiter">
<requires>
<import addon="xbmc.python" version="3.0.0"/>
<import addon="xbmc.python" version="3.0.0" />
</requires>
<extension point="xbmc.python.module" library="lib" />
<extension point="xbmc.addon.metadata">
Expand All @@ -12,7 +12,7 @@
<website>https://mutagen.readthedocs.io/en/latest/</website>
<source>https://github.com/quodlibet/mutagen</source>
<assets>
<icon>icon.png</icon>
<icon>resources/icon.png</icon>
</assets>
</extension>
</addon>
3 changes: 1 addition & 2 deletions script.module.mutagen/lib/mutagen/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2005 Michael Urman
#
# This program is free software; you can redistribute it and/or modify
Expand All @@ -23,7 +22,7 @@
from mutagen._file import FileType, StreamInfo, File
from mutagen._tags import Tags, Metadata, PaddingInfo

version = (1, 44, 0)
version = (1, 47, 0)
"""Version tuple."""

version_string = ".".join(map(str, version))
Expand Down
94 changes: 0 additions & 94 deletions script.module.mutagen/lib/mutagen/_compat.py

This file was deleted.

1 change: 0 additions & 1 deletion script.module.mutagen/lib/mutagen/_constants.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down
28 changes: 15 additions & 13 deletions script.module.mutagen/lib/mutagen/_file.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2005 Michael Urman
#
# This program is free software; you can redistribute it and/or modify
Expand All @@ -7,9 +6,9 @@
# (at your option) any later version.

import warnings
from typing import List

from mutagen._util import DictMixin, loadfile
from mutagen._compat import izip


class FileType(DictMixin):
Expand Down Expand Up @@ -83,9 +82,9 @@ def __delitem__(self, key):
if self.tags is None:
raise KeyError(key)
else:
del(self.tags[key])
del self.tags[key]

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

def pprint(self):
def pprint(self) -> str:
"""
Returns:
text: stream information and comment key=value pairs.
"""

assert self.info is not None
stream = "%s (%s)" % (self.info.pprint(), self.mime[0])
try:
tags = self.tags.pprint()
Expand All @@ -146,7 +146,7 @@ def pprint(self):
else:
return stream + ((tags and "\n" + tags) or "")

def add_tags(self):
def add_tags(self) -> None:
"""Adds new tags to the file.
Raises:
Expand All @@ -157,7 +157,7 @@ def add_tags(self):
raise NotImplementedError

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

mimes = []
Expand All @@ -168,7 +168,7 @@ def mime(self):
return mimes

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

__module__ = "mutagen"

def pprint(self):
def pprint(self) -> str:
"""
Returns:
text: Print stream information
Expand All @@ -221,13 +221,13 @@ def File(filething, options=None, easy=False):
filething (filething)
options: Sequence of :class:`FileType` implementations,
defaults to all included ones.
easy (bool): If the easy wrappers should be returnd if available.
easy (bool): If the easy wrappers should be returned if available.
For example :class:`EasyMP3 <mp3.EasyMP3>` instead of
:class:`MP3 <mp3.MP3>`.
Returns:
FileType: A FileType instance for the detected type or `None` in case
the type couln't be determined.
the type couldn't be determined.
Raises:
MutagenError: in case the detected type fails to load the file.
Expand Down Expand Up @@ -268,10 +268,12 @@ def File(filething, options=None, easy=False):
from mutagen.smf import SMF
from mutagen.tak import TAK
from mutagen.dsf import DSF
from mutagen.dsdiff import DSDIFF
from mutagen.wave import WAVE
options = [MP3, TrueAudio, OggTheora, OggSpeex, OggVorbis, OggFLAC,
FLAC, AIFF, APEv2File, MP4, ID3FileType, WavPack,
Musepack, MonkeysAudio, OptimFROG, ASF, OggOpus, AAC, AC3,
SMF, TAK, DSF]
SMF, TAK, DSF, DSDIFF, WAVE]

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

results = list(izip(results, options))
results = list(zip(results, options))
results.sort()
(score, name), Kind = results[-1]
if score > 0:
Expand Down
Loading

0 comments on commit 5577967

Please sign in to comment.