diff --git a/airtime_mvc/application/controllers/ApiController.php b/airtime_mvc/application/controllers/ApiController.php index c22e63d55..94cb7e518 100644 --- a/airtime_mvc/application/controllers/ApiController.php +++ b/airtime_mvc/application/controllers/ApiController.php @@ -901,7 +901,7 @@ class ApiController extends Zend_Controller_Action foreach ($data as $pair) { list($id, $gain) = $pair; - + // TODO : move this code into model -- RG $file = Application_Model_StoredFile::Recall($p_id = $id)->getPropelOrm(); $file->setDbReplayGain($gain); $file->save(); diff --git a/python_apps/media-monitor2/media/monitor/metadata.py b/python_apps/media-monitor2/media/monitor/metadata.py index 22968fcf0..36a02e097 100644 --- a/python_apps/media-monitor2/media/monitor/metadata.py +++ b/python_apps/media-monitor2/media/monitor/metadata.py @@ -178,14 +178,19 @@ class Metadata(Loggable): return # TODO : Simplify the way all of these rules are handled right not it's # extremely unclear and needs to be refactored. - if full_mutagen is None: raise BadSongFile(fpath) + #if full_mutagen is None: raise BadSongFile(fpath) + if full_mutagen is None: full_mutagen = {} self.__metadata = Metadata.airtime_dict(full_mutagen) # Now we extra the special values that are calculated from the mutagen # object itself: for special_key,f in airtime_special.iteritems(): - new_val = f(full_mutagen) - if new_val is not None: - self.__metadata[special_key] = new_val + try: + new_val = f(full_mutagen) + if new_val is not None: + self.__metadata[special_key] = new_val + except Exception: + self.logger.info("Could not get special key %s for %d" % + special_key, fpath) # Finally, we "normalize" all the metadata here: self.__metadata = mmp.normalized_metadata(self.__metadata, fpath) # Now we must load the md5: