Merge branch 'master' into PICARD-1332-restore-deleted-file-tags

This commit is contained in:
Laurent Monin
2018-09-05 09:05:27 +02:00
committed by GitHub
5 changed files with 21 additions and 2 deletions

View File

@@ -275,7 +275,8 @@ class OptimFROGFile(APEv2File):
def _info(self, metadata, file):
super()._info(metadata, file)
if file.filename.lower().endswith(".ofs"):
# mutagen.File.filename can be either a bytes or str object
if string_(file.filename.lower()).endswith(".ofs"):
metadata['~format'] = "OptimFROG DualStream Audio"
else:
metadata['~format'] = "OptimFROG Lossless Audio"

View File

@@ -446,7 +446,7 @@ class PluginManager(QtCore.QObject):
try:
installed_plugin = self.load_plugin(zip_plugin or plugin_name, USER_PLUGIN_DIR)
except Exception as e:
log.error('Unable to load plugin: %s.\nError occured: %s', name, e)
log.error('Unable to load plugin: %s.\nError occured: %s', plugin_name, e)
installed_plugin = None
if installed_plugin is not None:

BIN
test/data/test.ofr Normal file

Binary file not shown.

BIN
test/data/test.ofs Normal file

Binary file not shown.

View File

@@ -534,6 +534,24 @@ class TAKTest(CommonTests.FormatsTest):
supports_ratings = False
class OptimFROGLosslessTest(CommonTests.FormatsTest):
testfile = 'test.ofr'
supports_ratings = False
def test_format(self):
metadata = load_metadata(self.filename)
self.assertEqual(metadata['~format'], 'OptimFROG Lossless Audio')
class OptimFROGDUalStreamTest(CommonTests.FormatsTest):
testfile = 'test.ofs'
supports_ratings = False
def test_format(self):
metadata = load_metadata(self.filename)
self.assertEqual(metadata['~format'], 'OptimFROG DualStream Audio')
cover_settings = {
'embed_only_one_front_image': True,
}