Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Various fixes #25

Merged
merged 1 commit into from
May 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion resources/language/resource.language.en_gb/strings.po
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ msgid "The channels and guide are updated successfully!"
msgstr ""

msgctxt "#30710"
msgid "Could not find an Add-on to play programs from {channel}"
msgid "Could not find an Add-on to play programs from {channel}."
msgstr ""

msgctxt "#30711"
Expand All @@ -52,6 +52,10 @@ msgctxt "#30712"
msgid "Could not determine the currently selected program. Please try again without selecting another program."
msgstr ""

msgctxt "#30713"
msgid "The EPG data is not up to date. Do you want to refresh the EPG now?"
msgstr ""


### SETTINGS
msgctxt "#30800"
Expand Down
8 changes: 6 additions & 2 deletions resources/language/resource.language.nl_nl/strings.po
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ msgid "The channels and guide are updated successfully!"
msgstr "De kanalenlijst en gids zijn sucessvol geüpdate."

msgctxt "#30710"
msgid "Could not find an Add-on to play programs from {channel}"
msgstr "Kon geen Add-on vinden om programma's van {channel} af te spelen"
msgid "Could not find an Add-on to play programs from {channel}."
msgstr "Kon geen Add-on vinden om programma's van {channel} af te spelen."

msgctxt "#30711"
msgid "Select an Add-on to use for playback"
Expand All @@ -53,6 +53,10 @@ msgctxt "#30712"
msgid "Could not determine the currently selected program. Please try again without selecting another program."
msgstr "Kon het geselecteerde programma niet bepalen. Probeer opnieuw zonder een andere programma te selecteren."

msgctxt "#30713"
msgid "The EPG data is not up to date. Do you want to refresh the EPG now?"
msgstr "De EPG is niet up to date. Wil je deze nu vernieuwen?"



### SETTINGS
Expand Down
16 changes: 14 additions & 2 deletions resources/lib/modules/contextmenu.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,13 @@ def play(cls, program):

# Get a list of addons that can play the selected channel
# We do the lookup based on Channel Name, since that's all we have
addons = cls._get_addons_for_channel(program.get('channel'))
try:
addons = cls._get_addons_for_channel(program.get('channel'))
except IOError:
if kodiutils.yesno_dialog(message=kodiutils.localize(30713)): # The EPG data is not up to date...
from resources.lib.modules.addon import Addon
Addon.refresh(True)
return

if not addons:
# Channel was not found.
Expand Down Expand Up @@ -131,7 +137,13 @@ def get_selection(cls):
@staticmethod
def write_channels(channels):
"""Write the channel data to a file."""
channels_path = os.path.join(kodiutils.addon_profile(), CHANNELS_CACHE)
output_dir = kodiutils.addon_profile()

# Make sure our output dir exists
if not os.path.exists(output_dir):
os.mkdir(output_dir)

channels_path = os.path.join(output_dir, CHANNELS_CACHE)
with open(channels_path, 'w') as fdesc:
json.dump(channels, fdesc)

Expand Down