aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlasdair Campbell <alcoheca@gmail.com>2013-04-02 04:41:48 +0100
committerAlasdair Campbell <alcoheca@gmail.com>2013-04-02 04:47:21 +0100
commitec9129fe58614016d98af521471ff097171ae444 (patch)
tree77291bbf1c7b9a0b5593bc026406b088705b3010
parent87f4c493cab4f648ebd7ce4ee10dc6fc593f179f (diff)
upnp: hide unplayable items in fiels view fixes #13526
-rw-r--r--xbmc/network/upnp/UPnPServer.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/xbmc/network/upnp/UPnPServer.cpp b/xbmc/network/upnp/UPnPServer.cpp
index 86f13eb560..0518d14e35 100644
--- a/xbmc/network/upnp/UPnPServer.cpp
+++ b/xbmc/network/upnp/UPnPServer.cpp
@@ -13,6 +13,7 @@
#include "filesystem/VideoDatabaseDirectory.h"
#include "guilib/WindowIDs.h"
#include "music/tags/MusicInfoTag.h"
+#include "settings/Settings.h"
#include "settings/GUISettings.h"
#include "utils/log.h"
#include "utils/md5.h"
@@ -600,7 +601,14 @@ CUPnPServer::OnBrowseDirectChildren(PLT_ActionReference& action,
items.Sort(SORT_METHOD_LABEL, SortOrderAscending);
} else {
- CDirectory::GetDirectory((const char*)parent_id, items);
+ // this is the only way to hide unplayable items in the 'files'
+ // view as we cannot tell what context (eg music vs video) the
+ // request came from
+ string supported = g_settings.m_pictureExtensions + "|"
+ + g_settings.m_videoExtensions + "|"
+ + g_settings.m_musicExtensions + "|"
+ + g_settings.m_discStubExtensions;
+ CDirectory::GetDirectory((const char*)parent_id, items, supported);
DefaultSortItems(items);
}