0001-dmap-Add-album-disc-number-mapping.patch 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. From 3cd7fb6af73ca7fdef2557ad31b5c4180534d775 Mon Sep 17 00:00:00 2001
  2. From: "W. Michael Petullo" <mike@flyn.org>
  3. Date: Sat, 9 Jul 2016 09:50:00 -0400
  4. Subject: [PATCH] dmap: Add album disc number mapping
  5. Signed-off-by: W. Michael Petullo <mike@flyn.org>
  6. ---
  7. src/dmap/grl-daap-db.c | 7 +++++++
  8. src/dmap/grl-daap.c | 1 +
  9. 2 files changed, 8 insertions(+)
  10. diff --git a/src/dmap/grl-daap-db.c b/src/dmap/grl-daap-db.c
  11. index 4850073..5bcd804 100644
  12. --- a/src/dmap/grl-daap-db.c
  13. +++ b/src/dmap/grl-daap-db.c
  14. @@ -161,6 +161,7 @@ grl_daap_db_add (DMAPDb *_db, DMAPRecord *_record)
  15. gint duration = 0;
  16. gint32 bitrate = 0,
  17. + disc = 0,
  18. track = 0;
  19. gchar *id_s = NULL,
  20. *title = NULL,
  21. @@ -186,6 +187,8 @@ grl_daap_db_add (DMAPDb *_db, DMAPRecord *_record)
  22. &title,
  23. "track",
  24. &track,
  25. + "disc",
  26. + &disc,
  27. "location",
  28. &url,
  29. "has-video",
  30. @@ -217,6 +220,10 @@ grl_daap_db_add (DMAPDb *_db, DMAPRecord *_record)
  31. grl_media_set_bitrate (media, bitrate);
  32. grl_media_set_track_number (media, track);
  33. + if (disc != 0) {
  34. + grl_media_set_album_disc_number (media, disc);
  35. + }
  36. +
  37. if (album) {
  38. grl_media_set_album (media, album);
  39. }
  40. diff --git a/src/dmap/grl-daap.c b/src/dmap/grl-daap.c
  41. index 59aa981..796234d 100644
  42. --- a/src/dmap/grl-daap.c
  43. +++ b/src/dmap/grl-daap.c
  44. @@ -365,6 +365,7 @@ grl_daap_source_supported_keys (GrlSource *source)
  45. if (!keys) {
  46. keys = grl_metadata_key_list_new (GRL_METADATA_KEY_ALBUM,
  47. + GRL_METADATA_KEY_ALBUM_DISC_NUMBER,
  48. GRL_METADATA_KEY_ARTIST,
  49. GRL_METADATA_KEY_BITRATE,
  50. GRL_METADATA_KEY_DURATION,
  51. --
  52. 2.7.4