Skip to content

Loading…

set a content_type parameter for multi-content plugins/scripts #1265

Merged
2 commits merged into from

1 participant

@ghost

plugins/scripts providing multiple contents can use this to see the context they are called under and (choose to) only provide the appropriate content.

spiff added some commits
spiff cosmetics 7a988cf
spiff added: set a content_type parameter for multi-content plugins/scripts
plugins/scripts providing multiple contents can use this to see
the context they are called under and (choose to) only provide the
appropriate content
b704b75
@jmarshallnz
Team Kodi member

Looks good, but I guess this is going to (potentially) break existing plugins that provide multiple content types? Dunno how many there are currently.

@ghost

there is a potential, but the few we have in our repo is worth the risk imo. i tried a couple and they worked fine

@jmarshallnz
Team Kodi member

Yeah - most will be using URL options for stuff anyway, and will likely be ignoring ones they don't understand.

We should be bumping the API either way. I think frodo-pre is heading out this merge window, so seems a reasonable place to break it.

@ghost

will do, but as there are several other potential breakers in already i'd prefer to do it separately (and tomorrowish)

@jmarshallnz
Team Kodi member
@ghost ghost merged commit 67ee34f into xbmc:master
@LongChair LongChair added a commit to plexinc/plex-home-theater-public that referenced this pull request
@LongChair LongChair Fix (Re-)Assign keymap for remove item from PlayQueue #1265.
Will handle ACTION_DELETE_ITEM aka "delete" in PQ OSD.
6ffaa5a
@un1versal un1versal pushed a commit to un1versal/kodi that referenced this pull request
uNiversaI [UPnPServer] xbmc -> kodi sender/CAnnouncementManager
not sure about a few xbmc -> kodi like line #107 #1261 #1263 #1265
0d22ebc
@un1versal un1versal pushed a commit to un1versal/kodi that referenced this pull request
uNiversaI [UPnPServer] xbmc -> kodi sender/CAnnouncementManager
not sure about a few xbmc -> kodi like line #107 #1261 #1263 #1265
b810843
@un1versal un1versal pushed a commit to un1versal/kodi that referenced this pull request
uNiversaI [UPnPServer] xbmc -> kodi sender/CAnnouncementManager
not sure about a few xbmc -> kodi like line #107 #1261 #1263 #1265
60f4ada
@un1versal un1versal pushed a commit to un1versal/kodi that referenced this pull request
uNiversaI [UPnPServer] xbmc -> kodi sender/CAnnouncementManager
not sure about a few xbmc -> kodi like line #107 #1261 #1263 #1265
39e291e
@un1versal un1versal pushed a commit to un1versal/kodi that referenced this pull request
uNiversaI [UPnPServer] xbmc -> kodi sender/CAnnouncementManager
not sure about a few xbmc -> kodi like line #107 #1261 #1263 #1265
0cb59bc
@un1versal un1versal pushed a commit to un1versal/kodi that referenced this pull request
uNiversaI [UPnPServer] xbmc -> kodi sender/CAnnouncementManager
not sure about a few xbmc -> kodi like line #107 #1261 #1263 #1265
8f31acd
@un1versal un1versal pushed a commit to un1versal/kodi that referenced this pull request
uNiversaI [UPnPServer] xbmc -> kodi sender/CAnnouncementManager
not sure about a few xbmc -> kodi like line #107 #1261 #1263 #1265
3f8862d
@un1versal un1versal pushed a commit to un1versal/kodi that referenced this pull request
uNiversaI [UPnPServer] xbmc -> kodi sender/CAnnouncementManager
not sure about a few xbmc -> kodi like line #107 #1261 #1263 #1265
875753d
@un1versal un1versal pushed a commit to un1versal/kodi that referenced this pull request
uNiversaI [UPnPServer] xbmc -> kodi sender/CAnnouncementManager
not sure about a few xbmc -> kodi like line #107 #1261 #1263 #1265
a3894fb
@un1versal un1versal pushed a commit to un1versal/kodi that referenced this pull request
uNiversaI [UPnPServer] xbmc -> kodi sender/CAnnouncementManager
not sure about a few xbmc -> kodi like line #107 #1261 #1263 #1265
e684d40
@un1versal un1versal pushed a commit to un1versal/kodi that referenced this pull request
uNiversaI [UPnPServer] xbmc -> kodi sender/CAnnouncementManager
not sure about a few xbmc -> kodi like line #107 #1261 #1263 #1265
2be1fdc
@un1versal un1versal pushed a commit to un1versal/kodi that referenced this pull request
uNiversaI [UPnPServer] xbmc -> kodi sender/CAnnouncementManager
not sure about a few xbmc -> kodi like line #107 #1261 #1263 #1265
24d54f5
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Aug 8, 2012
  1. cosmetics

    spiff committed
  2. added: set a content_type parameter for multi-content plugins/scripts

    spiff committed
    plugins/scripts providing multiple contents can use this to see
    the context they are called under and (choose to) only provide the
    appropriate content
This page is out of date. Refresh to see the latest.
Showing with 22 additions and 6 deletions.
  1. +9 −2 xbmc/addons/PluginSource.h
  2. +13 −4 xbmc/filesystem/AddonsDirectory.cpp
View
11 xbmc/addons/PluginSource.h
@@ -35,8 +35,15 @@ class CPluginSource : public CAddon
CPluginSource(const AddonProps &props);
virtual ~CPluginSource() {}
virtual bool IsType(TYPE type) const;
- bool Provides(const Content& content) const {
- return content == UNKNOWN ? false : m_providedContent.count(content) > 0; }
+ bool Provides(const Content& content) const
+ {
+ return content == UNKNOWN ? false : m_providedContent.count(content) > 0;
+ }
+
+ bool ProvidesSeveral() const
+ {
+ return m_providedContent.size() > 1;
+ }
static Content Translate(const CStdString &content);
private:
View
17 xbmc/filesystem/AddonsDirectory.cpp
@@ -295,10 +295,19 @@ bool CAddonsDirectory::GetScriptsAndPlugins(const CStdString &content, CFileItem
for (unsigned i=0; i<addons.size(); i++)
{
- if (addons[i]->Type() == ADDON_PLUGIN)
- items.Add(FileItemFromAddon(addons[i], "plugin://", true));
- else
- items.Add(FileItemFromAddon(addons[i], "script://", false));
+ CFileItemPtr item(FileItemFromAddon(addons[i],
+ addons[i]->Type()==ADDON_PLUGIN?"plugin://":"script://",
+ addons[i]->Type() == ADDON_PLUGIN));
+ PluginPtr plugin = boost::dynamic_pointer_cast<CPluginSource>(addons[i]);
+ if (plugin->ProvidesSeveral())
+ {
+ CURL url = item->GetAsUrl();
+ CStdString opt;
+ opt.Format("?content_type=%s",content.c_str());
+ url.SetOptions(opt);
+ item->SetPath(url.Get());
+ }
+ items.Add(item);
}
items.Add(GetMoreItem(content));
Something went wrong with that request. Please try again.