Music scopes for Oneiric or Precise

Allison Randal allison at lohutok.net
Fri Mar 23 06:31:15 UTC 2012


On 03/21/2012 12:50 PM, Mark Tully wrote:
> I think there's a problem with the apparmor profile preventing the
> scopes from accessing the databases of the music players, preventing any
> results from being returned. There is a 'Permission Denied' error
> regarding accessing the database file when the scope is run from the
> command line. 
> 
> The databases are located at the following locations:
> Rhythmbox: ~/.local/share/rhythmbox/rhythmdb.xml
> Clementine: ~/.config/Clementine/clementine.db
> Guayadeque: ~/.guayadeque/guayadeque.db
> GMusicBrowser: ~/.config/gmusicbrowser/gmbrc
> 
> These probably need to be added to the apparmor profile file of the
> relevant scope, but I'm uncertain how to add files from a specific
> account's home folder to the profile in order to fix this. The apparmor
> profile is not present in my own PPA version, so this problem does not
> occur with it.

Here's what it took to allow the Clementine scope to run, the others had
similar needs:

  # Allow the daemon to access the music data
  @{HOME}/.config/Clementine/clementine.db r,
  @{HOME}/.config/Clementine/clementine-scope-backup.db rwk,

  # Allow the daemon to launch the music player
  /usr/bin/clementine Ux,

> Regarding the clementine issue, there is a bug in the activation code
> stopping the lens from passing the actual song uri to Clementine.  Line
> 203 in unity-scope-clementine should read :
> 
> if uri.startswith("album://"):
> 
> rather than:
> 
> if not uri.startswith("album://") == -1:
> 
> Since this is a one line fix, I figure it is easier for you to change it
> in your repository rather than me submitting it and then you importing
> it to your own branch.

Great! I've applied this patch and can confirm that the Clementine scope
now adds the song to the current playlist and starts playing it.


I encountered a fatal error in the GMusicBrowser and Guayadeque daemons,
which seems to be related to changing APIs:

Traceback (most recent call last):
  File "./unity-scope-gmusicbrowser", line 282, in <module>
    daemon = Daemon()
  File "./unity-scope-gmusicbrowser", line 36, in __init__
    self.scope.connect ("search-changed",  self.on_search_changed)
TypeError: <Scope object at 0x26298c0 (UnityScope at 0x268a160)>:
unknown signal name: search-changed

I fixed it by replacing the line:

    self.scope.connect ("search-changed",  self.on_search_changed)

With these two lines from the Clementine scope:

    self.scope.connect ("notify::active-search", self.on_search_changed)
    self.scope.connect ("notify::active-global-search",
            self.on_global_search_changed)


I also encountered another fatal error in the Guayadeque daemon that I
haven't had time to dig into yet (you may find the solution before I get
back to it on Monday):

Traceback (most recent call last):
  File "./unity-scope-guayadeque", line 95, in on_search_changed
    self.update_results_model (search, results)
  File "./unity-scope-guayadeque", line 151, in update_results_model
    if int(track[7]) >= firstdecadefilter and int(track[7]) <=
lastdecadefilter:
ValueError: invalid literal for int() with base 10:
'/home/allison/Music/Music for Deep Relaxation/Classical Indian Music
for Healing and Meditation With Santoor Master Sunil Katti and Veena
Virtuosa Gayatri Govindarajan/cover.jpg'

The GMusicBrowser scope is now showing results in the Music Lens, but
clicking a song doesn't launch the gmusicbrowser player. (The player
launches fine from an app search in the Dash or from the command-line.)
But, I don't get any errors when launching the daemon manually, or in
/var/log/syslog or /var/log/dmesg.


The Clementine and Rhythmbox scopes are working fine now.

I've pushed all my changes to the bzr branch, so you can take a look:

https://code.launchpad.net/~app-review-board/ubuntu-app-review-board/unity-scopes-music-extras-oneiric

Allison



More information about the App-review-board mailing list