Re: [Rhythmbox-devel] [Plugin Development] How to Manage Entries in the RhythmDB ?



On Sat, May 24, 2008 at 9:11 PM, Mats Taraldsvik
<mats taraldsvik broadpark no> wrote:
> Hi!
>
> I've added the save_to_disk attribute. I couldn't set it from Python.
> http://bugzilla.gnome.org/show_bug.cgi?id=534062
>
> I'm trying to add an mp3 file to the database with
> shell.get_property("db").entry_new( entry_type, 'file://' +
> file_to_add )
>
> This does work, but the file is added to the database as <date>0</date>
> and <mimetype>application/octet-stream</mimetype>.

rhythmdb_entry_new just creates a new database entry with default
values for all properties. It doesn't extract metadata from the file
because in many cases that isn't the right thing to do, or it just
isn't possible (DAAP, online stores, audio CDs, etc.).

'"file://" + path' will not create valid URIs for all file paths. I'm
not sure what you're supposed to use in python, but in c, use
g_filename_to_uri.

> I want Rhythmbox to (recognise the file as an mp3 file and) find tags,
> and mimetype x-id3... how can I achieve this?

Use rhythmdb_add_uri_with_types. This imports the given URI
(recursively, if it's a directory), including extracting metadata,
creating entries of the type you specify.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]