Skip to content

Commit

Permalink
v1.2.3:
Browse files Browse the repository at this point in the history
- fixed adding favourites
  • Loading branch information
fayer3 committed Sep 6, 2019
1 parent b200865 commit 5f36a96
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 10 deletions.
6 changes: 4 additions & 2 deletions addon.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="plugin.video.zappntv" name="Zappn TV" version="1.2.2" provider-name="fayer3">
<addon id="plugin.video.zappntv" name="Zappn TV" version="1.2.3" provider-name="fayer3">
<requires>
<import addon="xbmc.python" version="2.25.0"/>
<import addon="script.module.routing" version="0.2.0"/>
Expand All @@ -26,7 +26,9 @@
<news>- Möglichkeit hinzugefügt, Serien über Rechtsklick zu favoriten hinzuzufügen
- Suche auf Betriebsystemen mit Multiprozess unterstützung beschleunigt (alles außer Android)
1.2.2:
- pfade für neue plugin routing addon angepasst, zerstört leider alte gespeicherte Favoriten, diese müssen neu hinzugefügt werden.</news>
- pfade für neue plugin routing addon angepasst, zerstört leider alte gespeicherte Favoriten, diese müssen neu hinzugefügt werden.
1.2.3:
- hinzufügen von favoriten repariert.</news>
<assets>
<icon>resources/icon.png</icon>
<fanart>resources/fanart.png</fanart>
Expand Down
2 changes: 2 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,5 @@ v1.2.0
- speed up search on operating systems with multiprocess support (everything except Android)
v1.2.2:
- adapt paths to new plugin routing addon, sadly ruins old saved favourites, the need to be newly added.
v1.2.3:
- fixed adding favourites
34 changes: 26 additions & 8 deletions resources/lib/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -811,14 +811,34 @@ def add_favorites_context_menu(listitem, path, name, icon, fanart):
@plugin.route('/add_fav')
def add_favorite():
#data = plugin.args['query'][0].split('***')
path = unquote(plugin.args['path'][0])
name = unquote(plugin.args['name'][0])
path = plugin.args['path'][0]
name = plugin.args['name'][0]
icon = ""
if 'icon' in plugin.args:
icon = unquote(plugin.args['icon'][0])
icon = plugin.args['icon'][0]
fanart = ""
if 'fanart' in plugin.args:
fanart = unquote(plugin.args['fanart'][0])
fanart = plugin.args['fanart'][0]

if sys.version_info[0] < 3:
# decode utf-8
path = path.encode('ascii')
name = name.encode('ascii')
icon = icon.encode('ascii')
fanart = fanart.encode('ascii')

path = unquote(path)
name = unquote(name)
icon = unquote(icon)
fanart = unquote(fanart)

if sys.version_info[0] < 3:
# decode utf-8
path = path.decode('utf-8')
name = name.decode('utf-8')
icon = icon.decode('utf-8')
fanart = fanart.decode('utf-8')

# load favorites
global favorites
if not favorites and xbmcvfs.exists(favorites_file_path):
Expand All @@ -833,10 +853,8 @@ def add_favorite():
json.dump(favorites, favorites_file, indent=2)
favorites_file.close()

try:
kodiutils.notification(kodiutils.get_string(32010), kodiutils.get_string(32011).format(codecs.decode(name, 'utf-8')))
except TypeError:
kodiutils.notification(kodiutils.get_string(32010), kodiutils.get_string(32011).format(codecs.decode(bytes(name, 'utf-8'), 'utf-8')))

kodiutils.notification(kodiutils.get_string(32010), kodiutils.get_string(32011).format(name))
xbmc.executebuiltin('Container.Refresh')
setResolvedUrl(plugin.handle, True, ListItem("none"))

Expand Down

0 comments on commit 5f36a96

Please sign in to comment.