Getting the Medialist by C#

I’m trying to build a small and simple client by myself and want to get a list of all media present in the server.
I try to fill a listview with the media items. When using a count with .mediafiles i always get 0 back.

The standard server media files are available by the normal client from CasparCG.

How can i get a list of pictures, audio and video that is available and put it in a listview?

See the wiki for the coresponding command in the response you get a list of all mediafiles. parse them out of the string and add them to the listview.

What i’m trying to do is:

CasparDevice caspar_ = new CasparDevice();
<>The Connection stuff<>
MessageBox.Show(caspar_.Mediafiles.Count().ToString());

What i get back is 0. So that means the list does nog have any content in it?
But when i look in my media folder of the server (which is connected for sure) i have loads of content in it.

Do i count the wrong thing? Because if i try to convert the different media files in a list, the loop of filling it won’t start because it is 0.

Am i using the wrong command to get the media files?

This is broken in server 2.2. This method works in server 2.07 and sever 2.1.

I’m working in the stable version, 2.0.7.e9fc25a.

I now understand what you meant, i fixed it, thanks!

caspar_.SendString(“CLS”);
System.Threading.Thread.Sleep(1000);
MessageBox.Show(caspar_.Mediafiles.Count().ToString());

Now i get back the count of all items.

For 2.2 if your using the svt package it can be fixed from the code base on github. When I have time I can share the edits needed.