metadata = flac.get_tags()
album_name = metadata['album']
mp3_file = self.dest_dir + os.sep + album_name + '.mp3'
- #if not os.path.exists(mp3_file):
- f = self.flac_player(media_list, None)
- m = self.mp3_encode(f.stdout, mp3_file)
- print 'Encoding ' + mp3_file
- m.proc.wait()
- print 'Writing metadata...'
- mp3 = Mp3(mp3_file)
- mp3.metadata = metadata
- mp3.metadata['title'] = album_name
- mp3.metadata['comment'] = 'Cellar_playlist'
- mp3.write_tags()
- print 'Done !'
+ if not os.path.exists(mp3_file):
+ f = self.flac_player(media_list, None)
+ m = self.mp3_encode(f.stdout, mp3_file)
+ print 'Encoding ' + mp3_file
+ m.proc.wait()
+ print 'Writing metadata...'
+ mp3 = Mp3(mp3_file)
+ mp3.metadata = metadata
+ mp3.metadata['title'] = album_name
+ mp3.metadata['comment'] = 'Cellar_playlist'
+ mp3.write_tags()
+ print 'Done !'
+ else:
+ print 'File already exits !'
+ print mp3_file
if __name__ == '__main__':