Merge branch 'devel' of dev.sourcefabric.org:airtime into devel
This commit is contained in:
commit
0e3bae4b5c
|
@ -151,6 +151,7 @@ class LibraryController extends Zend_Controller_Action
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
$res = settype($res, "integer");
|
||||||
$data = array("filepath" => $file->getFilePath(), "delete" => $res);
|
$data = array("filepath" => $file->getFilePath(), "delete" => $res);
|
||||||
RabbitMq::SendMessageToMediaMonitor("file_delete", $data);
|
RabbitMq::SendMessageToMediaMonitor("file_delete", $data);
|
||||||
}
|
}
|
||||||
|
|
|
@ -56,7 +56,7 @@ class ScheduleGroup {
|
||||||
|
|
||||||
// Check if there are any conflicts with existing entries
|
// Check if there are any conflicts with existing entries
|
||||||
$metadata = $track->getMetadata();
|
$metadata = $track->getMetadata();
|
||||||
$length = trim($metadata["length"]);
|
$length = $metadata['MDATA_KEY_DURATION'];
|
||||||
if (empty($length)) {
|
if (empty($length)) {
|
||||||
return new PEAR_Error("Length is empty.");
|
return new PEAR_Error("Length is empty.");
|
||||||
}
|
}
|
||||||
|
|
|
@ -318,6 +318,13 @@ class StoredFile {
|
||||||
|
|
||||||
Playlist::DeleteFileFromAllPlaylists($this->getId());
|
Playlist::DeleteFileFromAllPlaylists($this->getId());
|
||||||
$this->_file->delete();
|
$this->_file->delete();
|
||||||
|
|
||||||
|
if (isset($res)) {
|
||||||
|
return $res;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -91,7 +91,7 @@ class AirtimeMediaMonitorBootstrap():
|
||||||
|
|
||||||
for file_path in new_files:
|
for file_path in new_files:
|
||||||
if len(file_path.strip(" \n")) > 0:
|
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
|
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()
|
self.mmc.touch_index_file()
|
||||||
|
|
||||||
for file_path in deleted_files_set:
|
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:
|
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):
|
if os.path.exists(file_path):
|
||||||
self.pe.handle_created_file(False, os.path.basename(file_path), 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:
|
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):
|
if os.path.exists(file_path):
|
||||||
self.pe.handle_modified_file(False, os.path.basename(file_path), file_path)
|
self.pe.handle_modified_file(False, os.path.basename(file_path), file_path)
|
||||||
|
modified_files_set.clear()
|
||||||
|
|
||||||
|
|
|
@ -112,7 +112,7 @@ class AirtimeNotifier(Notifier):
|
||||||
self.logger.info("Adding file to ignore: %s ", filepath)
|
self.logger.info("Adding file to ignore: %s ", filepath)
|
||||||
mm.add_filepath_to_ignore(filepath)
|
mm.add_filepath_to_ignore(filepath)
|
||||||
|
|
||||||
if m['delete'] == "true":
|
if m['delete']:
|
||||||
self.logger.info("Deleting file: %s ", filepath)
|
self.logger.info("Deleting file: %s ", filepath)
|
||||||
os.unlink(filepath)
|
os.unlink(filepath)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue