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();
|
$file = Application_Model_StoredFile::Recall($p_id = $id)->getPropelOrm();
|
||||||
Logging::log("Setting $gain for file id $id");
|
Logging::log("Setting $gain for file id $id");
|
||||||
$file->setDbReplayGain($gain);
|
$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
|
# return a list of pairs where the first value is the file's database row id
|
||||||
# and the second value is the filepath
|
# and the second value is the filepath
|
||||||
files = self.api_client.get_files_without_replay_gain_value(dir_id)
|
files = self.api_client.get_files_without_replay_gain_value(dir_id)
|
||||||
self.logger.debug(files)
|
|
||||||
|
|
||||||
for f in files:
|
for f in files:
|
||||||
full_path = os.path.join(dir_path, f['fp'])
|
full_path = os.path.join(dir_path, f['fp'])
|
||||||
processed_data.append((f['id'], replaygain.calculate_replay_gain(full_path)))
|
processed_data.append((f['id'], replaygain.calculate_replay_gain(full_path)))
|
||||||
|
|
||||||
#finished = (len(files) == 0)
|
self.api_client.update_replay_gain_values(processed_data)
|
||||||
finished = True
|
finished = (len(files) == 0)
|
||||||
|
|
||||||
#send data here
|
|
||||||
self.api_client.update_replay_gain_values(processed_data)
|
|
||||||
print processed_data
|
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
print e
|
self.logger.error(e)
|
||||||
print traceback.format_exc()
|
self.logger.debug(traceback.format_exc())
|
||||||
def run(self):
|
def run(self):
|
||||||
try: self.main()
|
try: self.main()
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
|
@ -66,7 +62,7 @@ class ReplayGainUpdater(Thread):
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
try:
|
try:
|
||||||
rgu = ReplayGainUpdater(logging)
|
rgu = ReplayGainUpdater(logging)
|
||||||
print rgu.main()
|
rgu.main()
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
print e
|
print e
|
||||||
print traceback.format_exc()
|
print traceback.format_exc()
|
||||||
|
|
Loading…
Reference in New Issue