Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Need help for sort workaround
cgiesen
#1 Posted : Tuesday, 1 December 2009 7:02:08 AM(UTC)
Rank: Member

Joined: 10/10/2009(UTC)
Posts: 6
Location: Bochum, Germany

Hello,

yes, I know sorting comes later ;)
But until this, I want to change the ordering for ALL picture by date desc.
Normaly I have only to change th SQL command for collecting pictures.
Right?
And I yes, where can I find the right place?

cu

Carsten
Roger Martin
#2 Posted : Tuesday, 1 December 2009 8:53:08 AM(UTC)
Roger Martin

Rank: Administration

Joined: 3/08/2007(UTC)
Posts: 3,150
Location: Fort Atkinson, WI

All metadata that is extracted from images is stored in the table gs_MediaObjectMetadata. You can construct a SQL statement that updates the Seq column in gs_MediaObject based on the desired metadata item. It will be a little tricky since the date is extracted as a string and stored as a string, so you'll have to convert it to a date in your SQL statement to get true date sorting.
Roger Martin
Creator and Lead Developer of Gallery Server Pro
cgiesen
#3 Posted : Tuesday, 1 December 2009 6:06:29 PM(UTC)
Rank: Member

Joined: 10/10/2009(UTC)
Posts: 6
Location: Bochum, Germany

Hello Martin,

thanks for the quick replay

The SEQ column, did it start for every album at 1 again?

cu

Carsten
Roger Martin
#4 Posted : Tuesday, 1 December 2009 11:45:06 PM(UTC)
Roger Martin

Rank: Administration

Joined: 3/08/2007(UTC)
Posts: 3,150
Location: Fort Atkinson, WI

Yes, although that is not a requirement. You can give it any number, and the sorting will work because sorting is done by relative comparison of Seq values.
Roger Martin
Creator and Lead Developer of Gallery Server Pro
cgiesen
#5 Posted : Friday, 18 December 2009 8:57:47 AM(UTC)
Rank: Member

Joined: 10/10/2009(UTC)
Posts: 6
Location: Bochum, Germany

Hi,

I'm not good in reading c# code :(
But I try ;)
I search for the please where you collect the pictures in the righ order.
Can you please give me a tipp?

Thanks

Carsten
Roger Martin
#6 Posted : Friday, 18 December 2009 12:04:05 PM(UTC)
Roger Martin

Rank: Administration

Joined: 3/08/2007(UTC)
Posts: 3,150
Location: Fort Atkinson, WI

Gallery objects (which include media objects and albums) are sorted by the Sequence property of the GalleryObject class. That is, the implementation of the IComparable interface in GalleryObject uses the Sequence property to compare itself to other instances of the same type. This implementation is used by the .NET Framework when the Sort method of the GalleryObjectCollection class is invoked. The sort method is called within Album.GetChildGalleryObjects().

Hope this helps,
Roger Martin
Creator and Lead Developer of Gallery Server Pro
Rss Feed  Atom Feed
Users browsing this topic
Guest
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.