RB.RhythmDBEntryType

g GObject.Object GObject.Object RB.RhythmDBEntryType RB.RhythmDBEntryType GObject.Object->RB.RhythmDBEntryType

Subclasses:

RB.MediaPlayerEntryType

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

fetch_metadata (uri, metadata)

get_name ()

purge_metadata_cache (prefix, max_age)

Virtual Methods

Inherited:

GObject.Object (7)

do_cache_key_to_uri (key)

do_can_sync_metadata (entry)

do_destroy_entry (entry)

do_entry_created (entry)

do_get_playback_uri (entry)

do_update_availability (entry, avail)

do_uri_to_cache_key (uri)

Properties

Name

Type

Flags

Short Description

cache-name

str

r/w/co

metadata cache name

category

RB.RhythmDBEntryCategory

r/w/co

RB.RhythmDBEntryCategory for the entry type

db

RB.RhythmDB

r/w/co

RB.RhythmDB instance

name

str

r/w/co

entry type name

save-to-disk

bool

r/w/co

whether to save this type of entry to disk

type-data-size

int

r/w/co

size of entry type specific data

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent

GObject.Object

r

Class Details

class RB.RhythmDBEntryType(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

RB.RhythmDBEntryTypeClass

fetch_metadata(uri, metadata)
Parameters:
Returns:

True if metadata is returned

Return type:

bool

Fetches metadata for a URI (not an entry yet, at this point) from a cache, if possible.

The metadata array contains RB.RhythmDBEntryChange items with just the ‘new’ value set.

get_name()
Returns:

entry type name

Return type:

str

Returns the name of the entry type

purge_metadata_cache(prefix, max_age)
Parameters:
  • prefix (str) – a cache key prefix to scan

  • max_age (int) – maximum age of missing entries to keep

do_cache_key_to_uri(key) virtual
Parameters:

key (str) –

Return type:

str

do_can_sync_metadata(entry) virtual
Parameters:

entry (RB.RhythmDBEntry) –

Return type:

bool

do_destroy_entry(entry) virtual
Parameters:

entry (RB.RhythmDBEntry) –

do_entry_created(entry) virtual
Parameters:

entry (RB.RhythmDBEntry) –

do_get_playback_uri(entry) virtual
Parameters:

entry (RB.RhythmDBEntry) –

Return type:

str

do_update_availability(entry, avail) virtual
Parameters:
do_uri_to_cache_key(uri) virtual
Parameters:

uri (str) –

Return type:

str

Property Details

RB.RhythmDBEntryType.props.cache_name
Name:

cache-name

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

Metadata cache name. For entry types created by a plugin, should match the plugin name. If this is set, the entry type must also implement the uri_to_cache_key method.

RB.RhythmDBEntryType.props.category
Name:

category

Type:

RB.RhythmDBEntryCategory

Default Value:

RB.RhythmDBEntryCategory.NORMAL

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

The RB.RhythmDBEntryCategory that this entry type fits into.

RB.RhythmDBEntryType.props.db
Name:

db

Type:

RB.RhythmDB

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

The RB.RhythmDB instance.

RB.RhythmDBEntryType.props.name
Name:

name

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

Entry type name. This must be unique.

RB.RhythmDBEntryType.props.save_to_disk
Name:

save-to-disk

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

If True, entries of this type should be written to the on-disk database.

RB.RhythmDBEntryType.props.type_data_size
Name:

type-data-size

Type:

int

Default Value:

0

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

The size of the type-specific data structure to allocate for each entry of this type.