# Class e.c.c.m.MetadataProvider(Component):

Part of elisa.core.components.metadata_provider View In Hierarchy

Known subclasses: elisa.core.tests.test_metadata_provider.BarMetadataProvider, elisa.core.tests.test_metadata_provider.FooMetadataProvider, elisa.plugins.album_art.covercache_metadata.CoverCache, elisa.plugins.album_art.coverindir_metadata.CoverInDir, elisa.plugins.gstreamer.gst_metadata.GstMetadata, elisa.plugins.gstreamer.gst_metadata.GstMetadataFast, elisa.plugins.gstreamer.pb_client.GstMetadataPBClient, elisa.plugins.media_db.db_metadata.DbMetadata

Metadata (ID3 tags, EXIF information, ...) can be extracted from medias using different ways. This base component is meant to provide the developer some nice ways to extend Elisa's metadata parsing framework.

All MetadataProviders are handled by the `elisa.core.metadata_manager.MetadataManager` manager.

A MetadataProvider must be able to :

- provide a rank between 0 (highest) and 255
- check if it is able to handle a given dict

TODO:

- we need a way to rank the metadataproviders

Line # | Kind | Name | Docs
--- | --- | --- | ---
50 | Method | get_rank | Rank determining wether the parser should be prioritized.
61 | Method | able_to_handle | Return wether this provider is able to fill in metadata, when it
71 | Method | get_metadata | Retrieve the metadata for this metadata request and put it in

Inherited from Component:

Line # | Kind | Name | Docs
--- | --- | --- | ---
85 | Class | PathDescriptor | Undocumented
97 | Class Method | create | Create and initialize the component.
130 | Method | initialize | Initialize the component.
142 | Method | clean | Clean the component.

Inherited from Loggable (via Component):

Line # | Kind | Name | Docs
--- | --- | --- | ---
81 | Method | __init__ | Undocumented

def get_rank(self):
overridden in elisa.core.tests.test_metadata_provider.BarMetadataProvider, elisa.core.tests.test_metadata_provider.FooMetadataProvider, elisa.plugins.album_art.covercache_metadata.CoverCache, elisa.plugins.album_art.coverindir_metadata.CoverInDir, elisa.plugins.gstreamer.gst_metadata.GstMetadata, elisa.plugins.gstreamer.gst_metadata.GstMetadataFast, elisa.plugins.gstreamer.pb_client.GstMetadataPBClient, elisa.plugins.media_db.db_metadata.DbMetadata
Rank determining wether the parser should be prioritized.

Returns | the rank as integer between 0 and 255 (type: integer )
Unknown Field: todo | We need a better System here so that the developers can decide which one to use

def able_to_handle(self, metadata):
overridden in elisa.core.tests.test_metadata_provider.BarMetadataProvider, elisa.core.tests.test_metadata_provider.FooMetadataProvider, elisa.plugins.album_art.covercache_metadata.CoverCache, elisa.plugins.album_art.coverindir_metadata.CoverInDir, elisa.plugins.gstreamer.gst_metadata.GstMetadata, elisa.plugins.gstreamer.gst_metadata.GstMetadataFast, elisa.plugins.gstreamer.pb_client.GstMetadataPBClient, elisa.plugins.media_db.db_metadata.DbMetadata
Return wether this provider is able to fill in metadata, when it gets this metadata dictionary.

Parameters | metadata | a dictionary containing all known and requested metadata (type: dict )
Returns | (type: bool )

def get_metadata(self, metadata, low_priority=False):
overridden in elisa.core.tests.test_metadata_provider.BarMetadataProvider, elisa.core.tests.test_metadata_provider.FooMetadataProvider, elisa.plugins.album_art.covercache_metadata.CoverCache, elisa.plugins.album_art.coverindir_metadata.CoverInDir, elisa.plugins.gstreamer.gst_metadata.GstMetadata, elisa.plugins.gstreamer.gst_metadata.GstMetadataFast, elisa.plugins.gstreamer.pb_client.GstMetadataPBClient, elisa.plugins.media_db.db_metadata.DbMetadata
Retrieve the metadata for this metadata request and put it in there.

Parameters | metadata | a dictionary containing all the known and requested metadata, which is also filled with the new data (type: dict )
Returns | (type: `twisted.internet.defer.Deferred` )
Unknown Field: todo | determine all the keys returned for each content-type.