Moving matched files from album to cluster.

This commit is contained in:
Lukáš Lalinský
2006-09-05 23:01:50 +02:00
parent c39b9b40c4
commit ac228ba641

View File

@@ -145,6 +145,15 @@ class BaseTreeView(QtGui.QTreeWidget):
for file in files:
target.matchFile(file)
def dropAlbums(self, albums, target):
# Album -> Cluster
if isinstance(target, Cluster):
for album in albums:
for track in album.tracks:
if track.isLinked():
file = track.getLinkedFile()
file.moveToCluster(target)
def dropUrls(self, urls, target):
# URL -> Unmatched Files
# TODO: use the drop target to move files to specific albums/tracks/clusters
@@ -182,6 +191,13 @@ class BaseTreeView(QtGui.QTreeWidget):
files = [self.tagger.fileManager.getFile(int(fileId)) for fileId in str(files).split("\n")]
self.dropFiles(files, target)
# application/picard.album-list
albums = data.data("application/picard.album-list")
if albums:
albums = [self.tagger.albumManager.getAlbumById(albumsId) for albumsId in str(albums).split("\n")]
print albums
self.dropAlbums(albums, target)
return True
class FileTreeView(BaseTreeView):