Skip to content

Commit

Permalink
Fix freeze when trying to play from recently downloaded files
Browse files Browse the repository at this point in the history
  • Loading branch information
mx3L committed Apr 15, 2017
1 parent 883cf81 commit 5ab8c43
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion build/plugin/src/gui/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from Plugins.Extensions.archivCZSK.compat import eConnectCallback
from Plugins.Extensions.archivCZSK.engine.downloader import DownloadManager
from Plugins.Extensions.archivCZSK.engine.tools import util
from Plugins.Extensions.archivCZSK.engine.items import PVideo
from Plugins.Extensions.archivCZSK.gsession import GlobalSession
from base import BaseArchivCZSKScreen, BaseArchivCZSKMenuListScreen
from common import PanelListDownload, PanelListDownloadEntry, \
Expand Down Expand Up @@ -350,7 +351,13 @@ def askPlayDownload(self):
def playDownload(self, callback=None):
if callback:
download = self.getSelectedItem()
self.player.play_item(download)
video_item = PVideo()
video_item.name = download.name
video_item.url = download.local
subpath = os.path.splitext(download.local)[0] + '.srt'
if os.path.isfile(subpath):
video_item.subs = subpath
self.player.play_item(video_item)
else:
self.workingFinished()

Expand Down

0 comments on commit 5ab8c43

Please sign in to comment.