Package deefuzzer :: Package tools :: Module mediabase :: Class MediaBase
[hide private]
[frames] | no frames]

Class MediaBase

source code

object --+
         |
        MediaBase
Known Subclasses:

Base Media class. All media objects should inherit from this class to allow common functions to be used in core code. See MP3 and OGG classes for examples on how to configure a subclass.

Instance Methods [hide private]
 
__init__(self)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
get_format(self)
Gets the format string of the media type
source code
 
get_file_extension(self)
Gets the actual file extension string of the media
source code
 
get_mime_type(self)
Gets the MIME Type string for this media type
source code
 
get_description(self)
Gets the description string for this media type
source code
 
set_cache_dir(self, path)
Sets an alternate location for temporary cache files used in this media object
source code
 
get_file_metadata(self, clear_cache=False)
Returns the metadata for the media, filtered by the tagdata dictionary for this media type.
source code
 
read_file_metadata(self)
Reads the metadata for the media, filtered by the tagdata dictionary for this media type
source code
 
get_metadata_value(self, key, clean=False, clear_cache=False)
Returns a metadata value for a give key.
source code
 
get_title(self)
Returns the cleaned title for this media
source code
 
get_artist(self)
Returns the cleaned artist for this media
source code
 
get_song(self, usefn=True)
Returns a string in the form "artist - title" for this media.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

get_file_metadata(self, clear_cache=False)

source code 

Returns the metadata for the media, filtered by the tagdata dictionary for this media type. Return value is read from cache if possible (or unless clear_cache is set to True)

get_metadata_value(self, key, clean=False, clear_cache=False)

source code 

Returns a metadata value for a give key. If clean is True, then the resulting string will be cleaned before it is returned. If the key does not exist, an empty string is returned. Return value is read from cache if possible (or unless clear_cache is set to True)

get_song(self, usefn=True)

source code 

Returns a string in the form "artist - title" for this media. If either artist or title are blank, only the non-blank field is returned. If both fields are blank, and the usefn parameter is True, then the filename is returned instead. Otherwise, an empty string is returned.