Merge branch 'devel' of dev.sourcefabric.org:airtime into devel

This commit is contained in:
martin 2011-07-19 12:07:41 -04:00
commit 0e3bae4b5c
5 changed files with 49 additions and 37 deletions

View File

@ -151,6 +151,7 @@ class LibraryController extends Zend_Controller_Action
return;
}
else {
$res = settype($res, "integer");
$data = array("filepath" => $file->getFilePath(), "delete" => $res);
RabbitMq::SendMessageToMediaMonitor("file_delete", $data);
}

View File

@ -56,7 +56,7 @@ class ScheduleGroup {
// Check if there are any conflicts with existing entries
$metadata = $track->getMetadata();
$length = trim($metadata["length"]);
$length = $metadata['MDATA_KEY_DURATION'];
if (empty($length)) {
return new PEAR_Error("Length is empty.");
}

View File

@ -318,6 +318,13 @@ class StoredFile {
Playlist::DeleteFileFromAllPlaylists($this->getId());
$this->_file->delete();
if (isset($res)) {
return $res;
}
else {
return false;
}
}
/**

View File

@ -91,7 +91,7 @@ class AirtimeMediaMonitorBootstrap():
for file_path in new_files:
if len(file_path.strip(" \n")) > 0:
new_and_modified_files.add(file_path[len(dir)+1:])
new_and_modified_files.add(file_path[len(dir):])
"""
new_and_modified_files gives us a set of files that were either copied or modified
@ -114,15 +114,19 @@ class AirtimeMediaMonitorBootstrap():
self.mmc.touch_index_file()
for file_path in deleted_files_set:
self.pe.handle_removed_file(False, "%s/%s" % (dir, file_path))
self.pe.handle_removed_file(False, "%s%s" % (dir, file_path))
deleted_files_set.clear()
for file_path in new_files_set:
file_path = "%s/%s" % (dir, file_path)
file_path = "%s%s" % (dir, file_path)
if os.path.exists(file_path):
self.pe.handle_created_file(False, os.path.basename(file_path), file_path)
new_files_set.clear()
for file_path in modified_files_set:
file_path = "%s/%s" % (dir, file_path)
file_path = "%s%s" % (dir, file_path)
if os.path.exists(file_path):
self.pe.handle_modified_file(False, os.path.basename(file_path), file_path)
modified_files_set.clear()

View File

@ -112,7 +112,7 @@ class AirtimeNotifier(Notifier):
self.logger.info("Adding file to ignore: %s ", filepath)
mm.add_filepath_to_ignore(filepath)
if m['delete'] == "true":
if m['delete']:
self.logger.info("Deleting file: %s ", filepath)
os.unlink(filepath)