def get_dynamic_path(media, filename, ext=ext):
# how to put related book's slug here?
if not ext:
- ext = media.type
+ if media.type == 'daisy':
+ ext = 'daisy.zip'
+ else:
+ ext = media.type
if not media.name:
name = slughifi(filename.split(".")[0])
else:
name = slughifi(media.name)
- return 'lektura/%s.%s' % (name[:(maxlen-len('lektura/.%s' % ext))], ext)
+ return 'lektura/%s.%s' % (name[:maxlen-len('lektura/.%s' % ext)-4], ext)
return get_dynamic_path