diff --git a/picard/ui/itemviews.py b/picard/ui/itemviews.py index 6817e2ecb..c8bc82f73 100644 --- a/picard/ui/itemviews.py +++ b/picard/ui/itemviews.py @@ -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):