cc-4105: added better logging for replaygain updater
This commit is contained in:
parent
420182465e
commit
78a15916c2
|
@ -47,6 +47,7 @@ class ReplayGainUpdater(Thread, Loggable):
|
||||||
try:
|
try:
|
||||||
# keep getting few rows at a time for current music_dir (stor
|
# keep getting few rows at a time for current music_dir (stor
|
||||||
# or watched folder).
|
# or watched folder).
|
||||||
|
total = 0
|
||||||
while True:
|
while True:
|
||||||
# return a list of pairs where the first value is the
|
# return a list of pairs where the first value is the
|
||||||
# file's database row id and the second value is the
|
# file's database row id and the second value is the
|
||||||
|
@ -59,6 +60,7 @@ class ReplayGainUpdater(Thread, Loggable):
|
||||||
|
|
||||||
self.api_client.update_replay_gain_values(processed_data)
|
self.api_client.update_replay_gain_values(processed_data)
|
||||||
if len(files) == 0: break
|
if len(files) == 0: break
|
||||||
|
self.logger.info("Processed: %d songs" % total)
|
||||||
|
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
self.logger.error(e)
|
self.logger.error(e)
|
||||||
|
@ -66,6 +68,7 @@ class ReplayGainUpdater(Thread, Loggable):
|
||||||
def run(self):
|
def run(self):
|
||||||
try:
|
try:
|
||||||
while True:
|
while True:
|
||||||
|
self.logger.info("Runnning replaygain updater")
|
||||||
self.main()
|
self.main()
|
||||||
# Sleep for 5 minutes in case new files have been added
|
# Sleep for 5 minutes in case new files have been added
|
||||||
time.sleep(60 * 5)
|
time.sleep(60 * 5)
|
||||||
|
|
|
@ -56,6 +56,7 @@ except Exception as e:
|
||||||
watch_syncer = WatchSyncer(signal='watch',
|
watch_syncer = WatchSyncer(signal='watch',
|
||||||
chunking_number=config['chunking_number'],
|
chunking_number=config['chunking_number'],
|
||||||
timeout=config['request_max_wait'])
|
timeout=config['request_max_wait'])
|
||||||
|
|
||||||
ReplayGainUpdater.start_reply_gain()
|
ReplayGainUpdater.start_reply_gain()
|
||||||
|
|
||||||
apiclient = apc.AirtimeApiClient.create_right_config(log=log,
|
apiclient = apc.AirtimeApiClient.create_right_config(log=log,
|
||||||
|
|
Loading…
Reference in New Issue