Add status bar messages for metadata lookups.

This commit is contained in:
Lukáš Lalinský
2007-02-25 09:33:15 +01:00
parent 9effa90232
commit 48e3cc2aeb
2 changed files with 7 additions and 4 deletions

View File

@@ -145,7 +145,7 @@ class Cluster(QtCore.QObject, Item):
# no matches
if not releases:
self.tagger.window.set_statusbar_message(N_("No matching releases for cluster %s"), self.metadata['album'])
self.tagger.window.set_statusbar_message(N_("No matching releases for cluster %s"), self.metadata['album'], timeout=3000)
return
# multiple matches -- calculate similarities to each of them
@@ -156,13 +156,14 @@ class Cluster(QtCore.QObject, Item):
self.log.debug("Matches: %r", matches)
if matches[0][0] < self.config.setting['cluster_lookup_threshold']:
self.tagger.window.set_statusbar_message(N_("No matching releases for cluster %s"), self.metadata['album'])
self.tagger.window.set_statusbar_message(N_("No matching releases for cluster %s"), self.metadata['album'], timeout=3000)
return
self.tagger.window.set_statusbar_message(N_("Cluster %s identified!"), self.metadata['album'], timeout=3000)
self.tagger.move_files_to_album(self.files, matches[0][1].id)
def lookup_metadata(self):
""" Try to identify the cluster using the existing metadata. """
self.tagger.window.set_statusbar_message(N_("Looking up the metadata for cluster %s..."), self.metadata['album'])
self.tagger.xmlws.find_releases(self._lookup_finished,
artist=self.metadata.get('artist', ''),
release=self.metadata.get('album', ''),

View File

@@ -300,7 +300,7 @@ class File(LockableObject, Item):
# no matches
if not tracks:
self.tagger.window.set_statusbar_message(N_("No matching tracks for file %s"), self.filename)
self.tagger.window.set_statusbar_message(N_("No matching tracks for file %s"), self.filename, timeout=3000)
self.clear_pending()
return
@@ -317,7 +317,7 @@ class File(LockableObject, Item):
threshold = self.config.setting['file_lookup_threshold']
if matches[0][0] < threshold:
self.tagger.window.set_statusbar_message(N_("No matching tracks for file %s"), self.filename)
self.tagger.window.set_statusbar_message(N_("No matching tracks for file %s"), self.filename, timeout=3000)
self.clear_pending()
return
self.tagger.window.set_statusbar_message(N_("File %s identified!"), self.filename, timeout=3000)
@@ -329,10 +329,12 @@ class File(LockableObject, Item):
def lookup_puid(self, puid):
""" Try to identify the file using the PUID. """
self.tagger.window.set_statusbar_message(N_("Looking up the PUID for file %s..."), self.filename)
self.tagger.xmlws.find_tracks(partial(self._lookup_finished, 'puid'), puid=puid)
def lookup_metadata(self):
""" Try to identify the file using the existing metadata. """
self.tagger.window.set_statusbar_message(N_("Looking up the metadata for file %s..."), self.filename)
self.tagger.xmlws.find_tracks(partial(self._lookup_finished, 'metadata'),
track=self.metadata.get('title', ''),
artist=self.metadata.get('artist', ''),