added a safe-filename function so we will be sure the suggested filename won't break anything in the operating system

This commit is contained in:
2019-10-14 17:25:06 -05:00
parent 9e6e72c0a1
commit 0cdfc253d2
3 changed files with 7 additions and 3 deletions

View File

@@ -73,7 +73,7 @@ class displayAudioPresenter(base.basePresenter):
def get_suggested_filename(self, audio_index):
post = self.post[audio_index]
return "{0} - {1}.mp3".format(post["title"], post["artist"])
return utils.safe_filename("{0} - {1}.mp3".format(post["title"], post["artist"]))
def download(self, audio_index, path):
post = self.post[audio_index]