Skip to content

Commit

Permalink
added Download action. Version 0.0.3.
Browse files Browse the repository at this point in the history
  • Loading branch information
elgatito committed Mar 12, 2020
1 parent ed0209d commit 3ed77e0
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 1 deletion.
6 changes: 5 additions & 1 deletion 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="context.elementum" name="Elementum Context Helper" version="0.0.2" provider-name="elgatito">
<addon id="context.elementum" name="Elementum Context Helper" version="0.0.3" provider-name="elgatito">
<requires>
<import addon="xbmc.python" version="2.23.0"/>
<import addon="script.module.requests"/>
Expand All @@ -12,6 +12,10 @@
<label>32000</label>
<visible>StringCompare(ListItem.dbtype,movie) | StringCompare(ListItem.dbtype,episode) | String.IsEqual(ListItem.dbtype,movie) | String.IsEqual(ListItem.dbtype,episode)</visible>
</item>
<item library="context_download.py">
<label>32012</label>
<visible>StringCompare(ListItem.dbtype,movie) | StringCompare(ListItem.dbtype,episode) | String.IsEqual(ListItem.dbtype,movie) | String.IsEqual(ListItem.dbtype,episode)</visible>
</item>
<!-- <item library="context_menu.py">
<label>32001</label>
<visible>StringCompare(ListItem.dbtype,movie) | StringCompare(ListItem.dbtype,tvshow) | StringCompare(ListItem.dbtype,season) | StringCompare(ListItem.dbtype,episode)</visible>
Expand Down
8 changes: 8 additions & 0 deletions context_download.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import os
import sys
sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'lib'))

from plugin import doDownload

if __name__ == '__main__':
doDownload()
13 changes: 13 additions & 0 deletions plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,19 @@ def doPlay():
xbmc.Player().play(url)


def doDownload():
dbid = getDbId()
mediatype = getMediaType()

xbmcgui.Dialog().notification(ADDON.getLocalizedString(32009), sys.listitem.getLabel(), xbmcgui.NOTIFICATION_INFO, 3000)

log.info("Downloading for: DBID=%s, MediaType=%s" % (dbid, mediatype))

url = "plugin://plugin.video.elementum/context/%s/%s/download" % (mediatype, dbid)
log.info("Starting Elementum with: %s" % url)
xbmc.Player().play(url)


def getDbId():
infolabel = xbmc.getInfoLabel('ListItem.Label')
truelabel = sys.listitem.getLabel()
Expand Down
4 changes: 4 additions & 0 deletions resources/language/English/strings.po
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,7 @@ msgstr ""
msgctxt "#32011"
msgid "Assigning season stream with [COLOR FF46B3B3]Elementum[/COLOR]"
msgstr ""

msgctxt "#32012"
msgid "[COLOR FF46B3B3]Elementum[/COLOR] Download"
msgstr ""
4 changes: 4 additions & 0 deletions resources/language/Hebrew/strings.po
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,7 @@ msgstr "שיוך סטרים ל־ [COLOR FF46B3B3]Elementum[/COLOR]"
msgctxt "#32011"
msgid "Assigning season stream with [COLOR FF46B3B3]Elementum[/COLOR]"
msgstr "שיוך סטרים של עונה ל־ [COLOR FF46B3B3]Elementum[/COLOR]"

msgctxt "#32012"
msgid "[COLOR FF46B3B3]Elementum[/COLOR] Download"
msgstr ""
4 changes: 4 additions & 0 deletions resources/language/Russian/strings.po
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,7 @@ msgstr "Выбор стрима в [COLOR FF46B3B3]Elementum[/COLOR]"
msgctxt "#32011"
msgid "Assigning season stream with [COLOR FF46B3B3]Elementum[/COLOR]"
msgstr "Выбор стрима для сезона в [COLOR FF46B3B3]Elementum[/COLOR]"

msgctxt "#32012"
msgid "[COLOR FF46B3B3]Elementum[/COLOR] Download"
msgstr "[COLOR FF46B3B3]Elementum[/COLOR] Скачать"

0 comments on commit 3ed77e0

Please sign in to comment.