CC-430: Audio normalization (Replaygain Support)
-small bug fixes
This commit is contained in:
parent
583695f98c
commit
ce1a63f47d
|
@ -976,6 +976,7 @@ class ApiController extends Zend_Controller_Action
|
|||
$file = Application_Model_StoredFile::Recall($p_id = $id)->getPropelOrm();
|
||||
Logging::log("Setting $gain for file id $id");
|
||||
$file->setDbReplayGain($gain);
|
||||
$file->save();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -42,21 +42,17 @@ class ReplayGainUpdater(Thread):
|
|||
# return a list of pairs where the first value is the file's database row id
|
||||
# and the second value is the filepath
|
||||
files = self.api_client.get_files_without_replay_gain_value(dir_id)
|
||||
self.logger.debug(files)
|
||||
|
||||
for f in files:
|
||||
full_path = os.path.join(dir_path, f['fp'])
|
||||
processed_data.append((f['id'], replaygain.calculate_replay_gain(full_path)))
|
||||
|
||||
#finished = (len(files) == 0)
|
||||
finished = True
|
||||
|
||||
#send data here
|
||||
self.api_client.update_replay_gain_values(processed_data)
|
||||
print processed_data
|
||||
finished = (len(files) == 0)
|
||||
|
||||
except Exception, e:
|
||||
print e
|
||||
print traceback.format_exc()
|
||||
self.logger.error(e)
|
||||
self.logger.debug(traceback.format_exc())
|
||||
def run(self):
|
||||
try: self.main()
|
||||
except Exception, e:
|
||||
|
@ -66,7 +62,7 @@ class ReplayGainUpdater(Thread):
|
|||
if __name__ == "__main__":
|
||||
try:
|
||||
rgu = ReplayGainUpdater(logging)
|
||||
print rgu.main()
|
||||
rgu.main()
|
||||
except Exception, e:
|
||||
print e
|
||||
print traceback.format_exc()
|
||||
|
|
Loading…
Reference in New Issue