From: James Bunton Date: Tue, 28 Aug 2012 22:14:56 +0000 (+1000) Subject: Ignore tracks not in the library X-Git-Url: https://code.delx.au/notipod/commitdiff_plain/940330ce5a487a919446ee62f920646c2e38fee5 Ignore tracks not in the library --- diff --git a/notipod_gui.py b/notipod_gui.py index d37350e..11c6880 100644 --- a/notipod_gui.py +++ b/notipod_gui.py @@ -267,7 +267,9 @@ class NotiPodController(NSObject): all_filenames = [] for trackID in all_tracks: - all_filenames.append(self.library.get_track_filename(trackID)) + f = self.library.get_track_filename(trackID) + if f: + all_filenames.append(f) gen = libnotipod.sync( dry_run=True, @@ -308,7 +310,9 @@ class NotiPodController(NSObject): all_filenames = [] for trackID in all_tracks: - all_filenames.append(self.library.get_track_filename(trackID)) + f = self.library.get_track_filename(trackID) + if f: + all_filenames.append(f) all_playlists.update(self.library.get_track_playlists(trackID)) libnotipod.delete_playlists(dry_run=False, dest=target["folder"]) @@ -319,8 +323,11 @@ class NotiPodController(NSObject): continue tracks = [] for trackID in playlist.tracks: - if trackID in all_tracks: - tracks.append(self.library.get_track_filename(trackID)) + if trackID not in all_tracks: + continue + f = self.library.get_track_filename(trackID) + if f: + tracks.append(f) if playlist_id not in orig_playlists and len(tracks) < 10: continue libnotipod.export_m3u(