From aa86cf1372446f5b05a0e53c487337c58b72127d Mon Sep 17 00:00:00 2001 From: MrS0m30n3 Date: Sun, 25 Sep 2016 23:47:58 +0300 Subject: [PATCH] _on_play check if filenames are available --- youtube_dl_gui/mainframe.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/youtube_dl_gui/mainframe.py b/youtube_dl_gui/mainframe.py index e51b480..aeda1cc 100644 --- a/youtube_dl_gui/mainframe.py +++ b/youtube_dl_gui/mainframe.py @@ -179,7 +179,6 @@ class MainFrame(wx.Frame): self.update_thread = None self.app_icon = None - # TODO move it elsewhere? self._download_list = DownloadList() # Set up youtube-dl options parser @@ -373,9 +372,9 @@ class MainFrame(wx.Frame): selected_download_item = self._download_list.get_item(object_id) if selected_download_item.stage == "Completed": - # TODO Check if list has items - filename = selected_download_item.get_files()[-1] - open_file(filename) + if selected_download_item.filenames: + filename = selected_download_item.get_files()[-1] + open_file(filename) else: self._create_popup("Item is not completed", self.INFO_LABEL, wx.OK | wx.ICON_INFORMATION)