RB.ExtDB

g GObject.Object GObject.Object RB.ExtDB RB.ExtDB GObject.Object->RB.ExtDB

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new (name)

delete (key)

lookup (key)

request (key, callback, *user_data)

store (key, source_type, data)

store_raw (key, source_type, data)

store_uri (key, source_type, uri)

Virtual Methods

Inherited:

GObject.Object (7)

do_added (key, filename, data)

do_load (data)

do_request (key, last_time)

do_store (data)

Properties

Name

Type

Flags

Short Description

name

str

r/w/co

name

Signals

Inherited:

GObject.Object (1)

Name

Short Description

added

Emitted when metadata is added to the store.

load

Emitted when loading a metadata item from a local file or from a URI.

request

Emitted when a metadata request cannot be satisfied from the local store.

store

Emitted when a metadata item needs to be written to a local file.

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent

GObject.Object

r

Class Details

class RB.ExtDB(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

RB.ExtDBClass

classmethod new(name)
Parameters:

name (str) – name of the metadata store

Returns:

named metadata store instance

Return type:

RB.ExtDB

Provides access to a metadata store instance.

delete(key)
Parameters:

key (RB.ExtDBKey) – metadata storage key

Deletes the item stored in the metadata store under the specified storage key.

lookup(key)
Parameters:

key (RB.ExtDBKey) – metadata lookup key

Returns:

name of the file storing the cached metadata item

store_key:

optionally returns the matching storage key

Return type:

(str, store_key: RB.ExtDBKey)

Looks up a cached metadata item.

request(key, callback, *user_data)
Parameters:
Returns:

True if results may be provided after returning

Return type:

bool

Requests a metadata item. If the item is cached, the callback will be called synchronously. Otherwise, metadata providers will provide results asynchronously.

store(key, source_type, data)
Parameters:

Stores an item in the metadata store so that lookups matching key will return it. data should contain an object that must be transformed using the RB.ExtDB ::store signal before being stored. For example, the album art cache expects GdkPixbuf.Pixbuf objects here, rather than buffers containing JPEG encoded files.

store_raw(key, source_type, data)
Parameters:

Stores an item in the metadata store so that lookpus matching key will return it. data should contain the data to be written to the store, either as a string or as a GLib.ByteArray.

store_uri(key, source_type, uri)
Parameters:

Stores an item identified by uri in the metadata store so that lookups matching key will return it.

do_added(key, filename, data) virtual
Parameters:
do_load(data) virtual
Parameters:

data (GObject.Value) –

Return type:

GObject.Value

do_request(key, last_time) virtual
Parameters:
Return type:

bool

do_store(data) virtual
Parameters:

data (GObject.Value) –

Return type:

GObject.Value

Signal Details

RB.ExtDB.signals.added(ext_d_b, key, filename, data)
Signal Name:

added

Flags:

RUN_LAST

Parameters:

Emitted when metadata is added to the store. Metadata consumers can use this to process metadata they did not specifically request, for example to update album art stored on an attached media player.

RB.ExtDB.signals.load(ext_d_b, data)
Signal Name:

load

Flags:

RUN_LAST

Parameters:
  • ext_d_b (RB.ExtDB) – The object which received the signal

  • data (GObject.Value) – the data being loaded

Returns:

converted value

Return type:

object or None

Emitted when loading a metadata item from a local file or from a URI.

RB.ExtDB.signals.request(ext_d_b, key, last_time)
Signal Name:

request

Flags:

RUN_LAST

Parameters:
  • ext_d_b (RB.ExtDB) – The object which received the signal

  • key (RB.ExtDBKey) – the RB.ExtDBKey that was requested

  • last_time (int) – the last time this item was requested

Return type:

bool

Emitted when a metadata request cannot be satisfied from the local store. Metadata providers initiate searches in response to this signal.

RB.ExtDB.signals.store(ext_d_b, data)
Signal Name:

store

Flags:

RUN_LAST

Parameters:
  • ext_d_b (RB.ExtDB) – The object which received the signal

  • data (GObject.Value) – the data being stored

Returns:

the value to write to a file

Return type:

object or None

Emitted when a metadata item needs to be written to a local file. This only needs to be used for metadata that needs to be encoded or compressed, such as images.

Property Details

RB.ExtDB.props.name
Name:

name

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

Name of the metadata store. Used to locate instances.