mirror of
https://github.com/fergalmoran/picard.git
synced 2026-02-23 16:15:02 +00:00
Fix crash when the file doesn't belong to an album
If the file doesn't belong to an album, we have to load a NAT and then move the file there. Also fix the call to self.tagger.move_file_to_nat which was missing a parameter (the file to move)
This commit is contained in:
committed by
Sambhav Kothari
parent
7fcafe7822
commit
ef4130e785
@@ -197,10 +197,11 @@ class TrackSearchDialog(SearchDialog):
|
||||
# No files associated. Just a normal search.
|
||||
self.tagger.load_album(track["musicbrainz_albumid"])
|
||||
else:
|
||||
if self.file_:
|
||||
if self.file_ and getattr(self.file_.parent, 'album', None):
|
||||
album = self.file_.parent.album
|
||||
self.tagger.move_file_to_nat(track["musicbrainz_recordingid"])
|
||||
self.tagger.move_file_to_nat(self.file_, track["musicbrainz_recordingid"], node)
|
||||
if album._files == 0:
|
||||
self.tagger.remove_album(album)
|
||||
else:
|
||||
self.tagger.load_nat(track["musicbrainz_recordingid"], node)
|
||||
self.tagger.move_file_to_nat(self.file_, track["musicbrainz_recordingid"], node)
|
||||
|
||||
Reference in New Issue
Block a user