XML-based sources (Metadata Factory plugin)
- From: "Juan A. Suarez Romero" <jasuarez igalia com>
- To: grilo-list gnome org
- Subject: XML-based sources (Metadata Factory plugin)
- Date: Fri, 27 Apr 2012 16:40:13 +0200
Hi.
As part of a work I'm doing in order to help people to create new
sources in a simpler way, I'm pleased to announce the new
metadata-factory.
It's still a work in progress, and thus it is not merged in Grilo yet.
But you can find here:
https://gitorious.org/~jasuarez/grilo/jasuarez-grilo-plugins/commits/metadata-factory
What it does? Basically, it is a plugin that is able to read
descriptions of sources in XML, and based on that description, create a
new metadata source completely functional.
In the branch there are two examples of XML-based sources, one of them
using Lastfm and another using TMDb to get thumbnails for content).
Here is a source that gets the thumbnail from lastfm service:
----8<------------------8<-----------------------8<--------------
<source type="metadata">
<id>grl-lastfm-albumart</id>
<name>Album art Provider from Last.FM</name>
<description>
A plugin for getting album arts using Last.FM as backend
</description>
<provide>
<thumbnail>
<require type="audio">
<artist/>
<album/>
</require>
<source>
http://ws.audioscrobbler.com/1.0/album/%key:artist%/%key:album%/info.xml
</source>
<query>/album/coverart/large</query>
</thumbnail>
</provide>
</source>
----8<------------------8<-----------------------8<--------------
As I said above, this is work in progress, so expect new improvements
and features in the short term.
My idea is to improve and polish it iteratively, and push it with the
future 0.2.0 release.
So far, what it provides?
* Specify basic information: name, description, identifier
* Specify what are the required configuration keys for the source, and
what are the default values if user does not provide them
* Specify which keys the source is able to provide
* Specify the type of Grilo media it is able to handle
* Specify what are the Grilo metadata keys it needs to resolve each of
the provided keys
* Besides the required keys, you can specify a pattern matching for the
key, so if the required key must have a value and match the pattern
(valid only for string-type keys)
* Specify simple transformations over the value of the required key. For
example, replace all the blanks in the "author" value by '+' character
(valid only for string-type keys)
* Specify how to get the value for the provided key. Basically what are
the page to query, and a XPath to locate the proper value.
Yes, as you can see, it works with XML services: you specify where to
get the XML with the results, and a XPath expression where to locate the
real value for the key.
My plans are, besides polishing and improving the plugin, write a
complete documentation about all the supported features and
restrictions.
Also, I'm starting to design a media-source-factory, which would work
similar to this plugin, but for the case of Media sources.
Cheers
J.A.
[
Date Prev][Date Next] [
Thread Prev][Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]