Skip to content

Commit

Permalink
global params is now _PARAMS
Browse files Browse the repository at this point in the history
  • Loading branch information
pablouser1 committed Dec 29, 2023
1 parent ebd2cc1 commit 4c714f1
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
tag: v${{ steps.version.outputs.info }}
body: ${{ steps.changelog.outputs.info }}
allowUpdates: true
skipIfReleaseExists: true
2 changes: 1 addition & 1 deletion resources/lib/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@

_URL = argv[0]
_HANDLE = int(argv[1])
params = dict(parse_qsl(argv[2][1:]))
_PARAMS = dict(parse_qsl(argv[2][1:]))
config = Config()
api = Api(config.getDomain())
6 changes: 3 additions & 3 deletions resources/lib/dispatcher.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .common import params
from .common import _PARAMS

class Dispatcher:
functions = {}
Expand All @@ -22,9 +22,9 @@ def run(self, route: str):
# Add args
if self.args[route]:
for arg in self.args[route]:
if arg not in params:
if arg not in _PARAMS:
raise Exception('Param not found in URL!')

args.append(params[arg])
args.append(_PARAMS[arg])

self.functions[route](*args)
4 changes: 2 additions & 2 deletions resources/lib/helpers/Render.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import xbmcgui
import xbmcplugin

from ..common import _HANDLE, _URL, params
from ..common import _HANDLE, _URL, _PARAMS
from .Types import Types
from .ListItemExtra import ListItemExtra

Expand Down Expand Up @@ -48,7 +48,7 @@ def folders(items: list, menu: str = '')-> list:
url = '{0}?menu={1}&id={2}'.format(_URL, menu, item["id"])
if menu == 'episodes':
# Add show id to URL
url += '&item_id={0}'.format(params['id'])
url += '&item_id={0}'.format(_PARAMS['id'])
list_item = ListItemExtra.folder(url, item)
listing.append((url, list_item, True))
return listing
Expand Down
8 changes: 4 additions & 4 deletions resources/lib/routes.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from .dispatcher import Dispatcher
from .constants import ROUTES
from .common import params
from .common import _PARAMS

dispatcher = Dispatcher()

Expand Down Expand Up @@ -76,14 +76,14 @@ def _player(item_id: int):
play.start()

def dispatch():
if params.get('action'):
action = params.get('action')
if _PARAMS.get('action'):
action = _PARAMS.get('action')
if action == 'logout':
from .session import startLogout
startLogout()
elif action == 'profile':
from .session import changeProfile
changeProfile(notify=True)
else:
mode = params.get('menu', 'home')
mode = _PARAMS.get('menu', 'home')
dispatcher.run(mode)
2 changes: 1 addition & 1 deletion resources/lib/views/Playlist.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from .Base import Base
from ..common import api, params
from ..common import api

class Playlist(Base):
has_dirs = True
Expand Down
1 change: 1 addition & 0 deletions resources/lib/views/Purchased.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
class Purchased(Base):
has_dirs = True
has_videos = True

def setItems(self):
self.items = api.purchased()
2 changes: 1 addition & 1 deletion resources/lib/views/Seasons.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from .Base import Base
from ..common import api, params
from ..common import api

class Seasons(Base):
folders_goTo = 'episodes'
Expand Down

0 comments on commit 4c714f1

Please sign in to comment.