Use archived analysis from Ogg and FLAC files

This commit is contained in:
Lukáš Lalinský
2008-03-18 18:44:49 +01:00
parent ba608c2a10
commit bdcde572ed
2 changed files with 8 additions and 1 deletions

View File

@@ -47,6 +47,9 @@ class VCommentFile(File):
if start > 0:
name += ':' + value[start + 2:-1]
value = value[:start]
elif name == "fingerprint" and value.startswith("MusicMagic Fingerprint"):
name = "musicip_fingerprint"
value = value[22:]
metadata.add(name, value)
self._info(metadata, file)
return metadata
@@ -74,6 +77,9 @@ class VCommentFile(File):
name, desc = name.split(':', 1)
if desc:
value += ' (%s)' % desc
elif name == "musicip_fingerprint":
name = "fingerprint"
value = "MusicMagic Fingerprint%s" % value
tags.setdefault(name.upper().encode('utf-8'), []).append(value)
file.tags.update(tags)
kwargs = {}

View File

@@ -141,7 +141,8 @@ class OFA(QtCore.QObject):
# use cached fingerpring
fingerprints = file.metadata.getall('musicip_fingerprint')
if fingerprints:
self._lookup_fingerprint(file, next, result=(fingerprints[0], 0))
self._lookup_fingerprint(self.tagger.analyze_queue.next,
file.filename, result=(fingerprints[0], 0))
return
# calculate fingerprint
if ofa is not None: