After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 740184 - TuneIn plugin
TuneIn plugin
Status: RESOLVED OBSOLETE
Product: grilo
Classification: Other
Component: source requests
unspecified
Other All
: Normal normal
: ---
Assigned To: grilo-maint
grilo-maint
Depends on: 740186
Blocks:
 
 
Reported: 2014-11-15 18:22 UTC by Marc-Andre Lureau
Modified: 2018-09-24 09:28 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
TuneIn plugin (13.59 KB, patch)
2014-11-15 18:22 UTC, Marc-Andre Lureau
needs-work Details | Review

Description Marc-Andre Lureau 2014-11-15 18:22:35 UTC
This WIP, it does some basic search & browse.

The vala bindings are not good enough to compile this, I will submit
grilo patches to generate more modern and working bindings.
Comment 1 Marc-Andre Lureau 2014-11-15 18:22:38 UTC
Created attachment 290765 [details] [review]
TuneIn plugin
Comment 2 Bastien Nocera 2014-11-16 01:58:49 UTC
Review of attachment 290765 [details] [review]:

I'd personally have written that in Lua, but hey ;)

You'll need to add a test case for this plugin as well, to test the behaviour of the plugin, and make it easier to reproduce bugs. See tests/bliptv for a good example of that for a plugin that does browse/search.

::: configure.ac
@@ +179,3 @@
 AC_SUBST(GDBUS_CODEGEN)
 
+VALA_CHECK_PACKAGES([grilo-0.2 grilo-net-0.2 json-glib-1.0], HAVE_VALA=yes, HAVE_VALA=no)

I'd prefer the HAVE_VALA variable to be called something else, in case we get another plugin that depends on a slightly different set of libraries. HAVE_TUNEIN_VALA?

::: src/tunein/grl-tunein.vala
@@ +23,3 @@
+                                     MetadataKey.BITRATE,
+                                     MetadataKey.URL,
+                                     MetadataKey.INVALID);

You're probably missing tags here, at least. You should also try to ask designers for a logo to show in the plugin.

@@ +85,3 @@
+        }
+
+        media = new_media_from_type (o.get_string_member ("type"));

We try to be complete, so you should register new metadata when one that doesn't exist could be used to record metadata that the search gives you.

For example, location and language.

@@ +96,3 @@
+
+        if (o.has_member ("URL")) {
+            var url = o.get_string_member ("URL");

Looks like there could be multiple URLs, I'd give the preferred one first (likely the 128kb AAC one) but still add the others to the metadata.

@@ +107,3 @@
+        if (o.has_member ("subtext")) {
+            var subtext = o.get_string_member ("subtext");
+            media.set_description (subtext);

This overwrites the description?

@@ +113,3 @@
+            var item = o.get_string_member ("item");
+            if (audio != null)
+                audio.set_genre (item);

You can add multiple genres, and it seems that some stations have multiple genres (this one seems to have multiple ones, not sure about the search output: http://tunein.com/radio/BBC-Radio-4-935-s25419/)

@@ +162,3 @@
+    }
+
+    public override void browse (Grl.SourceBrowseSpec bs)

Needs to handle count and skip

@@ +190,3 @@
+    }
+
+    public override void search (Grl.SourceSearchSpec ss)

Ditto.

@@ +195,3 @@
+
+        var cancellable = new GLib.Cancellable ();
+        request.begin ("http://opml.radiotime.com/Search.ashx?query=%s".printf (ss.text),

Why is the search at a different host from the service itself?

I'd document that fact, and move the URLs as defines at the top of the file.
Comment 3 Bastien Nocera 2015-09-24 13:49:12 UTC
Add to the "request" component.
Comment 4 GNOME Infrastructure Team 2018-09-24 09:28:34 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/grilo/issues/53.