rhythmbox r6287 - in trunk: . backends/gstreamer metadata rhythmdb
- From: teuf svn gnome org
- To: svn-commits-list gnome org
- Subject: rhythmbox r6287 - in trunk: . backends/gstreamer metadata rhythmdb
- Date: Sun, 12 Apr 2009 07:56:41 +0000 (UTC)
Author: teuf
Date: Sun Apr 12 07:56:41 2009
New Revision: 6287
URL: http://svn.gnome.org/viewvc/rhythmbox?rev=6287&view=rev
Log:
2009-04-12 Christophe Fergeau <cfergeau mandriva com>
patch by: Sebastian Dransfeld <sebastid tango flipp net>
* backends/gstreamer/rb-encoder-gst.c:
* metadata/rb-metadata-common.c:
* metadata/rb-metadata-gst.c:
* metadata/rb-metadata.h:
* rhythmdb/rhythmdb-private.h:
* rhythmdb/rhythmdb-tree.c:
* rhythmdb/rhythmdb.c:
* rhythmdb/rhythmdb.h: read album sort tag from gstreamer and store
it in rhythmbox database. Fixes part of bug #577753.
Modified:
trunk/ChangeLog
trunk/backends/gstreamer/rb-encoder-gst.c
trunk/metadata/rb-metadata-common.c
trunk/metadata/rb-metadata-gst.c
trunk/metadata/rb-metadata.h
trunk/rhythmdb/rhythmdb-private.h
trunk/rhythmdb/rhythmdb-tree.c
trunk/rhythmdb/rhythmdb.c
trunk/rhythmdb/rhythmdb.h
Modified: trunk/backends/gstreamer/rb-encoder-gst.c
==============================================================================
--- trunk/backends/gstreamer/rb-encoder-gst.c (original)
+++ trunk/backends/gstreamer/rb-encoder-gst.c Sun Apr 12 07:56:41 2009
@@ -454,6 +454,11 @@
GST_TAG_MUSICBRAINZ_SORTNAME, rhythmdb_entry_get_string (entry, RHYTHMDB_PROP_ARTIST_SORTNAME),
NULL);
}
+ if (rhythmdb_entry_get_string (entry, RHYTHMDB_PROP_ALBUM_SORTNAME)) {
+ gst_tag_list_add (tags, GST_TAG_MERGE_APPEND,
+ GST_TAG_ALBUM_SORTNAME, rhythmdb_entry_get_string (entry, RHYTHMDB_PROP_ALBUM_SORTNAME),
+ NULL);
+ }
#endif
{
Modified: trunk/metadata/rb-metadata-common.c
==============================================================================
--- trunk/metadata/rb-metadata-common.c (original)
+++ trunk/metadata/rb-metadata-common.c Sun Apr 12 07:56:41 2009
@@ -74,6 +74,7 @@
/* RB_METADATA_FIELD_MUSICBRAINZ_ALBUMID */ { G_TYPE_STRING, "musicbrainz-albumid" },
/* RB_METADATA_FIELD_MUSICBRAINZ_ALBUMARTISTID */ { G_TYPE_STRING, "musicbrainz-albumartistid" },
/* RB_METADATA_FIELD_ARTIST_SORTNAME */ { G_TYPE_STRING, "musicbrainz-sortname" },
+ /* RB_METADATA_FIELD_ALBUM_SORTNAME */ { G_TYPE_STRING, "album-sortname" },
};
Modified: trunk/metadata/rb-metadata-gst.c
==============================================================================
--- trunk/metadata/rb-metadata-gst.c (original)
+++ trunk/metadata/rb-metadata-gst.c Sun Apr 12 07:56:41 2009
@@ -527,6 +527,8 @@
return RB_METADATA_FIELD_MUSICBRAINZ_ALBUMARTISTID;
else if (!strcmp (tag, GST_TAG_MUSICBRAINZ_SORTNAME))
return RB_METADATA_FIELD_ARTIST_SORTNAME;
+ else if (!strcmp (tag, GST_TAG_ALBUM_SORTNAME))
+ return RB_METADATA_FIELD_ALBUM_SORTNAME;
#endif
else
@@ -599,6 +601,8 @@
return GST_TAG_MUSICBRAINZ_ALBUMARTISTID;
case RB_METADATA_FIELD_ARTIST_SORTNAME:
return GST_TAG_MUSICBRAINZ_SORTNAME;
+ case RB_METADATA_FIELD_ALBUM_SORTNAME:
+ return GST_TAG_ALBUM_SORTNAME;
#endif
default:
return NULL;
Modified: trunk/metadata/rb-metadata.h
==============================================================================
--- trunk/metadata/rb-metadata.h (original)
+++ trunk/metadata/rb-metadata.h Sun Apr 12 07:56:41 2009
@@ -67,6 +67,7 @@
RB_METADATA_FIELD_MUSICBRAINZ_ALBUMID, /* string */
RB_METADATA_FIELD_MUSICBRAINZ_ALBUMARTISTID, /* string */
RB_METADATA_FIELD_ARTIST_SORTNAME, /* string */
+ RB_METADATA_FIELD_ALBUM_SORTNAME, /* string */
RB_METADATA_FIELD_LAST /* nothing */
} RBMetaDataField;
Modified: trunk/rhythmdb/rhythmdb-private.h
==============================================================================
--- trunk/rhythmdb/rhythmdb-private.h (original)
+++ trunk/rhythmdb/rhythmdb-private.h Sun Apr 12 07:56:41 2009
@@ -90,6 +90,7 @@
RBRefString *musicbrainz_albumid;
RBRefString *musicbrainz_albumartistid;
RBRefString *artist_sortname;
+ RBRefString *album_sortname;
gulong tracknum;
gulong discnum;
gulong duration;
Modified: trunk/rhythmdb/rhythmdb-tree.c
==============================================================================
--- trunk/rhythmdb/rhythmdb-tree.c (original)
+++ trunk/rhythmdb/rhythmdb-tree.c Sun Apr 12 07:56:41 2009
@@ -975,6 +975,9 @@
case RHYTHMDB_PROP_ARTIST_SORTNAME:
save_entry_string(ctx, elt_name, rb_refstring_get (entry->artist_sortname));
break;
+ case RHYTHMDB_PROP_ALBUM_SORTNAME:
+ save_entry_string(ctx, elt_name, rb_refstring_get (entry->album_sortname));
+ break;
case RHYTHMDB_PROP_TRACK_NUMBER:
save_entry_ulong (ctx, elt_name, entry->tracknum, FALSE);
break;
Modified: trunk/rhythmdb/rhythmdb.c
==============================================================================
--- trunk/rhythmdb/rhythmdb.c (original)
+++ trunk/rhythmdb/rhythmdb.c Sun Apr 12 07:56:41 2009
@@ -552,6 +552,9 @@
case RHYTHMDB_PROP_ARTIST_SORTNAME:
*field = RB_METADATA_FIELD_ARTIST_SORTNAME;
return TRUE;
+ case RHYTHMDB_PROP_ALBUM_SORTNAME:
+ *field = RB_METADATA_FIELD_ALBUM_SORTNAME;
+ return TRUE;
default:
return FALSE;
}
@@ -1512,6 +1515,7 @@
ret->musicbrainz_albumid = rb_refstring_ref (db->priv->empty_string);
ret->musicbrainz_albumartistid = rb_refstring_ref (db->priv->empty_string);
ret->artist_sortname = rb_refstring_ref (db->priv->empty_string);
+ ret->album_sortname = rb_refstring_ref (db->priv->empty_string);
ret->mimetype = rb_refstring_ref (db->priv->octet_stream_str);
ret->flags |= RHYTHMDB_ENTRY_LAST_PLAYED_DIRTY |
@@ -1707,6 +1711,7 @@
rb_refstring_unref (entry->musicbrainz_albumid);
rb_refstring_unref (entry->musicbrainz_albumartistid);
rb_refstring_unref (entry->artist_sortname);
+ rb_refstring_unref (entry->album_sortname);
rb_refstring_unref (entry->mimetype);
g_free (entry);
@@ -1894,6 +1899,15 @@
g_value_unset (&val);
}
+ /* album sortname */
+ if (rb_metadata_get (metadata,
+ RB_METADATA_FIELD_ALBUM_SORTNAME,
+ &val)) {
+ rhythmdb_entry_set_internal (db, entry, TRUE,
+ RHYTHMDB_PROP_ALBUM_SORTNAME, &val);
+ g_value_unset (&val);
+ }
+
/* filesize */
g_value_init (&val, G_TYPE_UINT64);
g_value_set_uint64 (&val, g_file_info_get_attribute_uint64 (fileinfo, G_FILE_ATTRIBUTE_STANDARD_SIZE));
@@ -3497,6 +3511,10 @@
rb_refstring_unref (entry->artist_sortname);
entry->artist_sortname = rb_refstring_new (g_value_get_string (value));
break;
+ case RHYTHMDB_PROP_ALBUM_SORTNAME:
+ rb_refstring_unref (entry->album_sortname);
+ entry->album_sortname = rb_refstring_new (g_value_get_string (value));
+ break;
case RHYTHMDB_PROP_HIDDEN:
if (g_value_get_boolean (value)) {
entry->flags |= RHYTHMDB_ENTRY_HIDDEN;
@@ -4165,6 +4183,7 @@
ENUM_ENTRY (RHYTHMDB_PROP_MUSICBRAINZ_ALBUMID, "Musicbrainz Album ID (gchararray) [mb-albumid]"),
ENUM_ENTRY (RHYTHMDB_PROP_MUSICBRAINZ_ALBUMARTISTID, "Musicbrainz Album Artist ID (gchararray) [mb-albumartistid]"),
ENUM_ENTRY (RHYTHMDB_PROP_ARTIST_SORTNAME, "Artist Sortname (gchararray) [mb-artistsortname]"),
+ ENUM_ENTRY (RHYTHMDB_PROP_ALBUM_SORTNAME, "Album Sortname (gchararray) [album-sortname]"),
ENUM_ENTRY (RHYTHMDB_PROP_DURATION, "Duration (gulong) [duration]"),
ENUM_ENTRY (RHYTHMDB_PROP_FILE_SIZE, "File Size (guint64) [file-size]"),
@@ -4924,6 +4943,8 @@
return rb_refstring_get (entry->musicbrainz_albumartistid);
case RHYTHMDB_PROP_ARTIST_SORTNAME:
return rb_refstring_get (entry->artist_sortname);
+ case RHYTHMDB_PROP_ALBUM_SORTNAME:
+ return rb_refstring_get (entry->album_sortname);
case RHYTHMDB_PROP_MIMETYPE:
return rb_refstring_get (entry->mimetype);
case RHYTHMDB_PROP_TITLE_SORT_KEY:
@@ -5027,6 +5048,8 @@
return rb_refstring_ref (entry->musicbrainz_albumartistid);
case RHYTHMDB_PROP_ARTIST_SORTNAME:
return rb_refstring_ref (entry->artist_sortname);
+ case RHYTHMDB_PROP_ALBUM_SORTNAME:
+ return rb_refstring_ref (entry->album_sortname);
case RHYTHMDB_PROP_MIMETYPE:
return rb_refstring_ref (entry->mimetype);
case RHYTHMDB_PROP_MOUNTPOINT:
Modified: trunk/rhythmdb/rhythmdb.h
==============================================================================
--- trunk/rhythmdb/rhythmdb.h (original)
+++ trunk/rhythmdb/rhythmdb.h Sun Apr 12 07:56:41 2009
@@ -212,6 +212,7 @@
RHYTHMDB_PROP_MUSICBRAINZ_ALBUMID,
RHYTHMDB_PROP_MUSICBRAINZ_ALBUMARTISTID,
RHYTHMDB_PROP_ARTIST_SORTNAME,
+ RHYTHMDB_PROP_ALBUM_SORTNAME,
RHYTHMDB_NUM_PROPERTIES
} RhythmDBPropType;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]