RB.ExtDB¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
|
|
|
|
|
|
|
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w/co |
name |
Signals¶
- Inherited:
Name |
Short Description |
---|---|
Emitted when metadata is added to the store. |
|
Emitted when loading a metadata item from a local file or from a URI. |
|
Emitted when a metadata request cannot be satisfied from the local store. |
|
Emitted when a metadata item needs to be written to a local file. |
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent |
r |
Class Details¶
- class RB.ExtDB(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
- classmethod new(name)¶
- Parameters:
name (
str
) – name of the metadata store- Returns:
named metadata store instance
- Return type:
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:
key (
RB.ExtDBKey
) – metadata lookup keycallback (
RB.ExtDBRequestCallback
) – callback to call with resultsuser_data (
object
orNone
) – user data to pass to the callback
- Returns:
True
if results may be provided after returning- Return type:
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:
key (
RB.ExtDBKey
) – metadata storage keysource_type (
RB.ExtDBSourceType
) – metadata source typedata (
GObject.Value
orNone
) – data to store
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 expectsGdkPixbuf.Pixbuf
objects here, rather than buffers containing JPEG encoded files.
- store_raw(key, source_type, data)¶
- Parameters:
key (
RB.ExtDBKey
) – metadata storage keysource_type (
RB.ExtDBSourceType
) – metadata source typedata (
GObject.Value
orNone
) – data to store
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:
key (
RB.ExtDBKey
) – metadata storage keysource_type (
RB.ExtDBSourceType
) – metadata source type
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:
key (
RB.ExtDBKey
) –filename (
str
) –data (
GObject.Value
) –
- do_load(data) virtual¶
- Parameters:
data (
GObject.Value
) –- Return type:
- do_request(key, last_time) virtual¶
- Parameters:
key (
RB.ExtDBKey
) –last_time (
int
) –
- Return type:
- do_store(data) virtual¶
- Parameters:
data (
GObject.Value
) –- Return type:
Signal Details¶
- RB.ExtDB.signals.added(ext_d_b, key, filename, data)¶
- Signal Name:
added
- Flags:
- Parameters:
ext_d_b (
RB.ExtDB
) – The object which received the signalkey (
RB.ExtDBKey
) – theRB.ExtDBKey
that was addedfilename (
str
) – the filename for the item that was addeddata (
GObject.Value
) – the value that was stored
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:
- Parameters:
ext_d_b (
RB.ExtDB
) – The object which received the signaldata (
GObject.Value
) – the data being loaded
- Returns:
converted value
- Return type:
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:
- Parameters:
ext_d_b (
RB.ExtDB
) – The object which received the signalkey (
RB.ExtDBKey
) – theRB.ExtDBKey
that was requestedlast_time (
int
) – the last time this item was requested
- Return type:
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:
- Parameters:
ext_d_b (
RB.ExtDB
) – The object which received the signaldata (
GObject.Value
) – the data being stored
- Returns:
the value to write to a file
- Return type:
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.