Skip to content

Commit 3ed77e0

Browse files
committed
added Download action. Version 0.0.3.
1 parent ed0209d commit 3ed77e0

File tree

6 files changed

+38
-1
lines changed

6 files changed

+38
-1
lines changed

addon.xml

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2-
<addon id="context.elementum" name="Elementum Context Helper" version="0.0.2" provider-name="elgatito">
2+
<addon id="context.elementum" name="Elementum Context Helper" version="0.0.3" provider-name="elgatito">
33
<requires>
44
<import addon="xbmc.python" version="2.23.0"/>
55
<import addon="script.module.requests"/>
@@ -12,6 +12,10 @@
1212
<label>32000</label>
1313
<visible>StringCompare(ListItem.dbtype,movie) | StringCompare(ListItem.dbtype,episode) | String.IsEqual(ListItem.dbtype,movie) | String.IsEqual(ListItem.dbtype,episode)</visible>
1414
</item>
15+
<item library="context_download.py">
16+
<label>32012</label>
17+
<visible>StringCompare(ListItem.dbtype,movie) | StringCompare(ListItem.dbtype,episode) | String.IsEqual(ListItem.dbtype,movie) | String.IsEqual(ListItem.dbtype,episode)</visible>
18+
</item>
1519
<!-- <item library="context_menu.py">
1620
<label>32001</label>
1721
<visible>StringCompare(ListItem.dbtype,movie) | StringCompare(ListItem.dbtype,tvshow) | StringCompare(ListItem.dbtype,season) | StringCompare(ListItem.dbtype,episode)</visible>

context_download.py

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import os
2+
import sys
3+
sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'lib'))
4+
5+
from plugin import doDownload
6+
7+
if __name__ == '__main__':
8+
doDownload()

plugin.py

+13
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,19 @@ def doPlay():
5050
xbmc.Player().play(url)
5151

5252

53+
def doDownload():
54+
dbid = getDbId()
55+
mediatype = getMediaType()
56+
57+
xbmcgui.Dialog().notification(ADDON.getLocalizedString(32009), sys.listitem.getLabel(), xbmcgui.NOTIFICATION_INFO, 3000)
58+
59+
log.info("Downloading for: DBID=%s, MediaType=%s" % (dbid, mediatype))
60+
61+
url = "plugin://plugin.video.elementum/context/%s/%s/download" % (mediatype, dbid)
62+
log.info("Starting Elementum with: %s" % url)
63+
xbmc.Player().play(url)
64+
65+
5366
def getDbId():
5467
infolabel = xbmc.getInfoLabel('ListItem.Label')
5568
truelabel = sys.listitem.getLabel()

resources/language/English/strings.po

+4
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,7 @@ msgstr ""
6565
msgctxt "#32011"
6666
msgid "Assigning season stream with [COLOR FF46B3B3]Elementum[/COLOR]"
6767
msgstr ""
68+
69+
msgctxt "#32012"
70+
msgid "[COLOR FF46B3B3]Elementum[/COLOR] Download"
71+
msgstr ""

resources/language/Hebrew/strings.po

+4
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,7 @@ msgstr "שיוך סטרים ל־ [COLOR FF46B3B3]Elementum[/COLOR]"
6565
msgctxt "#32011"
6666
msgid "Assigning season stream with [COLOR FF46B3B3]Elementum[/COLOR]"
6767
msgstr "שיוך סטרים של עונה ל־ [COLOR FF46B3B3]Elementum[/COLOR]"
68+
69+
msgctxt "#32012"
70+
msgid "[COLOR FF46B3B3]Elementum[/COLOR] Download"
71+
msgstr ""

resources/language/Russian/strings.po

+4
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,7 @@ msgstr "Выбор стрима в [COLOR FF46B3B3]Elementum[/COLOR]"
6565
msgctxt "#32011"
6666
msgid "Assigning season stream with [COLOR FF46B3B3]Elementum[/COLOR]"
6767
msgstr "Выбор стрима для сезона в [COLOR FF46B3B3]Elementum[/COLOR]"
68+
69+
msgctxt "#32012"
70+
msgid "[COLOR FF46B3B3]Elementum[/COLOR] Download"
71+
msgstr "[COLOR FF46B3B3]Elementum[/COLOR] Скачать"

0 commit comments

Comments
 (0)