Album cover naming in .cache/rhythmbox/album-art

For a plugin I need to access the album art of songs from rhythmbox. Right now I’m getting them by searching the songs’ directory for an image (first image found is taken). This doesn’t pick up album arts added manually, nor does it get album arts found from using the Cover art search plugin.
I’ve noticed that all album art is stored in .cache/rhythmbox/album-art but I can’t access it properly, since I don’t know the proper naming scheme.
I don’t necessarily need the naming scheme, as a way to simply get the album art’s directory from the playing song from the API would also work.
Does anyone know how the naming works, or if there’s an object in the API that stores the album art?

I figured out how to read the data; there is store.tdb which can be read using a python tdb module. However, I can’t read the data in real time in a plugin as I’m getting the error OSError: [Errno 16] Device or resource busy. I can open it using a python shell while Rhythmbox is still running, but not in a plugin itself. Anyway know why this is and how I can solve it?
I can see output from rb-ext-db.c mentioning the data store, and I want to know if i can access that from the api. Alternatively, is there a way to directly get the name of album art file through the api?

You can’t open a tdb file twice from the same process, which is why you get the ‘device or resource busy’ error when you do attempt to open it from a plugin. I wouldn’t advise doing that anyway, as the format of the database could change.

You can use the ExtDB interface the same way some of the in-tree plugins do. This is still subject to change, but less so.

After running dir(RB) and looking through the output I found references to functions along the lines of RB.ExtDB()but after messing with it for a while I couldn’t find anyway to use it properly. Do you know how I would use these functions to get the path of the album cover?

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.