Skip to content

Instantly share code, notes, and snippets.

@rassie
Created February 1, 2010 23:28
Show Gist options
  • Save rassie/292172 to your computer and use it in GitHub Desktop.
Save rassie/292172 to your computer and use it in GitHub Desktop.
=== modified file 'picard/album.py'
--- picard/album.py 2010-01-11 22:53:17 +0000
+++ picard/album.py 2010-02-01 23:27:56 +0000
@@ -353,6 +353,11 @@
self._after_load_callbacks.put(func)
def update(self, update_tracks=True):
+ for track in self.tracks:
+ for file in track.linked_files:
+ file.update()
+ if len(track.linked_files) <> 1:
+ track.update()
self.tagger.emit(QtCore.SIGNAL("album_updated"), self, update_tracks)
def _add_file(self, track, file):
=== modified file 'picard/file.py'
--- picard/file.py 2010-01-11 22:53:17 +0000
+++ picard/file.py 2010-02-01 23:28:34 +0000
@@ -25,6 +25,7 @@
import re
import traceback
from PyQt4 import QtCore
+from picard.track import Track
from picard.metadata import Metadata
from picard.ui.item import Item
from picard.script import ScriptParser
@@ -357,6 +358,12 @@
self.similarity = 1.0
if self.state in (File.CHANGED, File.NORMAL):
self.state = File.NORMAL
+
+ if isinstance(self.parent, Track):
+ new_filename = self._make_filename(self.filename, self.metadata, self.tagger.config.setting)
+ if new_filename != self.filename:
+ self.state = File.CHANGED
+
if signal:
self.log.debug("Updating file %r", self)
self.parent.update_file(self)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment