diff --git a/airtime_mvc/application/controllers/ApiController.php b/airtime_mvc/application/controllers/ApiController.php index 66ff34c22..95ca8a4e8 100644 --- a/airtime_mvc/application/controllers/ApiController.php +++ b/airtime_mvc/application/controllers/ApiController.php @@ -689,9 +689,12 @@ class ApiController extends Zend_Controller_Action { $request = $this->getRequest(); $dir_id = $request->getParam('dir_id'); + $all = $request->getParam('all'); + + Logging::info("All param is: $all"); $this->view->files = - Application_Model_StoredFile::listAllFiles($dir_id,$all=true); + Application_Model_StoredFile::listAllFiles($dir_id,$all); } public function listAllWatchedDirsAction() diff --git a/airtime_mvc/application/models/StoredFile.php b/airtime_mvc/application/models/StoredFile.php index 4d62bccb6..d84e74bd5 100644 --- a/airtime_mvc/application/models/StoredFile.php +++ b/airtime_mvc/application/models/StoredFile.php @@ -51,11 +51,6 @@ class Application_Model_StoredFile "owner_id" => "DbOwnerId" ); - public function __construct() - { - - } - public function getId() { return $this->_file->getDbId(); diff --git a/python_apps/api_clients/api_client.cfg b/python_apps/api_clients/api_client.cfg index fdd7c3b1b..efdcc763f 100644 --- a/python_apps/api_clients/api_client.cfg +++ b/python_apps/api_clients/api_client.cfg @@ -34,7 +34,7 @@ upload_recorded = 'upload-recorded/format/json/api_key/%%api_key%%/fileid/%%file update_media_url = 'reload-metadata/format/json/api_key/%%api_key%%/mode/%%mode%%' # URL to tell Airtime we want a listing of all files it knows about -list_all_db_files = 'list-all-files/format/json/api_key/%%api_key%%/dir_id/%%dir_id%%' +list_all_db_files = 'list-all-files/format/json/api_key/%%api_key%%/dir_id/%%dir_id%%/all/%%all%%' # URL to tell Airtime we want a listing of all dirs its watching (including the stor dir) list_all_watched_dirs = 'list-all-watched-dirs/format/json/api_key/%%api_key%%' diff --git a/python_apps/api_clients/api_client.py b/python_apps/api_clients/api_client.py index 983b59281..d2fbf23be 100644 --- a/python_apps/api_clients/api_client.py +++ b/python_apps/api_clients/api_client.py @@ -474,11 +474,12 @@ class AirtimeApiClient(): #{"files":["path/to/file1", "path/to/file2"]} #Note that these are relative paths to the given directory. The full #path is not returned. - def list_all_db_files(self, dir_id): + def list_all_db_files(self, dir_id, all_files=True): logger = self.logger try: url = self.construct_url("list_all_db_files") url = url.replace("%%dir_id%%", dir_id) + url = url.replace("%%all%%", all_files) response = self.get_response_from_server(url) response = json.loads(response) except Exception, e: @@ -488,7 +489,8 @@ class AirtimeApiClient(): try: return response["files"] except KeyError: - self.logger.error("Could not find index 'files' in dictionary: %s", str(response)) + self.logger.error("Could not find index 'files' in dictionary: %s", + str(response)) return [] def list_all_watched_dirs(self): diff --git a/python_apps/media-monitor2/media/monitor/airtime.py b/python_apps/media-monitor2/media/monitor/airtime.py index 208556f71..bb8f1dd9d 100644 --- a/python_apps/media-monitor2/media/monitor/airtime.py +++ b/python_apps/media-monitor2/media/monitor/airtime.py @@ -126,7 +126,10 @@ class AirtimeMessageReceiver(Loggable): except Exception as e: self.fatal_exception("Failed to create watched dir '%s'" % msg['directory'],e) - else: self.new_watch(msg) + else: + self.logger.info("Created new watch directory: '%s'" % + msg['directory']) + self.new_watch(msg) else: self.__request_now_bootstrap( directory=msg['directory'] ) self.manager.add_watch_directory(msg['directory']) diff --git a/python_apps/media-monitor2/media/monitor/pure.py b/python_apps/media-monitor2/media/monitor/pure.py index 9fe1b41df..d60373d26 100644 --- a/python_apps/media-monitor2/media/monitor/pure.py +++ b/python_apps/media-monitor2/media/monitor/pure.py @@ -239,7 +239,7 @@ def normalized_metadata(md, original_path): """ new_md = copy.deepcopy(md) # replace all slashes with dashes - for k,v in new_md.iteritems(): new_md[k] = unicode(v).replace('/','-') + #for k,v in new_md.iteritems(): new_md[k] = unicode(v).replace('/','-') # Specific rules that are applied in a per attribute basis format_rules = { 'MDATA_KEY_TRACKNUMBER' : parse_int,