Only override album it is empty
This commit is contained in:
parent
481c049c97
commit
2e9fc432b1
1 changed files with 5 additions and 4 deletions
|
@ -152,10 +152,11 @@ def podcast_download(id, url, callback_url, api_key, podcast_name):
|
||||||
filename = get_filename(r)
|
filename = get_filename(r)
|
||||||
with tempfile.NamedTemporaryFile(mode ='wb+', delete=False) as audiofile:
|
with tempfile.NamedTemporaryFile(mode ='wb+', delete=False) as audiofile:
|
||||||
shutil.copyfileobj(r.raw, audiofile)
|
shutil.copyfileobj(r.raw, audiofile)
|
||||||
#m = mutagen.File(audiofile.name, easy=True)
|
|
||||||
# currently hardcoded for mp3s may want to add support for oggs etc
|
# currently hardcoded for mp3s may want to add support for oggs etc
|
||||||
m = MP3(audiofile.name, ID3=EasyID3)
|
m = MP3(audiofile.name, ID3=EasyID3)
|
||||||
#m = EasyID3(audiofile.name)
|
try:
|
||||||
|
m['album']
|
||||||
|
except KeyError:
|
||||||
m['album'] = [podcast_name]
|
m['album'] = [podcast_name]
|
||||||
m.save()
|
m.save()
|
||||||
filetypeinfo = m.pprint()
|
filetypeinfo = m.pprint()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue