Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

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

Merged
2 commits merged into from

1 participant

jmarshallnz
Deleted user

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
Owner

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

Deleted user

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
Owner

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.

Deleted user

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

jmarshallnz
Owner
Deleted user ghost merged commit 67ee34f into from
Lionel CHAZALLON LongChair referenced this pull request from a commit in plexinc/plex-home-theater-public
Lionel CHAZALLON LongChair Fix (Re-)Assign keymap for remove item from PlayQueue #1265.
Will handle ACTION_DELETE_ITEM aka "delete" in PQ OSD.
6ffaa5a
uNiversaI uNiversaI referenced this pull request from a commit in uNiversaI/kodi
uNiversaI [UPnPServer] xbmc -> kodi sender/CAnnouncementManager
not sure about a few xbmc -> kodi like line #107 #1261 #1263 #1265
0d22ebc
uNiversaI uNiversaI referenced this pull request from a commit in uNiversaI/kodi
uNiversaI [UPnPServer] xbmc -> kodi sender/CAnnouncementManager
not sure about a few xbmc -> kodi like line #107 #1261 #1263 #1265
b810843
uNiversaI uNiversaI referenced this pull request from a commit in uNiversaI/kodi
uNiversaI [UPnPServer] xbmc -> kodi sender/CAnnouncementManager
not sure about a few xbmc -> kodi like line #107 #1261 #1263 #1265
60f4ada
uNiversaI uNiversaI referenced this pull request from a commit in uNiversaI/kodi
uNiversaI [UPnPServer] xbmc -> kodi sender/CAnnouncementManager
not sure about a few xbmc -> kodi like line #107 #1261 #1263 #1265
39e291e
uNiversaI uNiversaI referenced this pull request from a commit in uNiversaI/kodi
uNiversaI [UPnPServer] xbmc -> kodi sender/CAnnouncementManager
not sure about a few xbmc -> kodi like line #107 #1261 #1263 #1265
0cb59bc
uNiversaI uNiversaI referenced this pull request from a commit in uNiversaI/kodi
uNiversaI [UPnPServer] xbmc -> kodi sender/CAnnouncementManager
not sure about a few xbmc -> kodi like line #107 #1261 #1263 #1265
8f31acd
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 authored
  2. added: set a content_type parameter for multi-content plugins/scripts

    spiff authored
    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
11 xbmc/addons/PluginSource.h
View
@@ -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:
17 xbmc/filesystem/AddonsDirectory.cpp
View
@@ -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.