cc-2419: media monitor import on startup

-fixed syntax errors, added more logging.
This commit is contained in:
martin 2011-07-04 15:40:09 -04:00
parent ddb5e8e383
commit c67e711a05
4 changed files with 6 additions and 5 deletions

View file

@ -59,10 +59,10 @@ class AirtimeMediaMonitorBootstrap():
all_files_set.add(file_path)
if os.path.exists("/var/tmp/airtime/media_monitor_boot"):
if os.path.exists("/var/tmp/airtime/.media_monitor_boot"):
#find files that have been modified since the last time
#media-monitor process started.
time_diff_sec = time.time() - os.path.getmtime("/var/tmp/airtime/media_monitor_boot")
time_diff_sec = time.time() - os.path.getmtime("/var/tmp/airtime/.media_monitor_boot")
command = "find %s -type f -iname '*.ogg' -o -iname '*.mp3' -readable -mmin -%d" % (dir, time_diff_sec/60+1)
else:
command = "find %s -type f -iname '*.ogg' -o -iname '*.mp3' -readable" % dir
@ -91,7 +91,7 @@ class AirtimeMediaMonitorBootstrap():
self.logger.info("Modified files: \n%s\n\n"%modified_files_set)
#"touch" file timestamp
open("/var/tmp/airtime/media_monitor_boot","w")
open("/var/tmp/airtime/.media_monitor_boot","w")
for file_path in deleted_files_set:
self.pe.handle_removed_file(file_path)