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

Support directory items and plugin contents rather than just videos #7

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion addon.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ def build_url(query):
li.addContextMenuItems( commands )

# Add listitem to directory
xbmcplugin.addDirectoryItem(handle=addon_handle, url=filename, listitem=li)
xbmcplugin.addDirectoryItem(handle=addon_handle, url=filename, listitem=li, isFolder=item.is_folder)
count = count + 1
xbmcplugin.endOfDirectory(addon_handle)

Expand Down
14 changes: 9 additions & 5 deletions addon.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?xml version="1.1" encoding="UTF-8" standalone="yes"?>
<addon id="plugin.program.shortlist" name="Shortlist" version="0.0.11" provider-name="kcook98765">
<addon id="plugin.program.shortlist" name="Shortlist" version="0.0.12" provider-name="Gothicawakening,kcook98765,krruzic">
<requires>
<import addon="xbmc.python" version="3.0.0"/>
</requires>
<extension point="xbmc.python.pluginsource" library="addon.py">
<provides>video</provides>
<provides>executable</provides>
</extension>
<extension point="xbmc.addon.metadata">
<summary lang="en_gb">Shortlist movies to watch</summary>
Expand All @@ -26,10 +26,14 @@
</extension>
<extension point="kodi.context.item">
<menu id="kodi.core.main">
<item library="capture.py">
<item library="capture.py" args="file">
<label>30012</label>
<visible>[!String.IsEmpty(ListItem.DBID) + String.IsEqual(ListItem.DBType,movie)] | String.IsEqual(Container.Content,files)</visible>
<visible>!ListItem.IsFolder + !String.IsEqual(Container.PluginName,plugin.program.shortlist)</visible>
</item>
<item library="capture.py" args="folder">
<label>30014</label>
<visible>ListItem.IsFolder + !String.IsEqual(Container.PluginName,plugin.program.shortlist)</visible>
</item>
</menu>
</extension>
</extension>
</addon>
5 changes: 3 additions & 2 deletions capture.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,7 @@

# if __name__ == '__main__':
def main():

lst = listDatabases()
# xbmc.log( "; ".join(lst), xbmc.LOGNOTICE);

dialog = xbmcgui.Dialog()
ret = dialog.contextmenu(lst)
Expand Down Expand Up @@ -64,6 +62,9 @@ def main():
item.landscape = sys.listitem.getArt( 'landscape' )
item.icon = sys.listitem.getArt( 'icon' )

if sys.argv[1] == "folder":
item.is_folder = True

result = addItemToDatabase( dbName, item )

if result:
Expand Down
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 @@ -66,4 +66,8 @@ msgstr "Add to Shortlist"

msgctxt "#30013"
msgid "Rename Shortlist"
msgstr "Rename Shortlist"
msgstr "Rename Shortlist"

msgctxt "#30014"
msgid "Add to Shortlist (directory)"
msgstr "Add to Shortlist (directory)"
6 changes: 5 additions & 1 deletion resources/language/resource.language.en_us/strings.po
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,8 @@ msgstr "Add to Shortlist"

msgctxt "#30013"
msgid "Rename Shortlist"
msgstr "Rename Shortlist"
msgstr "Rename Shortlist"

msgctxt "#30014"
msgid "Add to Shortlist (directory)"
msgstr "Add to Shortlist (directory)"
6 changes: 5 additions & 1 deletion resources/language/resource.language.fr_fr/strings.po
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,8 @@ msgstr "Ajouter à la Shortlist"

msgctxt "#30013"
msgid "Rename Shortlist"
msgstr "Renommer la Shortlist"
msgstr "Renommer la Shortlist"

msgctxt "#30014"
msgid "Add to Shortlist"
msgstr "Ajouter à la Shortlist (Répertoire)"
2 changes: 1 addition & 1 deletion shortlistitem.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ class ShortlistItem:
clearlogo = ""
landscape = ""
icon = ""

is_folder = False