Re: [Tracker] [Xesam] Proposing new methods in the API
- From: "Mikkel Kamstrup Erlandsen" <mikkel kamstrup gmail com>
- To: jamie mccrack gmail com
- Cc: xesam <xesam lists freedesktop org>, Tracker mailing list <tracker-list gnome org>
- Subject: Re: [Tracker] [Xesam] Proposing new methods in the API
- Date: Mon, 4 Aug 2008 19:52:16 +0200
2008/8/4 Jamie McCracken <jamie mccrack googlemail com>:
On Thu, 2008-07-31 at 17:10 +0300, Ivan Frade wrote:
Hi all,
A common use case for the client applications is to show some statistics
about the data they know. For instance, in Amarok you can see how many
different artists you have in your library, how many albums... Tracker
should provide some way to retrieve this data.
I think we have two possible solutions: 1) to complicate (even more) the
GetUniqueValues method, 2) we can add two new methods in the API.
So i would like to propose two new methods in the API:
int sum (query, property)
int count (query, property)
* Sum method:
Run the query (if exists), and sum the value of the property in the
results. So to obtain the total playing time of Beethoven music:
tracker.sum ("RDF query to obtain all albums of Beethoven",
"Audio:Length")
Or to obtain the total playing time in the computer:
tracker.sum (NULL, "Audio:Length")
* Count method:
Run the query (if exists) and count the different values in the
property for the results. So to obtain how many album do you have before
1980:
tracker.count ("RDF Query: all songs of before 1980", "Audio:Album")
Or to obtain how may albums do you have in your collection:
tracker.count (NULL, "Audio:Album")
[note: this method could be called countUniqueValues, ugly but more
descriptive]
What do you think? Can we implement that? Do you have a better solution
for this?
Thanks,
Ivan
We need to add these to xesam query I think
I actually thought a bit about on how to add this to Xesam in some
way, but did not come up with a clean way yet.
Anyway, definitely not for 1.0. But we can maybe discuss this at the hackfest?
Cheers,
Mikkel
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]