Skip to content
This repository has been archived by the owner on Oct 21, 2024. It is now read-only.

Commit

Permalink
Don't use cached episode info for playback (#82)
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelarnauts authored Mar 22, 2021
1 parent 8f59c16 commit 4a47c5c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
13 changes: 8 additions & 5 deletions resources/lib/modules/menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

from __future__ import absolute_import, division, unicode_literals

import logging

from resources.lib import kodiutils
from resources.lib.kodiutils import TitleItem
from resources.lib.viervijfzes import STREAM_DICT
Expand All @@ -13,6 +15,8 @@
except ImportError: # Python 2
from urllib import quote

_LOGGER = logging.getLogger(__name__)


class Menu:
""" Menu code """
Expand Down Expand Up @@ -184,13 +188,12 @@ def generate_titleitem(item):
'duration': item.duration,
})

if item.path:
# We don't have an UUID, and first need to fetch the video information from the page
path = kodiutils.url_for('play_from_page', page=quote(item.path, safe=''))
else:
if item.uuid:
# We have an UUID and can play this item directly
# This is not preferred since we will lack metadata
path = kodiutils.url_for('play_catalog', uuid=item.uuid)
else:
# We don't have an UUID, and first need to fetch the video information from the page
path = kodiutils.url_for('play_from_page', page=quote(item.path, safe=''))

return TitleItem(title=info_dict['title'],
path=path,
Expand Down
4 changes: 2 additions & 2 deletions resources/lib/modules/player.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from resources.lib.viervijfzes import CHANNELS, ResolvedStream
from resources.lib.viervijfzes.auth import AuthApi
from resources.lib.viervijfzes.aws.cognito_idp import AuthenticationException, InvalidLoginException
from resources.lib.viervijfzes.content import ContentApi, GeoblockedException, UnavailableException
from resources.lib.viervijfzes.content import CACHE_PREVENT, ContentApi, GeoblockedException, UnavailableException

try: # Python 3
from urllib.parse import quote, urlencode
Expand Down Expand Up @@ -45,7 +45,7 @@ def play_from_page(self, path):
:type path: string
"""
# Get episode information
episode = self._api.get_episode(path)
episode = self._api.get_episode(path, cache=CACHE_PREVENT)
resolved_stream = None

if episode is None:
Expand Down

0 comments on commit 4a47c5c

Please sign in to comment.