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

@ -25,7 +25,7 @@ class ApiController extends Zend_Controller_Action
}
/**
* Returns Airtime version. i.e "1.7.0 alpha"
* Returns Airtime version. i.e "1.7.0-beta"
*
* First checks to ensure the correct API key was
* supplied, then returns AIRTIME_VERSION as defined

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)

View File

@ -113,6 +113,7 @@ class AirtimeMetadata:
except Exception, e:
self.logger.error("failed getting metadata from %s", filepath)
self.logger.error("Exception %s", e)
return None

View File

@ -289,7 +289,7 @@ class AirtimeProcessEvent(ProcessEvent):
if self.is_parent_directory(event.pathname, storage_directory):
file_md = self.md_manager.get_md_from_file(event.pathname)
if file_md is not None:
filepath, is_recorded_show = self.create_file_path(event.pathname)
filepath, is_recorded_show = self.create_file_path(event.pathname, file_md)
self.move_file(event.pathname, filepath)
self.renamed_files[event.pathname] = filepath
self.file_events.append({'mode': self.config.MODE_CREATE, 'filepath': filepath, 'data': file_md, 'is_recorded_show': False})