[grilo-plugins/0.1.x] upnp: add support for track number property



commit 19644f3c885215e70a32516743ab6e7d71abacaa
Author: Jonathan Matthew <jonathan d14n org>
Date:   Mon Sep 12 21:41:31 2011 +1000

    upnp: add support for track number property
    
    Fixes https://bugzilla.gnome.org/show_bug.cgi?id=658812

 src/media/upnp/grl-upnp.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/src/media/upnp/grl-upnp.c b/src/media/upnp/grl-upnp.c
index fb2620d..1634713 100644
--- a/src/media/upnp/grl-upnp.c
+++ b/src/media/upnp/grl-upnp.c
@@ -550,6 +550,7 @@ setup_key_mappings (void)
   g_hash_table_insert (key_mapping, GRL_METADATA_KEY_GENRE, "genre");
   g_hash_table_insert (key_mapping, GRL_METADATA_KEY_URL, "res");
   g_hash_table_insert (key_mapping, GRL_METADATA_KEY_DATE, "modified");
+  g_hash_table_insert (key_mapping, GRL_METADATA_KEY_TRACK_NUMBER, "originalTrackNumber");
   g_hash_table_insert (filter_key_mapping, GRL_METADATA_KEY_TITLE, "title");
   g_hash_table_insert (filter_key_mapping, GRL_METADATA_KEY_URL, "res");
   g_hash_table_insert (filter_key_mapping, GRL_METADATA_KEY_DATE, "dc:date");
@@ -557,6 +558,7 @@ setup_key_mappings (void)
   g_hash_table_insert (filter_key_mapping, GRL_METADATA_KEY_ALBUM, "upnp:album");
   g_hash_table_insert (filter_key_mapping, GRL_METADATA_KEY_GENRE, "upnp:genre");
   g_hash_table_insert (filter_key_mapping, GRL_METADATA_KEY_DURATION, "res duration");
+  g_hash_table_insert (filter_key_mapping, GRL_METADATA_KEY_TRACK_NUMBER, "upnp:originalTrackNumber");
 }
 
 static gchar *
@@ -827,6 +829,8 @@ set_metadata_value (GrlData *data,
     }
   } else if (key_id == GRL_METADATA_KEY_CHILDCOUNT && value) {
     grl_data_set_int (data, GRL_METADATA_KEY_CHILDCOUNT, atoi (value));
+  } else if (key_id == GRL_METADATA_KEY_TRACK_NUMBER && value) {
+    grl_data_set_int (data, GRL_METADATA_KEY_TRACK_NUMBER, atoi (value));
   } else {
     grl_data_set_string (data, key_id, value);
   }
@@ -1071,6 +1075,7 @@ grl_upnp_source_supported_keys (GrlMetadataSource *source)
                                       GRL_METADATA_KEY_GENRE,
                                       GRL_METADATA_KEY_CHILDCOUNT,
                                       GRL_METADATA_KEY_THUMBNAIL,
+                                      GRL_METADATA_KEY_TRACK_NUMBER,
                                       NULL);
   }
   return keys;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]