added perliminary stuff for emf

This commit is contained in:
Rudi Grinberg 2012-10-09 12:25:40 -04:00
parent db913f9e61
commit cad6a7e7b0
1 changed files with 10 additions and 0 deletions

View File

@ -185,6 +185,15 @@ class Metadata(Loggable):
# TODO : Simplify the way all of these rules are handled right now it's
# extremely unclear and needs to be refactored.
#if full_mutagen is None: raise BadSongFile(fpath)
try: # emf stuff for testing:
import media.metadata.process as md
import pprint.pformat as pf
if full_mutagen:
normalized = md.global_reader.read('fpath', full_mutagen)
self.logger.info(pf(normalized))
except Exception as e:
self.logger.unexpected_exception(e)
if full_mutagen is None: full_mutagen = FakeMutagen(fpath)
self.__metadata = Metadata.airtime_dict(full_mutagen)
# Now we extra the special values that are calculated from the mutagen
@ -209,6 +218,7 @@ class Metadata(Loggable):
# from the file?
self.__metadata['MDATA_KEY_MD5'] = mmp.file_md5(fpath,max_length=100)
def is_recorded(self):
"""
returns true if the file has been created by airtime through recording