[rygel] media-export: Support genre tag
- From: Zeeshan Ali Khattak <zeeshanak src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [rygel] media-export: Support genre tag
- Date: Thu, 5 Aug 2010 14:31:41 +0000 (UTC)
commit 39a80620d93e1b058e11bb39dcce383889e80b8f
Author: Jens Georg <mail jensge org>
Date: Sat Jul 24 16:23:36 2010 +0300
media-export: Support genre tag
.../media-export/rygel-media-export-item.vala | 1 +
.../rygel-media-export-media-cache.vala | 17 +++++++++++------
2 files changed, 12 insertions(+), 6 deletions(-)
---
diff --git a/src/plugins/media-export/rygel-media-export-item.vala b/src/plugins/media-export/rygel-media-export-item.vala
index ea270ae..9b73808 100644
--- a/src/plugins/media-export/rygel-media-export-item.vala
+++ b/src/plugins/media-export/rygel-media-export-item.vala
@@ -223,6 +223,7 @@ public class Rygel.MediaExport.Item : Rygel.MediaItem {
if (dlna_info.info.tags != null) {
dlna_info.info.tags.get_string (TAG_ARTIST, out this.author);
dlna_info.info.tags.get_string (TAG_ALBUM, out this.album);
+ dlna_info.info.tags.get_string (TAG_GENRE, out this.genre);
uint tmp;
dlna_info.info.tags.get_uint (TAG_TRACK_NUMBER, out tmp);
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 c281a2f..b2d1ead 100644
--- a/src/plugins/media-export/rygel-media-export-media-cache.vala
+++ b/src/plugins/media-export/rygel-media-export-media-cache.vala
@@ -120,8 +120,8 @@ public class Rygel.MediaExport.MediaCache : Object {
"(size, mime_type, width, height, class, " +
"author, album, date, bitrate, " +
"sample_freq, bits_per_sample, channels, " +
- "track, color_depth, duration, object_fk, dlna_profile) VALUES " +
- "(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
+ "track, color_depth, duration, object_fk, dlna_profile, genre) VALUES " +
+ "(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
private const string INSERT_OBJECT_STRING =
"INSERT OR REPLACE INTO Object (upnp_id, title, type_fk, parent, timestamp, uri) " +
@@ -136,7 +136,7 @@ public class Rygel.MediaExport.MediaCache : Object {
"m.height, m.class, m.author, m.album, m.date, m.bitrate, " +
"m.sample_freq, m.bits_per_sample, m.channels, m.track, " +
"m.color_depth, m.duration, o.parent, o.upnp_id, o.timestamp, " +
- "o.uri, m.dlna_profile " +
+ "o.uri, m.dlna_profile, m.genre " +
"FROM Object o " +
"JOIN Closure c ON (o.upnp_id = c.ancestor) " +
"LEFT OUTER JOIN meta_data m ON (o.upnp_id = m.object_fk) " +
@@ -157,7 +157,7 @@ public class Rygel.MediaExport.MediaCache : Object {
"m.width, m.height, m.class, m.author, m.album, " +
"m.date, m.bitrate, m.sample_freq, m.bits_per_sample, " +
"m.channels, m.track, m.color_depth, m.duration, " +
- "o.upnp_id, o.parent, o.timestamp, o.uri, m.dlna_profile " +
+ "o.upnp_id, o.parent, o.timestamp, o.uri, m.dlna_profile, m.genre " +
"FROM Object o LEFT OUTER JOIN meta_data m " +
"ON o.upnp_id = m.object_fk " +
"WHERE o.parent = ? " +
@@ -173,7 +173,7 @@ public class Rygel.MediaExport.MediaCache : Object {
"m.width, m.height, m.class, m.author, m.album, " +
"m.date, m.bitrate, m.sample_freq, m.bits_per_sample, " +
"m.channels, m.track, m.color_depth, m.duration, " +
- "o.upnp_id, o.parent, o.timestamp, o.uri, m.dlna_profile " +
+ "o.upnp_id, o.parent, o.timestamp, o.uri, m.dlna_profile, m.genre " +
"FROM Object o " +
"JOIN Closure c ON o.upnp_id = c.descendant AND c.ancestor = ? " +
"LEFT OUTER JOIN meta_data m " +
@@ -578,7 +578,8 @@ public class Rygel.MediaExport.MediaCache : Object {
item.color_depth,
item.duration,
item.id,
- item.dlna_profile};
+ item.dlna_profile,
+ item.genre};
this.db.exec (SAVE_META_DATA_STRING, values);
}
@@ -701,6 +702,7 @@ public class Rygel.MediaExport.MediaCache : Object {
item.height = statement.column_int (5);
item.color_depth = statement.column_int (15);
item.dlna_profile = statement.column_text (21);
+ item.genre = statement.column_text (22);
}
public ArrayList<string> get_child_ids (string container_id)
@@ -793,6 +795,9 @@ public class Rygel.MediaExport.MediaCache : Object {
case "upnp:album":
column = "m.album";
break;
+ case "dc:genre":
+ column = "m.genre";
+ break;
default:
var message = "Unsupported column %s".printf (operand);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]