Commits

Vladimir Kolev committed c6dd2f8

Added renaming pattern for download filenames now works

Comments (0)

Files changed (1)

         for path in select[1]:
             song = self.result_song(path[0])
 
-            filename = "%s - %s.mp3" % (song["ArtistName"].strip("<>:\"/\|?*"),
-                                    song["SongName"].strip("<>:\"/\|?*"))
+            #filename = "%s - %s.mp3" % (song["ArtistName"].strip("<>:\"/\|?*"),
+            #                        song["SongName"].strip("<>:\"/\|?*"))
+            pattern = CONFIG['file_pattern'] + ".mp3"
+            filename = pattern.format(artist = song['ArtistName'].strip("<>:\"/\|?*"),
+                                      song = song["SongName"].strip("<>:\"/\|?*"),
+                                      album = song["AlbumName"].strip("<>:\"/\|?*"))
             filename = filename.replace('/', '-')
             filename = os.path.join(CONFIG['down_path'], filename)
             filename = self.get_overwritten_filename(filename)