Skip to content

Loading…

Upnp fixes #2527

Merged
merged 2 commits into from

2 participants

@alcoheca

hi just a couple of bug fixes

@alcoheca alcoheca merged commit 5476b09 into xbmc:master
@war59312

Might want to fix small typo In name of commit. ;)

Perhaps to: "upnp: hide unplayable items in files view fixes, #13526"

Good catch ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Showing with 15 additions and 2 deletions.
  1. +6 −1 xbmc/filesystem/UPnPDirectory.cpp
  2. +9 −1 xbmc/network/upnp/UPnPServer.cpp
View
7 xbmc/filesystem/UPnPDirectory.cpp
@@ -349,7 +349,12 @@ CUPnPDirectory::GetDirectory(const CStdString& strPath, CFileItemList &items)
std::string content = GetContentMapping(max_string);
items.SetContent(content);
if (content == "unknown")
- items.AddSortMethod(SORT_METHOD_NONE, 551, LABEL_MASKS("%L", "%I", "%L", ""));
+ {
+ items.AddSortMethod(SORT_METHOD_UNSORTED, 571, LABEL_MASKS("%L", "%I", "%L", ""));
+ items.AddSortMethod(SORT_METHOD_LABEL_IGNORE_FOLDERS, 551, LABEL_MASKS("%L", "%I", "%L", ""));
+ items.AddSortMethod(SORT_METHOD_SIZE, 553, LABEL_MASKS("%L", "%I", "%L", "%I"));
+ items.AddSortMethod(SORT_METHOD_DATE, 552, LABEL_MASKS("%L", "%J", "%L", "%J"));
+ }
}
cleanup:
View
10 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);
}
Something went wrong with that request. Please try again.