Skip to content

Commit

Permalink
Version 2.1.1
Browse files Browse the repository at this point in the history
* Playlist and guide reload warning fix
  • Loading branch information
Cigaras committed May 15, 2017
1 parent 9193e0a commit 5cefb59
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 35 deletions.
50 changes: 47 additions & 3 deletions Contents/Code/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.

# Version 2.1.0
# Version 2.1.1

from m3u_parser import LoadPlaylist, PlaylistReloader
from xmltv_parser import LoadGuide, GuideReloader
Expand Down Expand Up @@ -64,15 +64,15 @@ def MainMenu():
if Prefs['m3u_manual_reload']:
oc.add(
DirectoryObject(
key = Callback(LoadPlaylist),
key = Callback(ReloadPlaylist),
title = unicode(L('Reload playlist')),
thumb = R('icon-reload.png')
)
)
if Prefs['xmltv'] and Prefs['xmltv_manual_reload']:
oc.add(
DirectoryObject(
key = Callback(LoadGuide),
key = Callback(ReloadGuide),
title = unicode(L('Reload program guide')),
thumb = R('icon-reload.png')
)
Expand Down Expand Up @@ -270,6 +270,50 @@ def PlayVideo(url):

return IndirectResponse(VideoClipObject, key = url)

####################################################################################################
@route(PREFIX + '/reloadplaylist')
def ReloadPlaylist():

if Dict['playlist_loading_in_progress']:
return ObjectContainer(header = unicode(L('Warning')), message = unicode(L('Playlist is reloading in the background, please wait')))

LoadPlaylist()

if Dict['groups']:
return ObjectContainer(
title1 = unicode(L('Success')),
header = unicode(L('Success')),
message = unicode(L('Playlist reloaded successfully'))
)
else:
return ObjectContainer(
title1 = unicode(L('Error')),
header = unicode(L('Error')),
message = unicode(L('Provided playlist files are invalid, missing or empty, check the log file for more information'))
)

####################################################################################################
@route(PREFIX + '/reloadguide')
def ReloadGuide():

if Dict['guide_loading_in_progress']:
return ObjectContainer(header = unicode(L('Warning')), message = unicode(L('Program guide is reloading in the background, please wait')))

LoadGuide()

if Dict['guide']:
return ObjectContainer(
title1 = unicode(L('Success')),
header = unicode(L('Success')),
message = unicode(L('Program guide reloaded successfully'))
)
else:
return ObjectContainer(
title1 = unicode(L('Error')),
header = unicode(L('Error')),
message = unicode(L('Provided program guide files are invalid, missing or empty, check the log file for more information'))
)

####################################################################################################
def GetImage(file_name, default, title = ''):

Expand Down
16 changes: 0 additions & 16 deletions Contents/Code/m3u_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@
####################################################################################################
def LoadPlaylist():

if Dict['playlist_loading_in_progress']:
return ObjectContainer(header = unicode(L('Warning')), message = unicode(L('Playlist is reloading in the background, please wait')))

Dict['playlist_loading_in_progress'] = True

groups = {}
Expand All @@ -37,19 +34,6 @@ def LoadPlaylist():
Dict['last_playlist_load_filename_groups'] = Prefs['filename_groups']
Dict['playlist_loading_in_progress'] = False

if Dict['groups']:
return ObjectContainer(
title1 = unicode(L('Success')),
header = unicode(L('Success')),
message = unicode(L('Playlist reloaded successfully'))
)
else:
return ObjectContainer(
title1 = unicode(L('Error')),
header = unicode(L('Error')),
message = unicode(L('Provided playlist files are invalid, missing or empty, check the log file for more information'))
)

####################################################################################################
def LoadM3UFile(m3u_file, groups = {}, streams = {}, cust_m3u_name = None):

Expand Down
16 changes: 0 additions & 16 deletions Contents/Code/xmltv_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@
####################################################################################################
def LoadGuide():

if Dict['guide_loading_in_progress']:
return ObjectContainer(header = unicode(L('Warning')), message = unicode(L('Program guide is reloading in the background, please wait')))

Dict['guide_loading_in_progress'] = True

channels = {}
Expand Down Expand Up @@ -91,19 +88,6 @@ def LoadGuide():
Dict['last_guide_load_prefs'] = Prefs['xmltv']
Dict['guide_loading_in_progress'] = False

if Dict['guide']:
return ObjectContainer(
title1 = unicode(L('Success')),
header = unicode(L('Success')),
message = unicode(L('Program guide reloaded successfully'))
)
else:
return ObjectContainer(
title1 = unicode(L('Error')),
header = unicode(L('Error')),
message = unicode(L('Provided program guide files are invalid, missing or empty, check the log file for more information'))
)

####################################################################################################
def StringToLocalDatetime(arg_string):

Expand Down

0 comments on commit 5cefb59

Please sign in to comment.