[grilo-plugins] lua-factory: Re-add "Music" GOA support



commit 4dbb4f0f892f20c4fc411920bf74c503d1df22e5
Author: Bastien Nocera <hadess hadess net>
Date:   Sun Jul 26 19:11:41 2015 +0200

    lua-factory: Re-add "Music" GOA support
    
    Now that it's been merged into gnome-online-accounts.
    
    This reverts commit ba242009e67638d5139a54a7c49eb6eaa6926bd9.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=752899

 configure.ac                      |    2 +-
 src/lua-factory/grl-lua-factory.c |   10 ++++++++++
 2 files changed, 11 insertions(+), 1 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 8d46429..bf2078e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -142,7 +142,7 @@ PKG_CHECK_MODULES(GTHREAD, gthread-2.0, HAVE_GTHREAD=yes, HAVE_GTHREAD=no)
 
 PKG_CHECK_MODULES(OAUTH, oauth, HAVE_OAUTH=yes, HAVE_OAUTH=no)
 
-PKG_CHECK_MODULES(GOA, [goa-1.0 >= 3.7.1], HAVE_GOA=yes, HAVE_GOA=no)
+PKG_CHECK_MODULES(GOA, [goa-1.0 >= 3.7.2], HAVE_GOA=yes, HAVE_GOA=no)
 
 PKG_CHECK_MODULES(TOTEM_PL_PARSER, totem-plparser >= 3.4.1, HAVE_TOTEM_PL_PARSER=yes, 
HAVE_TOTEM_PL_PARSER=no)
 
diff --git a/src/lua-factory/grl-lua-factory.c b/src/lua-factory/grl-lua-factory.c
index 675e85f..f3b1e16 100644
--- a/src/lua-factory/grl-lua-factory.c
+++ b/src/lua-factory/grl-lua-factory.c
@@ -664,6 +664,15 @@ enable_goa_source (GrlLuaGoaData *lua_data,
     if (goa_account_get_photos_disabled (acc) &&
         g_hash_table_contains (lua_data->sources, *source_id_suffix))
       return GOA_REMOVE;
+  } else if (g_strcmp0 (feature, "music") == 0) {
+    if (!goa_object_peek_music (object))
+      return GOA_NOTHING;
+    if (!goa_account_get_music_disabled (acc) &&
+        !g_hash_table_contains (lua_data->sources, *source_id_suffix))
+      return GOA_ADD;
+    if (goa_account_get_music_disabled (acc) &&
+        g_hash_table_contains (lua_data->sources, *source_id_suffix))
+      return GOA_REMOVE;
   } else if (g_strcmp0 (feature, "read-later") == 0) {
     if (!goa_object_peek_read_later (object))
       return GOA_NOTHING;
@@ -882,6 +891,7 @@ validate_account_feature (const char *lua_account_feature)
   const char const *features[] = {
     "photos",
     "read-later",
+    "music",
     NULL
   };
 


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