Part of elisa.core.media_manager View In Hierarchy
Provides access to files through the use of MediaProvider components
which allows to handle different file I/O protocols using URIs. It also
handles caching in a database and the monitoring of files via the
elisa.core.media_scanner.MediaScanner
.
Instance Variables | media_scanner | the component which scans media sources and keep the database up to
date
(type: elisa.core.media_scanner.MediaScanner
) |
Line # | Kind | Name | Docs |
---|---|---|---|
155 | Method | __init__ | Initialize media_providers instance variable and try to |
166 | Method | start | Load all enabled MediaProvider components using the |
178 | Method | stop | Stop the media_scanner if it's running and clean all |
187 | Method | register_component | Register a new Component |
200 | Method | unregister_component | Unregister a component from the Manager |
212 | Method | get_metadata | just a proxy to the metadata_manager.get_metadata |
247 | Method | is_scannable | Undocumented |
274 | Method | get_media_type | Try to guess the maximum information from the media located |
293 | Method | blocking_get_media_type | Undocumented |
296 | Method | is_directory | return True if a directory |
306 | Method | blocking_is_directory | Undocumented |
309 | Method | has_children_with_types | Detect whether the given uri has children for given media |
323 | Method | blocking_has_children_with_types | Undocumented |
327 | Method | get_direct_children | Scan the data located at given uri and return a deferred. |
349 | Method | blocking_get_direct_children | Undocumented |
353 | Method | open | Open an uri and return MediaFile file if the block keyword |
368 | Method | blocking_open | Undocumented |
371 | Method | next_location | Return the uri just next to given uri and record it to history |
398 | Method | blocking_next_location | Undocumented |
410 | Method | previous_location | Return the uri found before given uri |
421 | Method | blocking_previous_location | Undocumented |
424 | Method | monitor_uri | Start monitoring given uri for modification and call a |
443 | Method | unmonitor_uri | Stop monitoring given uri. |
452 | Method | uri_is_monitorable | Check if the uri is monitorable for modification |
463 | Method | uri_is_monitored | Check if the uri is currently monitored for modification |
475 | Method | copy | Copy one location to another. If both URIs represent a |
495 | Method | move | Move data located at given URI to another URI. If orig_uri |
512 | Method | delete | Delete a resource located at given URI. If that URI represents |
529 | Method | get_real_uri | Returns the original uri (reachable) from a virtual |
Inherited from Manager:
Line # | Kind | Name | Docs |
---|---|---|---|
63 | Method | load_components | Load a list of components in sequence. |
Parameters | metadata_manager | The MetadataManager to use to create the MediaScanner
(type: elisa.core.metadata_manager.MetadataManager
) |
Parameters | seconds | time in seconds to wait before starting the scanner (type: int ) |
resume_scan | should the media_scanner resume interrupted scan at startup? (type: bool ) |
Register a new Component
Store a new Component in our components list. Returns the result of the operation. If the component is already registered, don't register it twice.Parameters | component | the Component to register
(type: elisa.core.component.Component
) |
Raises | AlreadyRegistered | when the component has already been registered |
TypeError | when the given component is *not* of the
type supported_components
|
Unregister a component from the Manager
Remove the Component instance from our components list if it's there. Returns the result of the operation.Parameters | component | the Component to register
(type: elisa.core.component.Component
) |
Raises | CannotUnregister | raised when the component cannot be removed |
{'file_type': string (values: one of media_provider.media_types, 'mime_type': string (example: 'audio/mpeg' for .mp3 uris. can be empty string if unguessable) }
Parameters | uri | the URI to analyze
(type: elisa.core.media_uri.MediaUri
) |
Returns | (type: twisted.internet.defer.Deferred
) |
Parameters | uri | the URI to analyze
(type: elisa.core.media_uri.MediaUri
) |
Returns | (type: bool ) |
Parameters | uri | the URI to scan
(type: elisa.core.media_uri.MediaUri
) |
media_types | the media_types to look for on the directory (type: list of strings ) | |
Returns | (type: twisted.internet.defer.Deferred
) |
Scan the data located at given uri and return a deferred. Fills children_with_info. Defferred is called when the gathering is finished with children_with_info as parameter Typemap of filled result: [ (uri : media_uri.MediaUri, additional info: dict), ... ] @param uri: the URI to analyze @type uri: L{elisa.core.media_uri.MediaUri} @param children_with_info: List where the children will be appended @type children_with_info: list @rtype: twisted.internet.deferred
Parameters | uri | the URI to open
(type: elisa.core.media_uri.MediaUri
) |
mode | how to open the file -- see manual of builtin open() (type: string or None ) | |
Returns | (type: elisa.core.media_file.MediaFile
) |
Parameters | uri | the URI representing the file or directory from where to move on
(type: elisa.core.media_uri.MediaUri
) |
root | root URI
(type: elisa.core.media_uri.MediaUri
) | |
Returns | (type: elisa.core.media_uri.MediaUri
) |
Parameters | uri | the URI representing the file or directory prior to uri
(type: elisa.core.media_uri.MediaUri
) |
Returns | (type: elisa.core.media_uri.MediaUri
) |
Parameters | uri | URI representing the file or directory to monitor
(type: elisa.core.media_uri.MediaUri
) |
extra_args | extra positional arguments to pass to the callback (type: tuple ) | |
callback | a callable taking the event that occured and the uri of the file on
which the event applies to prototype: callable(uri, event) type uri: elisa.core.media_uri.MediaUri
type event:
elisa.core.components.media_provider.NotifyEvent
|
Parameters | uri | the URI representing the file or directory to monitor
(type: elisa.core.media_uri.MediaUri
) |
Parameters | uri | the URI representing the file or directory for which we would like to
know if it is monitorable or not
(type: elisa.core.media_uri.MediaUri
) |
Returns | (type: bool ) |
Parameters | uri | the URI representing the file or directory for which we would like to
know if it is currently monitored or not
(type: elisa.core.media_uri.MediaUri
) |
Returns | (type: bool ) |
Parameters | orig_uri | the URI to copy, can represent either a directory or a file
(type: elisa.core.media_uri.MediaUri
) |
dest_uri | the destination URI, can represent either a directory or a file
(type: elisa.core.media_uri.MediaUri
) | |
recursive | if orig_uri represents a directory, should I copy it recursively to dest_uri? (type: bool ) | |
Returns | (type: bool ) |
Parameters | orig_uri | the URI to move, can represent either a directory or a file
(type: elisa.core.media_uri.MediaUri
) |
dest_uri | the destination URI, can represent either a directory or a file
(type: elisa.core.media_uri.MediaUri
) | |
Returns | (type: bool ) |
Parameters | uri | the URI representing the file or directory for which we would like to
know if it is currently monitored or not
(type: elisa.core.media_uri.MediaUri
) |
recursive | if orig_uri represents a directory, should I copy it recursively to dest_uri? (type: bool ) | |
Returns | (type: bool ) |
Parameters | uri | the URI to validate
(type: elisa.core.media_uri.MediaUri
) |
Returns | (type: elisa.core.media_uri.MediaUri
) |