Set sort order event

Help each other out

Set sort order event

Postby Flavio61 on Wed May 10, 2006 6:22 pm

I have created a button with an event "Set sort order" to sort my movies by purchaseDate. All works, but the movies are sorted from the first (older date) to the last (newer date), I want the opposite order.

Any help.
Flavio61
 
Posts: 18
Joined: Mon Jul 19, 2004 8:27 pm

Postby Colby on Wed May 10, 2006 9:47 pm

I think the trick is to use :-1 or :+1 to before or after the sort parameter to change how it lists it. Im not certain but you can confirm what it is if you get it working.
Colby
 
Posts: 929
Joined: Mon Feb 02, 2004 7:42 am
Location: Brookline Station, MO, USA

Postby Flavio61 on Wed May 10, 2006 11:07 pm

It's no the solution or I'm not good.

I try with title field in Sort Order, if I add :+1 the order is right A-Z, but if I add :-1 the order change but is not Z-A (as I hope) but P-M-O-N etc. etc.
Flavio61
 
Posts: 18
Joined: Mon Jul 19, 2004 8:27 pm

Postby Colby on Wed May 10, 2006 11:12 pm

How are your dates tagged? 12/30/2005 or 30/12/2005 or 2005/12/25 ?
Also you are saying that -1 = Z,X,Y,W...? That has to be a bug.
Colby
 
Posts: 929
Joined: Mon Feb 02, 2004 7:42 am
Location: Brookline Station, MO, USA

Postby Flavio61 on Wed May 10, 2006 11:25 pm

My date are in yyyy/mm/dd format.

Now I try with title order because is more simple to verify, but if I add :-1 the order is random M-P-E-W or S-O-W-B.
Flavio61
 
Posts: 18
Joined: Mon Jul 19, 2004 8:27 pm

Postby jowaldo on Sat May 13, 2006 2:28 am

Flavio61 wrote:My date are in yyyy/mm/dd format.

Now I try with title order because is more simple to verify, but if I add :-1 the order is random M-P-E-W or S-O-W-B.


anyone figure this one out? I'm trying to get a numerical list in decending order...
jowaldo
 
Posts: 903
Joined: Wed May 21, 2003 7:17 pm

Postby m_ski on Mon May 15, 2006 11:27 am

Can you tell us the exact strings you are trying to use. I have found that if the string is not quite correct then xlobby seems to display stuff in a pretty jumbled up order - that may be the problem you are having.

To use reverse order you should use something like this...

Code: Select all
-1:lastplayed:artist:albumname:tracknumber:trackfilename


The above sort string gives me my music collection with the most recently played stuff at the top and works perfectly. (lastplayed is a datestamp which I automatically add to an album when it gets played)
m_ski
 
Posts: 204
Joined: Wed Dec 08, 2004 7:57 am
Location: Kent, United Kingdom

Postby lar282 on Mon May 15, 2006 1:41 pm

I use a button to VARIABLE SET the purchase date for today
category name: Movies2
purchasedate
%datetime>yyyy-MM-dd%

Then I sort them SET SORT ORDER
Category name
Sort Order: -1:purchasedate

This gives me dates like this
2006-05-11

This works me me.

//Lasse
lar282
 
Posts: 1624
Joined: Thu Apr 01, 2004 4:13 pm
Location: Helsingborg, Sweden

Postby Flavio61 on Mon May 15, 2006 9:08 pm

Thank's to m_ski and lar282.

With -1: before the sortorder field all works fine.
Flavio61
 
Posts: 18
Joined: Mon Jul 19, 2004 8:27 pm

Postby jowaldo on Mon May 15, 2006 10:26 pm

m_ski wrote:The above sort string gives me my music collection with the most recently played stuff at the top and works perfectly. (lastplayed is a datestamp which I automatically add to an album when it gets played)


how exactly are you doing a datestamp?
jowaldo
 
Posts: 903
Joined: Wed May 21, 2003 7:17 pm

Postby m_ski on Tue May 16, 2006 11:33 am

I use the datetime>u parameter which is now globally available and apply it to an album field I call 'lastplayed'.
I then have to re-sort the database (using xscript so I can use a variable as the sort parameter) so that the album you have just played then appears at the top of the list.

The play album event looks like this (in raw xml but I guess you'll work it out...)

Code: Select all
<event>
  <name>play album</name>
  <multithreaded>False</multithreaded>
  <commands>
   <command>
    <type>category</type>
    <execute>play</execute>
    <parameter>music</parameter>
   </command>
   <command>
    <type>category</type>
    <execute>variable set</execute>
    <parameter>music</parameter>
    <parameter>lastplayed</parameter>
    <parameter>%datetime&gt;u%</parameter>
   </command>
   <command>
    <type>plugin</type>
    <execute>command</execute>
    <parameter>XScript</parameter>
    <parameter>ExecScript</parameter>
    <parameter>SortByVariable.txt music %variable&gt;currentmusicsort%</parameter>
   </command>
  </commands>
 </event>
 <event>


It works really well for me as it allows me to display the recently played albums on the main menu really easily...
Image
m_ski
 
Posts: 204
Joined: Wed Dec 08, 2004 7:57 am
Location: Kent, United Kingdom