[rygel] media-export: Fix sorting by date
- From: Jens Georg <jensgeorg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [rygel] media-export: Fix sorting by date
- Date: Mon, 27 May 2013 10:03:24 +0000 (UTC)
commit bd13ed599fc15d4112bc2f05e071f3cc21e0b9fd
Author: Jens Georg <jensg openismus com>
Date: Mon May 13 15:30:05 2013 +0200
media-export: Fix sorting by date
https://bugzilla.gnome.org/show_bug.cgi?id=694357
.../rygel-media-export-media-cache.vala | 12 +++++++++---
1 files changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/src/plugins/media-export/rygel-media-export-media-cache.vala
b/src/plugins/media-export/rygel-media-export-media-cache.vala
index dfbff41..d98218b 100644
--- a/src/plugins/media-export/rygel-media-export-media-cache.vala
+++ b/src/plugins/media-export/rygel-media-export-media-cache.vala
@@ -939,7 +939,8 @@ public class Rygel.MediaExport.MediaCache : Object {
}
private static string? map_operand_to_column (string operand,
- out string? collate = null)
+ out string? collate = null,
+ bool for_sort = false)
throws Error {
string column = null;
bool use_collation = false;
@@ -973,7 +974,11 @@ public class Rygel.MediaExport.MediaCache : Object {
use_collation = true;
break;
case "dc:date":
- column = "strftime(\"%Y\", m.date)";
+ if (for_sort) {
+ column = "m.date";
+ } else {
+ column = "strftime(\"%Y\", m.date)";
+ }
break;
case "upnp:album":
column = "m.album";
@@ -1100,7 +1105,8 @@ public class Rygel.MediaExport.MediaCache : Object {
try {
var column = MediaCache.map_operand_to_column
(field[1:field.length],
- out collate);
+ out collate,
+ true);
if (field != fields[0]) {
builder.append (",");
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]