arcam / CocoaUPnP

CocoaUPnP is a logical progression of upnpx; designed to be easy, modern and block-based.
MIT License
85 stars 40 forks source link

Fetch all songs & metadata from server at once ? #68

Closed NNEU-1 closed 2 years ago

NNEU-1 commented 2 years ago

Hi,

I am aware of the usual browse method which lets the user navigate through the server, but I would like to be able to fetch all songs and their metadata at once and then create my own way of navigating them. Is there any way of doing so ?

thanks !

squarefrog commented 2 years ago

Yes it's possible, but not always supported. I think to do it you have to use the content directory services Search() function, searching for all audio items.

There are a few caveats to be aware of:

  1. Not all Content Directory Services support Search
  2. Some servers are horrendously slow - it's not uncommon for users to have 50-100k songs on their device
  3. If you're planning on caching audio items, be aware that object ID's aren't static and can change

By all means give it a go. I'd suggest trialing it against a known good media server (e.g. MinimServer). You'll need to look at the documentation for Content Directory Service to find how to achieve this. I believe the search criteria you are looking for is:

(upnp:class = "object.item.audioItem.musicTrack")
NNEU-1 commented 2 years ago

Thanks for your detailed reply ! Ill give it a try and see how it goes