Browse Source

Worker._data_hook: Remove caching

doc-issue-template
MrS0m30n3 8 years ago
parent
commit
f5edf81cbb
1 changed files with 22 additions and 21 deletions
  1. 43
      youtube_dl_gui/downloadmanager.py

43
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.

Loading…
Cancel
Save