Skip to content

Commit

Permalink
[UPnP] hide addons node
Browse files Browse the repository at this point in the history
  • Loading branch information
alcoheca committed Oct 23, 2012
1 parent e01f929 commit 2924e3e
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions xbmc/network/upnp/UPnPServer.cpp
Expand Up @@ -237,10 +237,7 @@ CUPnPServer::Build(CFileItemPtr item,
goto failure;
}

} else if (path.StartsWith("addons://"))
// don't serve addon listings for now
goto failure;
else {
} else {
// db path handling
NPT_String file_path, share_name;
file_path = item->GetPath();
Expand Down Expand Up @@ -624,6 +621,14 @@ CUPnPServer::BuildResponse(PLT_ActionReference& action,
thumb_loader->Initialize();
}

// this isn't pretty but needed to properly hide the addons node from clients
if (items.GetPath().Left(7) == "library") {
for (int i=0; i<items.Size(); i++) {
if (items[i]->GetPath().Left(6) == "addons")
items.Remove(i);
}
}

// won't return more than UPNP_MAX_RETURNED_ITEMS items at a time to keep things smooth
// 0 requested means as many as possible
NPT_UInt32 max_count = (requested_count == 0)?m_MaxReturnedItems:min((unsigned long)requested_count, (unsigned long)m_MaxReturnedItems);
Expand Down

0 comments on commit 2924e3e

Please sign in to comment.