#1 2010-08-19 10:43:41

unclepetros
Member
Registered: 2010-04-11
Posts: 88

[Patch] Default collection sorting by a generic field

Hi,
I've posted a feature request yesterday on this (http://forums.gcstar.org/viewtopic.php?id=1623), but, in the meantime, I've managed to implement it.

Practically, I've introduced a new xml tag in GCmusics.gcm model, named generic:

Code:

...
<generic>artist</generic>
...

This tag have to be set with a valid field name (in my case I've used 'artist', that is the name of the field containing artist name).

Then I've modified the module GCImageList.pm in order to check for generic tag; if it exists items are default ordered by the field specified in generic xml tag, otherwise default sorting is by title.
I've quickly tested it, and works fine under ubuntu 10.04 and Windows 7.
Now I've my music collection default ordered by artist name.
The generic tag can be used in the model file (.gcm) of any collection you want to default order by a field other than 'title' field.

In attachment the patch.

I hope it can be useful.
Let me know.

Bye
UnclePetros

Last edited by unclepetros (2010-08-19 10:48:55)

Offline

 

#2 2010-08-19 10:57:02

unclepetros
Member
Registered: 2010-04-11
Posts: 88

Re: [Patch] Default collection sorting by a generic field

Oops,
I've posted in the wrong section.

Please moderator or administrator to remove this topic; I've posted the same in the 'Developer and contributors' section.

Sorry.

UnclePetros

Offline

 



Should you have a problem using GCstar, you can open a bug report or request some support on GCstar forums.