RB.MetaData

g GObject.Object GObject.Object RB.MetaData RB.MetaData GObject.Object->RB.MetaData

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

get_field_name (field)

class

get_field_type (field)

class

new ()

can_save (media_type)

get (field)

get_media_type ()

get_missing_plugins ()

get_saveable_types ()

has_audio ()

has_missing_plugins ()

has_other_data ()

has_video ()

load (uri)

reset ()

save (uri)

set (field, val)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

None

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent

GObject.Object

r

Class Details

class RB.MetaData(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

RB.MetaDataClass

classmethod get_field_name(field)
Parameters:

field (RB.MetaDataField) – a RB.MetaDataField

Returns:

field name

Return type:

str

Returns the name of a metadata field.

classmethod get_field_type(field)
Parameters:

field (RB.MetaDataField) – a RB.MetaDataField

Returns:

value type

Return type:

GObject.GType

Returns the GObject.GType of the value for a metadata field.

classmethod new()
Returns:

new RB.MetaData instance

Return type:

RB.MetaData

Creates a new metadata backend instance.

can_save(media_type)
Parameters:

media_type (str) – the media type string to check

Returns:

True if the file metadata for the given media type can be updated

Return type:

bool

Checks if the metadata writer is capable of updating file metadata for a given media type.

get(field)
Parameters:

field (RB.MetaDataField) – the RB.MetaDataField to retrieve

Returns:

True if a value was returned

val:

returns the field value

Return type:

(bool, val: GObject.Value)

Retrieves the value of a metadata field extracted from the target URI. If the target URI contained no value for the field, returns False.

get_media_type()
Returns:

media type string

Return type:

str

Returns the type of the file from which metadata was read. This may look like a MIME type, but it isn’t.

get_missing_plugins()
Returns:

True if missing plugin information was returned

missing_plugins:

returns machine-readable missing plugin information

plugin_descriptions:

returns human-readable missing plugin descriptions

Return type:

(bool, missing_plugins: [str], plugin_descriptions: [str])

This function returns the information used to request automatic installation of media framework plugins required to decode the target URI. Use GLib.strfreev() to free the returned information arrays.

get_saveable_types()
Returns:

a None-terminated array of media type strings. Use GLib.strfreev to free it.

Return type:

[str]

Constructs a list of the media types for which the metadata backend implements tag saving.

has_audio()
Return type:

bool

has_missing_plugins()
Returns:

True if required plugins are missing

Return type:

bool

If the metadata reader could not decode the file it was asked to because one or more media framework plugins (specifically, for the existing implementations, GStreamer plugins) required are missing, this will return True.

has_other_data()
Return type:

bool

has_video()
Return type:

bool

load(uri)
Parameters:

uri (str) – URI from which to load metadata

Raises:

GLib.Error

Reads metadata information from the specified URI. Once this has returned successfully (with *error == None), RB.MetaData.get, RB.MetaData.get_media_type, RB.MetaData.has_missing_plugins, and RB.MetaData.get_missing_plugins can usefully be called.

reset()

Resets the state of the metadata interface. Call this before setting tags to be written to a file.

save(uri)
Parameters:

uri (str) – the target URI

Raises:

GLib.Error

Saves all metadata changes made with RB.MetaData.set to the target URI.

set(field, val)
Parameters:
Returns:

True if the field is valid

Return type:

bool

Sets a metadata field value. The value is only stored inside the RB.MetaData object until RB.MetaData.save is called.