RB.RhythmDBEntry

Fields

None

Methods

class

example_new (db, type, uri)

class

new (db, type, uri)

apply_cached_metadata (metadata)

cache_metadata ()

can_sync_metadata ()

create_ext_db_key (prop)

created ()

dup_string (propid)

get_boolean (propid)

get_double (propid)

get_entry_type ()

get_object (propid)

get_playback_uri ()

get_refstring (propid)

get_string (propid)

get_type_data (expected_size)

get_uint64 (propid)

get_ulong (propid)

is_lossless ()

pre_destroy ()

ref ()

sync_metadata (changes)

unref ()

update_availability (avail)

Details

class RB.RhythmDBEntry
classmethod example_new(db, type, uri)
Parameters:
Returns:

the newly created RB.RhythmDBEntry

Return type:

RB.RhythmDBEntry

Creates a new sample entry of type type and location uri, it does not insert it into the database. This is indended for use as a example entry.

This may return None if entry creation fails.

classmethod new(db, type, uri)
Parameters:
Returns:

the newly created RB.RhythmDBEntry

Return type:

RB.RhythmDBEntry

Creates a new entry of type type and location uri, and inserts it into the database. You must call RB.RhythmDB.commit() at some point after invoking this function.

This may return None if entry creation fails. This can occur if there is already an entry with the given uri.

apply_cached_metadata(metadata)
Parameters:

metadata ([RB.RhythmDBEntryChange]) – cached metadata to apply

Applies a set of metadata properties to self. The metadata should be in the form returned by rhythmdb_entry_type_fetch_metadata.

cache_metadata()

Stores metadata for self in the metadata cache (if any) for its entry type.

can_sync_metadata()
Returns:

True if the entry can be synced

Return type:

bool

Calls the entry type’s method to check if it can sync metadata for self. Usually this is only true for entries backed by files, where tag-writing is enabled, and the appropriate tag-writing facilities are available.

create_ext_db_key(prop)
Parameters:

prop (RB.RhythmDBPropType) – the primary RB.RhythmDBPropType for metadata lookups

Returns:

the new RB.ExtDBKey

Return type:

RB.ExtDBKey

Creates a RB.ExtDBKey for finding external metadata for a given property. This is mostly useful for finding album or track related data.

created()

Calls the entry type’s post-creation method for self.

dup_string(propid)
Parameters:

propid (RB.RhythmDBPropType) –

Return type:

str

get_boolean(propid)
Parameters:

propid (RB.RhythmDBPropType) – property to return

Returns:

property value

Return type:

bool

Returns the value of a boolean property of self.

get_double(propid)
Parameters:

propid (RB.RhythmDBPropType) – the property to return

Returns:

property value

Return type:

float

Returns the value of a double-precision floating point property of value.

get_entry_type()
Returns:

the RB.RhythmDBEntryType for self

Return type:

RB.RhythmDBEntryType

Returns the RB.RhythmDBEntryType for self. This is used to access entry type properties, to check that entries are of the same type, and to call entry type methods.

get_object(propid)
Parameters:

propid (RB.RhythmDBPropType) – the property to return

Returns:

property value

Return type:

GObject.Object

Returns the value of an object property of self.

get_playback_uri()
Returns:

playback URI or None

Return type:

str

Returns an allocated string containing the playback URI for self, or None if the entry cannot be played.

get_refstring(propid)
Parameters:

propid (RB.RhythmDBPropType) – the property to return

Returns:

a RB.RefString, must be unreffed by caller.

Return type:

RB.RefString

Returns an RB.RefString containing a string property of self.

get_string(propid)
Parameters:

propid (RB.RhythmDBPropType) – the RB.RhythmDBPropType to return

Returns:

property value, must not be freed

Return type:

str

Returns the value of a string property of #entry.

get_type_data(expected_size)
Parameters:

expected_size (int) – expected size of the type-specific data.

Returns:

type-specific data pointer

Return type:

object or None

Retrieves a pointer to the entry’s type-specific data, checking that the size of the data structure matches what is expected. Callers should use the RHYTHMDB_ENTRY_GET_TYPE_DATA macro for a slightly more friendly interface to this functionality.

get_uint64(propid)
Parameters:

propid (RB.RhythmDBPropType) – property to return

Returns:

property value

Return type:

int

Returns the value of a 64bit unsigned integer property.

get_ulong(propid)
Parameters:

propid (RB.RhythmDBPropType) – property to return

Returns:

property value

Return type:

int

Returns the value of an unsigned long integer property of self.

is_lossless()
Returns:

True if self is lossless

Return type:

bool

Checks if self represents a file that is losslessly encoded. An entry is considered lossless if it has no bitrate value and its media type is “audio/x-flac”. Other lossless encoding types may be added in the future.

pre_destroy()

Calls the entry type’s pre-deletion method for self.

ref()
Returns:

the entry

Return type:

RB.RhythmDBEntry

Increase the reference count of the entry.

sync_metadata(changes)
Parameters:

changes ([RB.RhythmDBEntryChange]) – a list of RB.RhythmDBEntryChange structures

Raises:

GLib.Error

Calls the entry type’s method to sync metadata changes for self.

unref()

Decrease the reference count of the entry, and destroys it if there are no references left.

update_availability(avail)
Parameters:

avail (RB.RhythmDBEntryAvailability) – an availability event

Updates self to reflect its new availability.