Restyled by yapf
This commit is contained in:
@@ -19,26 +19,26 @@ class VorbisOnlyAudioQuality(AudioQualityPicker):
|
||||
@staticmethod
|
||||
def get_vorbis_file(files: typing.List[Metadata.AudioFile]):
|
||||
for file in files:
|
||||
if (
|
||||
hasattr(file, "format")
|
||||
and SuperAudioFormat.get(file.format) == SuperAudioFormat.VORBIS
|
||||
):
|
||||
if (hasattr(file, "format") and SuperAudioFormat.get(file.format)
|
||||
== SuperAudioFormat.VORBIS):
|
||||
return file
|
||||
|
||||
return None
|
||||
|
||||
def get_file(self, files: typing.List[Metadata.AudioFile]):
|
||||
matches: typing.List[Metadata.AudioFile] = self.preferred.get_matches(files)
|
||||
vorbis: Metadata.AudioFile = VorbisOnlyAudioQuality.get_vorbis_file(matches)
|
||||
matches: typing.List[Metadata.AudioFile] = self.preferred.get_matches(
|
||||
files)
|
||||
vorbis: Metadata.AudioFile = VorbisOnlyAudioQuality.get_vorbis_file(
|
||||
matches)
|
||||
if vorbis is None:
|
||||
vorbis: Metadata.AudioFile = VorbisOnlyAudioQuality.get_vorbis_file(files)
|
||||
vorbis: Metadata.AudioFile = VorbisOnlyAudioQuality.get_vorbis_file(
|
||||
files)
|
||||
if vorbis is not None:
|
||||
self._LOGGER.warning(
|
||||
"Using {} because preferred {} couldn't be found.".format(
|
||||
vorbis.format, self.preferred
|
||||
)
|
||||
)
|
||||
vorbis.format, self.preferred))
|
||||
else:
|
||||
self._LOGGER.fatal("Couldn't find any Vorbis file, available: {}")
|
||||
self._LOGGER.fatal(
|
||||
"Couldn't find any Vorbis file, available: {}")
|
||||
|
||||
return vorbis
|
||||
|
||||
Reference in New Issue
Block a user