How to sort movie collections?

Internet TV, Radio, Podcasts
Post Reply
Rheingold
Posts: 12
Joined: Tue Mar 15, 2011 10:40 am

How to sort movie collections?

Post by Rheingold »

Hi,
under the folder Internet TV I create with a script a new Folder "TV Streams" an then in this folder a moviecollection "All" and also two folders "Country" and "Language". In these two folders ther are many movicollections with names like "Germany", "Austria", "Switzerland" or in the Language-Folder "English", "German", "French" these collections have the mediaitems with infos to streams matching the language or the country.
I didn't mange to sort the collections alphabethcally, neither in "All" nor in "Country" or "Language" the streams in the collections are sorted but not the collection names itself.

I wonder if there is a scripting function (command) for this sorting. Perhaps someone can help.

Code: Select all

Internet TV
  Folder: TV Streams
                MColl:  All
                          Streams: CNN
                                    BBC 
                                    RTL
                                    SF1
                                    ZDF
                                    etc.
                Folder Country
                           MColl Germany
                                        Streams: RTL
                                                 ZDF
                                                 etc.
                           MColl Austria
                                        Streams:  ORF 1
                                                  ORF 2
                                                  ect.
                Folder Language
                            MColl  German
                                        Streams:  ORF
                                                  RTL
                                                  etc. 
Eugene
Posts: 2940
Joined: Tue Nov 17, 2009 8:05 pm

Re: How to sort movie collections?

Post by Eugene »

Hi,

You can use the method Sort

Code: Select all

   TVStreamsFolder.Sort('+mpTitle\+mpTitle\+mpTitle');
Rheingold
Posts: 12
Joined: Tue Mar 15, 2011 10:40 am

Re: How to sort movie collections?

Post by Rheingold »

Hi Eugene,

thnx for your answer
TVStreamsFolder.Sort('+mpTitle\+mpTitle\+mpTitle');
but what's the meaning of the three parameters? I think +/- is ascending/decending sortorder, but why three mParameters and can I use other Parameters of a folders or of a mediacollection? What about more than three parameters?

Rheingold
Eugene
Posts: 2940
Joined: Tue Nov 17, 2009 8:05 pm

Re: How to sort movie collections?

Post by Eugene »

Hi,
Rheingold wrote:
thnx for your answer
TVStreamsFolder.Sort('+mpTitle\+mpTitle\+mpTitle');
but what's the meaning of the three parameters? I think +/- is ascending/decending sortorder, but why three mParameters and can I use other Parameters of a folders or of a mediacollection? What about more than three parameters?
You can specify any number of sorting levels.
About mpTitle: Script window - "Functions, variables" - Variables - "Media resource parameters"
Rheingold
Posts: 12
Joined: Tue Mar 15, 2011 10:40 am

Re: How to sort movie collections?

Post by Rheingold »

I tried it with this little script

Code: Select all

var
  TvFolder: TWmsScriptMediaItem;
  cc,i : integer;  
  names:string;  

begin
  tvfolder:=WmsCurrentMediaTreeItem;  
  cc:=tvFolder.ChildCount;
  showmessage(TVFolder.properties[mpiTitle]+' '+str(cc));
  i:=0;names:='';
  repeat    
    names:=names+TVFolder.childItems[i].properties[mpiTitle]+' ';  
    i:=i+1;  
  until i=cc;                                                       
  showmessage(names);
  TvFolder.Sort('+');  
  WmsDatabaseAutoSave;
  i:=0;names:='';
  repeat    
    names:=names+TVFolder.childItems[i].properties[mpiTitle]+' ';  
    i:=i+1;  
  until i=cc;                                                       
  showmessage(names);
end.
and I could see, that the childorder is changed in the database, but unfortunatly there was no change on the screen displaying the Moviefolders. Perhaps i missed something to refreh it?

Rheingold
Post Reply