From f5edf81cbb7c2b61853c86690b4f4f2ade65c374 Mon Sep 17 00:00:00 2001 From: MrS0m30n3 Date: Mon, 7 Nov 2016 17:53:58 +0200 Subject: [PATCH] Worker._data_hook: Remove caching --- youtube_dl_gui/downloadmanager.py | 43 ++++++++++++++++--------------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/youtube_dl_gui/downloadmanager.py b/youtube_dl_gui/downloadmanager.py index f7168c8..09e2de2 100644 --- a/youtube_dl_gui/downloadmanager.py +++ b/youtube_dl_gui/downloadmanager.py @@ -650,27 +650,28 @@ class Worker(Thread): extract_data() function under the downloaders.py module. """ - # Temp dictionary which holds the updates - temp_dict = {} - - # Update each key - for key in data: - if self._data[key] != data[key]: - self._data[key] = data[key] - temp_dict[key] = data[key] - - # Build the playlist status if there is an update - # REFACTOR re-implement this on DownloadItem or ListCtrl level? - #if self._data['playlist_index'] is not None: - #if 'status' in temp_dict or 'playlist_index' in temp_dict: - #temp_dict['status'] = '{status} {index}/{size}'.format( - #status=self._data['status'], - #index=self._data['playlist_index'], - #size=self._data['playlist_size'] - #) - - if len(temp_dict): - self._talk_to_gui('send', temp_dict) + ## Temp dictionary which holds the updates + #temp_dict = {} + + ## Update each key + #for key in data: + #if self._data[key] != data[key]: + #self._data[key] = data[key] + #temp_dict[key] = data[key] + + ## Build the playlist status if there is an update + ## REFACTOR re-implement this on DownloadItem or ListCtrl level? + ##if self._data['playlist_index'] is not None: + ##if 'status' in temp_dict or 'playlist_index' in temp_dict: + ##temp_dict['status'] = '{status} {index}/{size}'.format( + ##status=self._data['status'], + ##index=self._data['playlist_index'], + ##size=self._data['playlist_size'] + ##) + + #if len(temp_dict): + #self._talk_to_gui('send', temp_dict) + self._talk_to_gui('send', data) def _talk_to_gui(self, signal, data): """Communicate with the GUI using wxCallAfter and wxPublisher.