One Week Search.

This is supposed to be published last week, but…

New Search view of GNOME Music
New Search view of GNOME Music

Last week, I have worked on the advanced search branch of Music. The branch just got merged last Monday, and will be released along Music 3.13.2 on Monday next week.

Update: Got confused on the dates, it should be next, next week.

Search View

The first thing I’ve worked on are the queries for the search results used for Tracker, which actually happened last month. I’ve done some rebasing of the search branch as stated in one of my earlier posts.

Then last week, I’ve worked on the Search view. At first, it can only show songs, then you could play them by selecting them in the search results.

Add items to a playlist with selection mode
Add items to a playlist with selection mode

Enabling selection mode will allow you to add the selected items from the search results to one of your playlists.

Searching Albums

Viewing an album from search results
Viewing an album from search results

Next that I’ve worked on are the results for Albums. Selecting an album in the results will show its contents, just like the Albums view. Then added selection to albums.

Searching in Web Services

I skipped Artists for now, and started working on making search in web services work. The dropdown for selecting sources is already in the branch, so I just did some cleanup to filter out some sources like Bookmarks which are not used by Music, and fixed some bugs preventing the search by sources to work.

At first, it could only show songs since grilo doesn’t have objects for albums and artists. Music actually creates them as containers using SPARQL queries when using Tracker. Unfortunately, we can’t use queries in sources other than Tracker for searching since each source has its own type of queries – which is simply inflexible and hard to maintain, and not all sources support queries anyway.

Searching for songs in Jamendo
Searching for songs in Jamendo

Seems like currently there are only two web services we could use for searching music in grilo: Jamendo and Magnatune. I’ve only tested Jamendo, for some reason Magnatune don’t return any results in my computer even though it works in my mentor’s computer. Maybe it’s not available in the Philippines, and I don’t have money for subscription. (Tried again today and it worked, weird.)

Unfortunately, you could only play them – adding them to playlists will produce a crash. Playlists view, currently, could only show local files. Maybe we could do some importing to the user’s Music directory, or do something so that grilo accepts URLs with a source (we could only store the URIs, so we don’t know what source the playlist items came from).

Searching by field
Searching by field

If you only search in local files, you could select which field to search in – Artist Name, Album Name, Track Title, or all of them. Made possible by queries.

Searching Artists

Then, I went ahead on making Artists show up in the results. This one took most of my time because I have to allow selection of songs from the artist’s albums. Selection on Artists view happens in the sidebar, by artists instead of by songs, but we can’t show it here since it is supposed to show only one artist. The design is not clear on this, and the designers are not around either because of the DX Hackfest, so I just copied how selection in albums work – selecting by songs.

Selection mode in artist search results
Selection mode in artist search results

Apart from the design issues, I also have to add lots of callbacks for loading the songs of each album of each artist selected by the user when adding them to a playlist.

The media art shown is from the first album found for each artist.

Afterwards, I’ve changed the code so that it would create dummy containers for albums and artists for results from web services. Selecting an album or artist could only show songs included in the search result though. I’m still checking if showing all of songs with the same album/artist is possible with grilo without using queries.

What’s Next?

I’ll be working on rewriting parts of Playlists view so that it stores playlists into Tracker instead of using files, rewriting the Playlists view so there is a separate widget for showing playlists, writing queries for searching in playlists, and making those results show up in the Search view.

I’ve created another Fedora COPR repository for GSoC here, but it is currently useless since the advanced search branch was already merged to master. Any future updates will be there though.

So, that’s all for my first report on my GSoC 2014 project. I’ve taken a break for now because my final exam is near and to catch some sleep (plus my anime watchlist is getting longer hehe…). I got so busy last week that I don’t notice how much time passes by – I usually start working at 6PM and sometimes sleep around 4AM.

Update: You currently need GNOME 3.12 to use gnome-music because of a bug I introduced. I didn’t notice that I used a function that is only available in GTK+ 3.12. This will be fixed soon.

Advertisements

9 thoughts on “One Week Search.”

  1. Hey man,

    I really appreciate the work you’re putting into this, looking forward to having a fantastic music player for Gnome.

    A quick question though, Gnome Music 3.12.1 doesn’t pick up any of my music Library which is in Opus format, is it easy to add additional formats? I took a look but couldn’t figure that out.

    Anyhow, I’m ‘meow’ in #gnome-hackers if you want to poke me.

    1. Not really, we just have to look for a source that accepts any URL then it should work. Tried looking for one last year, but not all metadata are loaded or it is not supported. So I created a query instead, which could only work with local files.

Blog is now moved to www.kyoushuu.com, please leave your comments there instead.

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s