Skip to content

Commit

Permalink
Remember custom path (as setting), check specified custom path whether
Browse files Browse the repository at this point in the history
there is enough space.
  • Loading branch information
horstle committed Feb 18, 2019
1 parent 3f739d2 commit 910529b
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 12 deletions.
12 changes: 6 additions & 6 deletions lib/inputstreamhelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
ADDON = xbmcaddon.Addon('script.module.inputstreamhelper')
ADDON_PROFILE = xbmc.translatePath(ADDON.getAddonInfo('profile')).decode('utf-8')
LANGUAGE = ADDON.getLocalizedString
TEMPORARY_PATH=""

class Helper(object):
def __init__(self, protocol, drm=None):
Expand Down Expand Up @@ -62,8 +61,9 @@ def _diskspace(cls):

@classmethod
def _temp_path(cls):
if TEMPORARY_PATH:
temp_path = os.path.join(TEMPORARY_PATH, 'tmp')
cust_temp_path = ADDON.getSetting('custom_temp_path')
if os.path.isdir(cust_temp_path):
temp_path = os.path.join(cust_temp_path, 'tmp')
else:
temp_path = os.path.join(ADDON_PROFILE, 'tmp')
if not xbmcvfs.exists(temp_path):
Expand Down Expand Up @@ -492,10 +492,10 @@ def _install_widevine_arm(self):
if self._os() != 'Linux':
dialog.ok(LANGUAGE(30004), LANGUAGE(30019).format(self._os()))
return False
if required_diskspace >= self._diskspace():
while required_diskspace >= self._diskspace():
if dialog.yesno(LANGUAGE(30004), LANGUAGE(30042)):
global TEMPORARY_PATH
TEMPORARY_PATH = dialog.browseSingle(3, LANGUAGE(30043), 'files')
ADDON.setSetting('custom_temp_path', dialog.browseSingle(3, LANGUAGE(30043), 'files'))
continue
else:
dialog.ok(LANGUAGE(30004),
LANGUAGE(30018).format(self._sizeof_fmt(required_diskspace)))
Expand Down
8 changes: 4 additions & 4 deletions resources/language/resource.language.de_de/strings.po
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,9 @@ msgid "Widevine CDM is required"
msgstr ""

msgctxt "#30042"
msgid "You do not have enough free disk space to install [B]Widevine CDM[/B]. Would you like to specify an alternative path to temporarily use for the Chrome OS Recovery Image (e.g. on a USB)?"
msgstr "Es ist nicht genug Festplattenspeicher zur Installation der [B]Widevine CDM[/B] Bibliothek vorhanden. Möchten Sie ein anderes Verzeichnis zur temporären Nutzung für das Chrome OS Recovery Image wählen (z.B auf einem USB-Stick)?"
msgid "You do not have enough free disk space to install [B]Widevine CDM[/B] or your specified custom path does not exist anymore or hasn't got enough disk space either. Would you like to specify a (different) custom path to temporarily use for the Chrome OS Recovery Image (e.g. on a USB)?"
msgstr "Es ist nicht genug Festplattenspeicher zur Installation der [B]Widevine CDM[/B] Bibliothek vorhanden, oder das angegebene Verzeichnis existiert nicht mehr oder hat auch nicht genug Speicherplatz. Möchten Sie ein anderes Verzeichnis zur temporären Nutzung für das Chrome OS Recovery Image wählen (z.B auf einem USB-Stick)?"

msgctxt "#30043"
msgid "temporary path"
msgstr "Temporäres Verzeichnis"
msgid "custom temporary path"
msgstr "Benutzerdefiniertes temporäres Verzeichnis"
4 changes: 2 additions & 2 deletions resources/language/resource.language.en_gb/strings.po
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,9 @@ msgid "Widevine CDM is required"
msgstr ""

msgctxt "#30042"
msgid "You do not have enough free disk space to install [B]Widevine CDM[/B]. Would you like to specify an alternative path to temporarily use for the Chrome OS Recovery Image (e.g. on a USB)?"
msgid "You do not have enough free disk space to install [B]Widevine CDM[/B] or your specified custom path does not exist anymore or hasn't got enough disk space either. Would you like to specify a (different) custom path to temporarily use for the Chrome OS Recovery Image (e.g. on a USB)?"
msgstr ""

msgctxt "#30043"
msgid "temporary path"
msgid "custom temporary path"
msgstr ""
1 change: 1 addition & 0 deletions resources/settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
<settings>
<setting id="disabled" value="" visible="false" />
<setting id="last_update" value="" visible="false" />
<setting id="custom_temp_path" label="30043" type="folder" source="" option="writeable"/>
</settings>

0 comments on commit 910529b

Please # to comment.