Platinum - allow sub classes of PltSyncMediaBrowser to specify property filter mask
authorAlasdair Campbell <alcoheca@gmail.com>
Tue, 25 Sep 2012 09:25:55 +0000 (10:25 +0100)
committerAlasdair Campbell <alcoheca@gmail.com>
Thu, 11 Oct 2012 01:26:28 +0000 (02:26 +0100)
[UPnP] when browsing a UPnP server, retrieve ALL metadata

lib/libUPnP/Platinum/Source/Devices/MediaServer/PltSyncMediaBrowser.cpp
lib/libUPnP/Platinum/Source/Devices/MediaServer/PltSyncMediaBrowser.h
xbmc/filesystem/UPnPDirectory.cpp

index 091ae00..ad81008 100644 (file)
@@ -202,8 +202,8 @@ PLT_SyncMediaBrowser::BrowseSync(PLT_BrowseDataReference& browse_data,
                                  const char*              object_id, 
                                  NPT_Int32                index, 
                                  NPT_Int32                count,
-                                 bool                     browse_metadata,
                                  const char*              filter, 
+                                 bool                     browse_metadata,
                                  const char*              sort)
 {
     NPT_Result res;
@@ -236,7 +236,8 @@ PLT_SyncMediaBrowser::BrowseSync(PLT_DeviceDataReference&      device,
                                  PLT_MediaObjectListReference& list,
                                  bool                          metadata, /* = false */
                                  NPT_Int32                     start, /* = 0 */
-                                 NPT_Cardinal                  max_results /* = 0 */)
+                                 NPT_Cardinal                  max_results, /* = 0 */
+                                 const char*                   filter)
 {
     NPT_Result res = NPT_FAILURE;
     NPT_Int32  index = start;
@@ -263,6 +264,7 @@ PLT_SyncMediaBrowser::BrowseSync(PLT_DeviceDataReference&      device,
             (const char*)object_id,
             index,
             metadata?1:30, // DLNA recommendations for browsing children is no more than 30 at a time
+            filter,
             metadata);         
         NPT_CHECK_LABEL_WARNING(res, done);
         
index e628af9..605ea31 100644 (file)
@@ -106,7 +106,8 @@ public:
                           PLT_MediaObjectListReference& list,
                           bool                          metadata = false,
                           NPT_Int32                     start = 0,
-                          NPT_Cardinal                  max_results = 0); // 0 means all
+                          NPT_Cardinal                  max_results = 0,
+                          const char*                   filter = "dc:date,upnp:genre,res,res@duration,res@size,upnp:albumArtURI,upnp:album,upnp:artist,upnp:author,searchable,childCount"); // explicitely specify res otherwise WMP won't return a URL!
 
     const NPT_Lock<PLT_DeviceMap>& GetMediaServersMap() const { return m_MediaServers; }
     bool IsCached(const char* uuid, const char* object_id);
@@ -117,8 +118,8 @@ protected:
                           const char*              object_id,
                           NPT_Int32                index, 
                           NPT_Int32                count,
+                          const char*              filter,
                           bool                     browse_metadata = false,
-                          const char*              filter = "dc:date,upnp:genre,res,res@duration,res@size,upnp:albumArtURI,upnp:album,upnp:artist,upnp:author,searchable,childCount", // explicitely specify res otherwise WMP won't return a URL!
                           const char*              sort = "");
 private:
     NPT_Result Find(const char* ip, PLT_DeviceDataReference& device);
index 79cdf98..0cbe1e4 100644 (file)
@@ -355,10 +355,15 @@ CUPnPDirectory::GetDirectory(const CStdString& strPath, CFileItemList &items)
         }
 #endif
 
+
+        // Browse and wait for result
+        PLT_MediaObjectListReference list;
+        NPT_Result res;
+        // we want all properties, so send empty filter
+        res = upnp->m_MediaBrowser->BrowseSync(device, object_id, list, false, 0, 0, "");
+
         // if error, return now, the device could have gone away
         // this will make us go back to the sources list
-        PLT_MediaObjectListReference list;
-        NPT_Result res = upnp->m_MediaBrowser->BrowseSync(device, object_id, list);
         if (NPT_FAILED(res)) goto failure;
 
         // empty list is ok