Skip to content

Commit

Permalink
Version 2.0.4
Browse files Browse the repository at this point in the history
* URL path for images (#96)
* Minor improvements
  • Loading branch information
Cigaras committed Mar 16, 2017
1 parent 73e8c1f commit d0e45a5
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 17 deletions.
12 changes: 8 additions & 4 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.0.3
# Version 2.0.4

from m3u_parser import LoadPlaylist, PlaylistReloader
from xmltv_parser import GuideReloader
Expand All @@ -28,7 +28,7 @@ def Start():
ObjectContainer.art = R('art-default.jpg')
DirectoryObject.thumb = R('icon-folder.png')
DirectoryObject.art = R('art-default.jpg')
VideoClipObject.thumb = R('icon-tv.jpg')
VideoClipObject.thumb = R('icon-tv.png')
VideoClipObject.art = R('art-default.jpg')

if Prefs['m3u_reload_time'] == 'never' or not Dict['groups'] or not Dict['streams']:
Expand All @@ -44,7 +44,7 @@ def MainMenu():
if not Dict['groups']:
LoadPlaylist()
if not Dict['groups']:
return ObjectContainer(header = "Error", message = "Provided playlist files are invalid, missing or empty, check the log file for more information")
return ObjectContainer(header = unicode(L("Error")), message = unicode(L("Provided playlist files are invalid, missing or empty, check the log file for more information")))

groups = Dict['groups']
groups_list = groups.values()
Expand Down Expand Up @@ -98,7 +98,7 @@ def ListItems(group, page = 1):
if not Dict['streams']:
LoadPlaylist()
if not Dict['streams']:
return ObjectContainer(header = "Error", message = "Provided playlist files are invalid, missing or empty, check the log file for more information")
return ObjectContainer(header = unicode(L("Error")), message = unicode(L("Provided playlist files are invalid, missing or empty, check the log file for more information")))

group = unicode(group) # Plex loses unicode formating when passing string between @route procedures if string is not a part of a @route

Expand Down Expand Up @@ -209,6 +209,9 @@ def GetImage(file_name, default):
if file_name:
if file_name.startswith('http'):
return Resource.ContentsOfURLWithFallback(file_name, fallback = R(default))
elif Prefs['images_url'].startswith('http'):
file_name = Prefs['images_url'] + file_name if Prefs['images_url'].endswith('/') else Prefs['images_url'] + '/' + file_name
return Resource.ContentsOfURLWithFallback(file_name, fallback = R(default))
else:
r = R(file_name)
if r:
Expand Down Expand Up @@ -264,4 +267,5 @@ def GetSummary(id, name, title, default = ''):

####################################################################################################
def ValidatePrefs():

pass
6 changes: 6 additions & 0 deletions Contents/DefaultPrefs.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@
"type": "text",
"default": ""
},
{
"id": "images_url",
"label": "URL path where images are located, if left empty images will be loaded from Resources folder",
"type": "text",
"default": ""
},
{
"id": "filename_groups",
"label": "Use file name as group name if group-title attribute is absent",
Expand Down
16 changes: 4 additions & 12 deletions Contents/Resources/playlist.m3u
Original file line number Diff line number Diff line change
@@ -1,17 +1,9 @@
#EXTM3U
#EXTINF:0 tvg-id="Dummy" tvg-name="ABC News" tvg-logo="http://upload.wikimedia.org/wikipedia/en/f/fa/ABCNewsLogo.png" group-title="News",ABC News (http)
#EXTINF:0 tvg-id="1" tvg-name="ABC News" tvg-logo="http://upload.wikimedia.org/wikipedia/en/f/fa/ABCNewsLogo.png" group-title="News",ABC News (http)
http://abclive.abcnews.com/i/abc_live4@136330/index_1200_av-b.m3u8
#EXTINF:0 tvg-id="Dummy" tvg-name="NDTV" tvg-logo="http://upload.wikimedia.org/wikipedia/commons/thumb/c/c5/NDTV_logo.svg/2000px-NDTV_logo.svg.png" group-title="News",NDTV (http)
#EXTINF:0 tvg-id="2" tvg-name="NDTV" tvg-logo="http://upload.wikimedia.org/wikipedia/commons/thumb/c/c5/NDTV_logo.svg/2000px-NDTV_logo.svg.png" group-title="News",NDTV (http)
http://bglive-a.bitgravity.com/ndtv/247hi/live/native
#EXTINF:0 tvg-id="Dummy" tvg-name="NDTV" tvg-logo="http://upload.wikimedia.org/wikipedia/commons/thumb/c/c5/NDTV_logo.svg/2000px-NDTV_logo.svg.png" group-title="News",NDTV alternative link (http)
#EXTINF:0 tvg-id="2" tvg-name="NDTV" tvg-logo="http://upload.wikimedia.org/wikipedia/commons/thumb/c/c5/NDTV_logo.svg/2000px-NDTV_logo.svg.png" group-title="News",NDTV alternative link (http)
http://ndtv.live.cdn.bitgravity.com/ndtv/live/ndtv247live512
#EXTINF:0 tvg-id="Dummy" tvg-name="Sky TG24" tvg-logo="http://upload.wikimedia.org/wikipedia/en/9/91/SKY_TG24.png" group-title="News",Sky TG24 (rtmp)
rtmp://cp49989.live.edgefcs.net:1935/live/streamRM1@2564
#EXTINF:0 tvg-id="Dummy" tvg-name="ABC News" tvg-logo="http://upload.wikimedia.org/wikipedia/en/f/fa/ABCNewsLogo.png" group-title="English",ABC News (http)
http://abclive.abcnews.com/i/abc_live4@136330/index_1200_av-b.m3u8
#EXTINF:0 tvg-id="Dummy" tvg-name="NDTV" tvg-logo="http://upload.wikimedia.org/wikipedia/commons/thumb/c/c5/NDTV_logo.svg/2000px-NDTV_logo.svg.png" group-title="English",NDTV (http)
http://bglive-a.bitgravity.com/ndtv/247hi/live/native
#EXTINF:0 tvg-id="Dummy" tvg-name="NDTV" tvg-logo="http://upload.wikimedia.org/wikipedia/commons/thumb/c/c5/NDTV_logo.svg/2000px-NDTV_logo.svg.png" group-title="English",NDTV alternative link (http)
http://ndtv.live.cdn.bitgravity.com/ndtv/live/ndtv247live512
#EXTINF:0 tvg-id="Dummy" tvg-name="Sky TG24" tvg-logo="http://upload.wikimedia.org/wikipedia/en/9/91/SKY_TG24.png" group-title="Italian",Sky TG24 (rtmp)
#EXTINF:0 tvg-id="3" tvg-name="Sky TG24" tvg-logo="http://upload.wikimedia.org/wikipedia/en/9/91/SKY_TG24.png" group-title="News",Sky TG24 (rtmp)
rtmp://cp49989.live.edgefcs.net:1935/live/streamRM1@2564
4 changes: 3 additions & 1 deletion Contents/Strings/en.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
"All": "All",
"No Category": "No Category",
"No description available": "No description available"
"No description available": "No description available",
"Error": "Error",
"Provided playlist files are invalid, missing or empty, check the log file for more information": "Provided playlist files are invalid, missing or empty, check the log file for more information"
}

0 comments on commit d0e45a5

Please sign in to comment.