Permalink
Browse files

fix direct playback of playable plugin favorites which have slash at end

addresses my trac ticket http://trac.xbmc.org/ticket/13074

PlayMedia was assuming that every vfs-path with a slash at the end is a folder - which isn't correct. I fixed this with the additional condition that the item need to be a non-plugin item. But still wondering if this switch is ever needed because folder-favorites (even plugin folders) are using ActivateWindow(vfs) and not PlayMedia(vfs).
  • Loading branch information...
1 parent 12d9d51 commit 864f96f31a79a807ff1ced03c77e4a4cc9574993 @dersphere committed May 31, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 xbmc/interfaces/Builtins.cpp
@@ -487,7 +487,7 @@ int CBuiltins::Execute(const CStdString& execString)
}
CFileItem item(params[0], false);
- if (URIUtils::HasSlashAtEnd(params[0]))
+ if (!item.IsPlugin() && URIUtils::HasSlashAtEnd(params[0]))
item.m_bIsFolder = true;
// restore to previous window if needed

3 comments on commit 864f96f

Typically a slash at end does denote a folder. For most plugins this would be correct, right?

We need something to denote whether things are a folder if we want the ability for PlayMedia to be able to play folder listings.

If the problem is only favourites, then when adding the favourite we probably know this information, so can remove the slash at end at that point.

Owner

dersphere replied May 31, 2012

Hi Jonathan,
thanks for your thoughts and comments!

There is a possibility to add folder-playback to favorites?

Yes on most plugins this isn't an issue.

But there are a few possible examples for vfs-urls of plugins which are playable but ending with a slash (unproved, just some ideas):PlayMedia("rtmp://foo.bar:1935 playpath=/library/video1234/") (rtmp with playpath) PlayMedia("plugin://plugin.video.foo/?mode=play&url=http://website.com/video1234/") (callback url) PlayMedia("http://website.com/video1234/") (direct video) PlayMedia("plugin://plugin.audio.radio_de/station/2264/") (xbmcswift addon)
Also, at least on websites it has become a common pattern to have a trailing slash on some page-urls.

Folders which are meant to be opened as folder listing via favorites ([smart]playlists, phyisical/logical-folders, plugin-listings) have fav entries with ActivateWindow().

Btw, removing the slash by xbmc won't work on xbmcswift addons because the url pattern matching differs between having and not having a trailing slash.

I opened this PR assuming that on plugins there is only a folder (ActivateWindow) or a playable item (PlayMedia) possible - and while adding, this is detected and set. But if you feel that the current behavior is not wrong or it would break some (future) feature, you can just close this and we need to fix it in some plugins ;-)

If the problem is only favourites, then when you "Add Favourite" to an item we can ensure no slash is on the end. As far as I can tell, all your examples should work with the slash removed from the end of the URLs or the slash being there, or do you have examples where the slash MUST be there for the URL to function?

Please sign in to comment.