Hi Dennis thanks for the reply. Ye i guess i could use .GetRootMedia() Which returns a list of the top level folders and files and then iterate over the decendants and add them to one list. Was hoping there was something a little simpler than this though.
After testing library.GetMedia(-1, true); doesn't return all media either.
Getting a list of media with MediaService
Hey, can anyone tell me if there is a simple way get a list of all media using the MediaService I thought i would be able to use:
mediaService.GetDescendants(-1)
However this doesn't seem to work.
library.GetMedia(-1, true);
This returns all media but returns XPathNodeIterator
Hi David and welcome to our,
I´m not a backend developer, so I don´t know if this is possible.
But with the .GetRootMedia() you should get get a
Enumerable
list ofMedia
objects, which reside at the first level / root.When you have the root, can´t you then take the Children, or Descendants?
.GetChildren(int parentId)
Gets a
Enumerable
list ofMedia
objects by parent Id..GetDescendants(int parentId)
Gets
Enumerable
list descendants of aMedia
object by its parent Id.Hope this can help you, allthough I'm not backend developer.
/Dennis
Hi Dennis thanks for the reply. Ye i guess i could use
.GetRootMedia()
Which returns a list of the top level folders and files and then iterate over the decendants and add them to one list. Was hoping there was something a little simpler than this though.After testing library.GetMedia(-1, true); doesn't return all media either.
is working on a reply...