From 48e8c49d58e54bf23b4afa62320de9198bf36a14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Lalinsk=C3=BD?= Date: Wed, 22 Nov 2006 22:15:10 +0100 Subject: [PATCH] Set "pending" status before fingerprinting the file. --- picard/tagger.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/picard/tagger.py b/picard/tagger.py index 08d7503da..a475b9e22 100644 --- a/picard/tagger.py +++ b/picard/tagger.py @@ -691,6 +691,9 @@ class Tagger(QtGui.QApplication, ComponentManager, Component): def analyze(self, objs): """Analyze the selected files.""" files = self.get_files_from_objects(objs) + for file in files: + file.state = File.PENDING + file.update() self.thread_assist.spawn(self.__analyze_thread, files, thread=self._analyze_thread) @@ -713,6 +716,8 @@ class Tagger(QtGui.QApplication, ComponentManager, Component): from picard.musicdns.webservice import TrackFilter, Query ws = self.get_web_service(host="ofa.musicdns.org", pathPrefix="/ofa") for file in files: + if file.state != File.PENDING: + continue file.lock_for_read() try: filename = file.filename @@ -755,6 +760,9 @@ class Tagger(QtGui.QApplication, ComponentManager, Component): self.__lookup_puid(file) else: self.log.debug("Fingerprint looked up, no PUID found.") + if file.state == File.PENDING: + file.state = File.NORMAL + file.update() def cluster(self, objs): """Group files with similar metadata to 'clusters'."""