#include <content_manager.h>
Data Structures | |
| class | TimerParameter |
| This is the parameter class for timerNotify. More... | |
Public Member Functions | |
| ContentManager () | |
| virtual void | init () |
| virtual | ~ContentManager () |
| void | shutdown () |
| virtual void | timerNotify (zmm::Ref< zmm::Object > parameter) |
| bool | isBusy () |
| zmm::Ref< CMAccounting > | getAccounting () |
| zmm::Ref< GenericTask > | getCurrentTask () |
| Returns the task that is currently being executed. | |
| zmm::Ref< zmm::Array < GenericTask > > | getTasklist () |
| Returns the list of all enqueued tasks, including the current or nil if no tasks are present. | |
| void | invalidateTask (unsigned int taskID, task_owner_t taskOwner=ContentManagerTask) |
| Find a task identified by the task ID and invalidate it. | |
| void | loadAccounting (bool async=true) |
| int | addFile (zmm::String path, bool recursive=true, bool async=true, bool hidden=false, bool lowPriority=false, bool cancellable=true) |
| Adds a file or directory to the database. | |
| int | ensurePathExistence (zmm::String path) |
| void | removeObject (int objectID, bool async=true, bool all=false) |
| void | rescanDirectory (int objectID, int scanID, scan_mode_t scanMode, zmm::String descPath=nil, bool cancellable=true) |
| void | updateObject (int objectID, zmm::Ref< Dictionary > parameters) |
| Updates an object in the database using the given parameters. | |
| zmm::Ref< CdsObject > | createObjectFromFile (zmm::String path, bool magic=true, bool allow_fifo=false) |
| void | addVirtualItem (zmm::Ref< CdsObject > obj, bool allow_fifo=false) |
| Adds a virtual item. | |
| void | addObject (zmm::Ref< CdsObject > obj) |
| Adds an object to the database. | |
| int | addContainerChain (zmm::String chain, zmm::String lastClass=nil, int lastRefID=INVALID_OBJECT_ID) |
| Adds a virtual container chain specified by path. | |
| void | addContainer (int parentID, zmm::String title, zmm::String upnpClass) |
| Adds a virtual container specified by parentID and title. | |
| void | updateObject (zmm::Ref< CdsObject > obj, bool send_updates=true) |
| Updates an object in the database. | |
| zmm::Ref< CdsObject > | convertObject (zmm::Ref< CdsObject > obj, int objectType) |
| Updates an object in the database using the given parameters. | |
| zmm::Ref< AutoscanDirectory > | getAutoscanDirectory (int scanID, scan_mode_t scanMode) |
| Gets an AutocsanDirectrory from the watch list. | |
| zmm::Ref< AutoscanDirectory > | getAutoscanDirectory (zmm::String location) |
| Get an AutoscanDirectory given by location on disk from the watch list. | |
| void | removeAutoscanDirectory (int scanID, scan_mode_t scanMode) |
| Removes an AutoscanDirectrory (found by scanID) from the watch list. | |
| void | removeAutoscanDirectory (zmm::String location) |
| Removes an AutoscanDirectrory (found by location) from the watch list. | |
| void | removeAutoscanDirectory (int objectID) |
| Removes an AutoscanDirectory (by objectID) from the watch list. | |
| void | setAutoscanDirectory (zmm::Ref< AutoscanDirectory > dir) |
| Update autoscan parameters for an existing autoscan directory or add a new autoscan directory. | |
| void | handlePeristentAutoscanRemove (int scanID, scan_mode_t scanMode) |
| handles the removal of a persistent autoscan directory | |
| void | handlePersistentAutoscanRecreate (int scanID, scan_mode_t scanMode) |
| handles the recreation of a persistent autoscan directory | |
| zmm::Ref< zmm::Array < AutoscanDirectory > > | getAutoscanDirectories (scan_mode_t scanMode) |
| returns an array of autoscan directories for the given scan mode | |
| zmm::Ref< zmm::Array < AutoscanDirectory > > | getAutoscanDirectories () |
| returns an array of all autoscan directories | |
| void | reloadLayout () |
| instructs ContentManager to reload scripting environment | |
| void | retain () |
| void | release () |
| int | getRefCount () |
Static Public Member Functions | |
| static zmm::Ref< ContentManager > | getInstance () |
| static void * | operator new (size_t size) |
| static void | operator delete (void *ptr) |
Protected Member Functions | |
| void | initLayout () |
| void | destroyLayout () |
| void | _loadAccounting () |
| int | addFileInternal (zmm::String path, zmm::String rootpath, bool recursive=true, bool async=true, bool hidden=false, bool lowPriority=false, unsigned int parentTaskID=0, bool cancellable=true) |
| int | _addFile (zmm::String path, zmm::String rootpath, bool recursive=false, bool hidden=false, zmm::Ref< GenericTask > task=nil) |
| void | _removeObject (int objectID, bool all) |
| void | _rescanDirectory (int containerID, int scanID, scan_mode_t scanMode, scan_level_t scanLevel, zmm::Ref< GenericTask > task=nil) |
| void | addRecursive (zmm::String path, bool hidden, zmm::Ref< GenericTask > task) |
| zmm::String | extension2mimetype (zmm::String extension) |
| zmm::String | mimetype2upnpclass (zmm::String mimeType) |
| void | invalidateAddTask (zmm::Ref< GenericTask > t, zmm::String path) |
| void | setLastModifiedTime (time_t lm) |
| void | signal () |
| void | threadProc () |
| void | addTask (zmm::Ref< GenericTask > task, bool lowPriority=false) |
| virtual void | registerSingleton () |
Static Protected Member Functions | |
| static void * | staticThreadProc (void *arg) |
Protected Attributes | |
| zmm::Ref< RExp > | reMimetype |
| bool | ignore_unknown_extensions |
| bool | extension_map_case_sensitive |
| zmm::Ref< Dictionary > | extension_mimetype_map |
| zmm::Ref< Dictionary > | mimetype_upnpclass_map |
| zmm::Ref< Dictionary > | mimetype_contenttype_map |
| zmm::Ref< AutoscanList > | autoscan_timed |
| zmm::Ref< Layout > | layout |
| bool | layout_enabled |
| zmm::Ref< CMAccounting > | acct |
| pthread_t | taskThread |
| zmm::Ref< Cond > | cond |
| bool | working |
| bool | shutdownFlag |
| zmm::Ref< zmm::ObjectQueue < GenericTask > > | taskQueue1 |
| zmm::Ref< zmm::ObjectQueue < GenericTask > > | taskQueue2 |
| zmm::Ref< GenericTask > | currentTask |
| unsigned int | taskID |
| mt_atomic_t | _ref_count |
Static Protected Attributes | |
| static zmm::Ref< Mutex > | mutex |
| static zmm::Ref< ContentManager > | instance |
| static bool | singletonActive |
Friends | |
| void | CMAddFileTask::run () |
| void | CMRemoveObjectTask::run () |
| void | CMRescanDirectoryTask::run () |
| void | CMLoadAccountingTask::run () |
Definition at line 175 of file content_manager.h.
| ContentManager::ContentManager | ( | ) |
Definition at line 114 of file content_manager.cc.
References acct, AS_TIMER_SUBSCRIBER_SINGLETON, autoscan_timed, zmm::String::c_str(), CFG_IMPORT_AUTOSCAN_TIMED_LIST, CFG_IMPORT_MAPPINGS_EXTENSION_TO_MIMETYPE_CASE_SENSITIVE, CFG_IMPORT_MAPPINGS_EXTENSION_TO_MIMETYPE_LIST, CFG_IMPORT_MAPPINGS_IGNORE_UNKNOWN_EXTENSIONS, CFG_IMPORT_MAPPINGS_MIMETYPE_TO_CONTENTTYPE_LIST, CFG_IMPORT_MAPPINGS_MIMETYPE_TO_UPNP_CLASS_LIST, CFG_IMPORT_SCRIPTING_VIRTUAL_LAYOUT_TYPE, check_path(), CM_INITIAL_QUEUE_SIZE, cond, ensurePathExistence(), extension_map_case_sensitive, extension_mimetype_map, Singleton< ContentManager >::getInstance(), zmm::Exception::getMessage(), ignore_unknown_extensions, InotifyScanMode, layout_enabled, log_error, log_warning, mimetype_contenttype_map, mimetype_upnpclass_map, Singleton< ContentManager >::mutex, nil, NULL, RefCast, shutdownFlag, string_ok(), taskID, taskQueue1, taskQueue2, TimedScanMode, and working.
| ContentManager::~ContentManager | ( | ) | [virtual] |
Definition at line 367 of file content_manager.cc.
References log_debug.
| int ContentManager::_addFile | ( | zmm::String | path, | |
| zmm::String | rootpath, | |||
| bool | recursive = false, |
|||
| bool | hidden = false, |
|||
| zmm::Ref< GenericTask > | task = nil | |||
| ) | [protected] |
Definition at line 633 of file content_manager.cc.
References addObject(), addRecursive(), zmm::String::charAt(), CONTENT_TYPE_DVD, CONTENT_TYPE_PLAYLIST, createObjectFromFile(), get_filename(), Singleton< ContentManager >::getInstance(), Singleton< ConfigManager >::getInstance(), initLayout(), INVALID_OBJECT_ID, IS_CDS_CONTAINER, IS_CDS_ITEM, layout, layout_enabled, log_warning, mimetype_contenttype_map, nil, RefCast, and string_ok().
Referenced by addFileInternal().
| void ContentManager::_loadAccounting | ( | ) | [protected] |
Definition at line 602 of file content_manager.cc.
References acct, and Singleton< ContentManager >::getInstance().
Referenced by loadAccounting().
| void ContentManager::_removeObject | ( | int | objectID, | |
| bool | all | |||
| ) | [protected] |
Definition at line 710 of file content_manager.cc.
References _, _Exception, CDS_ID_FS_ROOT, CDS_ID_ROOT, Singleton< ContentManager >::getInstance(), IS_FORBIDDEN_CDS_ID, and nil.
Referenced by removeObject().
| void ContentManager::_rescanDirectory | ( | int | containerID, | |
| int | scanID, | |||
| scan_mode_t | scanMode, | |||
| scan_level_t | scanLevel, | |||
| zmm::Ref< GenericTask > | task = nil | |||
| ) | [protected] |
Definition at line 745 of file content_manager.cc.
References _, _Exception, addFileInternal(), AUTOLOCK, BasicScanLevel, zmm::String::c_str(), CDS_ID_FS_ROOT, check_path(), DIR_SEPARATOR, ensurePathExistence(), FS_ROOT_DIRECTORY, FullScanLevel, getAutoscanDirectory(), Singleton< ConfigManager >::getInstance(), Singleton< ContentManager >::getInstance(), INVALID_OBJECT_ID, INVALID_SCAN_ID, IS_CDS_CONTAINER, log_debug, log_error, log_warning, mt_strerror(), Singleton< ContentManager >::mutex, nil, NULL, removeAutoscanDirectory(), removeObject(), rescanDirectory(), shutdownFlag, and string_ok().
| void ContentManager::addContainer | ( | int | parentID, | |
| zmm::String | title, | |||
| zmm::String | upnpClass | |||
| ) |
Adds a virtual container specified by parentID and title.
| parentID | the id of the parent. | |
| title | the title of the container. | |
| upnpClass | the upnp class of the container. |
Definition at line 1287 of file content_manager.cc.
References addContainerChain(), escape(), Singleton< ContentManager >::getInstance(), VIRTUAL_CONTAINER_ESCAPE, and VIRTUAL_CONTAINER_SEPARATOR.
| int ContentManager::addContainerChain | ( | zmm::String | chain, | |
| zmm::String | lastClass = nil, |
|||
| int | lastRefID = INVALID_OBJECT_ID | |||
| ) |
Adds a virtual container chain specified by path.
| container | path separated by '/'. Slashes in container titles must be escaped. | |
| lastClass | upnp:class of the last container in the chain, if nil then the default class will be taken | |
| lastRefID | reference id of the last container in the chain, INVALID_OBJECT_ID indicates that the id will not be set. |
Definition at line 1294 of file content_manager.cc.
References _, _Exception, zmm::String::c_str(), Singleton< ContentManager >::getInstance(), INVALID_OBJECT_ID, log_debug, and string_ok().
Referenced by addContainer().
| int ContentManager::addFile | ( | zmm::String | path, | |
| bool | recursive = true, |
|||
| bool | async = true, |
|||
| bool | hidden = false, |
|||
| bool | lowPriority = false, |
|||
| bool | cancellable = true | |||
| ) |
Adds a file or directory to the database.
| path | absolute path to the file | |
| recursive | recursive add (process subdirecotories) | |
| async | queue task or perform a blocking call | |
| hidden | true allows to import hidden files, false ignores them | |
| queue | for immediate processing or in normal order |
Definition at line 1619 of file content_manager.cc.
References addFileInternal(), and check_path().
| int ContentManager::addFileInternal | ( | zmm::String | path, | |
| zmm::String | rootpath, | |||
| bool | recursive = true, |
|||
| bool | async = true, |
|||
| bool | hidden = false, |
|||
| bool | lowPriority = false, |
|||
| unsigned int | parentTaskID = 0, |
|||
| bool | cancellable = true | |||
| ) | [protected] |
Definition at line 1628 of file content_manager.cc.
References _, _addFile(), addTask(), and INVALID_OBJECT_ID.
Referenced by _rescanDirectory(), and addFile().
Adds an object to the database.
| obj | object to add |
parentID of the object must be set before this method. The ID of the object provided is ignored and generated by this method
Definition at line 1250 of file content_manager.cc.
References DIR_SEPARATOR, Singleton< ContentManager >::getInstance(), INVALID_OBJECT_ID, IS_CDS_CONTAINER, IS_CDS_ITEM, IS_CDS_ITEM_EXTERNAL_URL, and log_debug.
Referenced by _addFile(), addRecursive(), and addVirtualItem().
| void ContentManager::addRecursive | ( | zmm::String | path, | |
| bool | hidden, | |||
| zmm::Ref< GenericTask > | task | |||
| ) | [protected] |
Definition at line 990 of file content_manager.cc.
References _, _Exception, addObject(), zmm::String::c_str(), CFG_IMPORT_MAPPINGS_MIMETYPE_TO_CONTENTTYPE_LIST, zmm::String::charAt(), CONTENT_TYPE_DVD, CONTENT_TYPE_PLAYLIST, createObjectFromFile(), DIR_SEPARATOR, StringConverter::f2i(), Singleton< ConfigManager >::getInstance(), Singleton< ContentManager >::getInstance(), zmm::Exception::getMessage(), IS_CDS_CONTAINER, IS_CDS_ITEM, layout, log_debug, log_warning, nil, NULL, RefCast, and shutdownFlag.
Referenced by _addFile().
| void ContentManager::addTask | ( | zmm::Ref< GenericTask > | task, | |
| bool | lowPriority = false | |||
| ) | [protected] |
Definition at line 1591 of file content_manager.cc.
References AUTOLOCK, Singleton< ContentManager >::mutex, signal(), taskID, taskQueue1, and taskQueue2.
Referenced by addFileInternal(), loadAccounting(), removeObject(), and rescanDirectory().
Adds a virtual item.
| obj | item to add | |
| allow_fifo | flag to indicate that it is ok to add a fifo, otherwise only regular files or directories are allowed. |
This function makes sure that the file is first added to PC-Directory, however without the scripting execution. It then adds the user defined virtual item to the database.
Definition at line 608 of file content_manager.cc.
References _, _Exception, addObject(), check_path_ex(), createObjectFromFile(), Singleton< ContentManager >::getInstance(), IS_CDS_ITEM, and nil.
Updates an object in the database using the given parameters.
| objectID | ID of the object to update |
Note: no actions should be performed on the object given as the parameter. Only the returned object should be processed. This method does not save the returned object in the database. To do so updateObject must be called
Definition at line 1336 of file content_manager.cc.
References _, _Exception, CdsObject::createObject(), and IS_CDS_ITEM.
| Ref< CdsObject > ContentManager::createObjectFromFile | ( | zmm::String | path, | |
| bool | magic = true, |
|||
| bool | allow_fifo = false | |||
| ) |
Definition at line 1355 of file content_manager.cc.
References _, _Exception, zmm::String::c_str(), CONTENT_TYPE_OGG, extension2mimetype(), StringConverter::f2i(), get_filename(), ignore_unknown_extensions, isTheora(), mimetype2upnpclass(), mimetype_contenttype_map, mt_strerror(), nil, RefCast, reMimetype, zmm::String::rindex(), MetadataHandler::setMetadata(), string_ok(), zmm::String::substring(), UPNP_DEFAULT_CLASS_MUSIC_TRACK, and UPNP_DEFAULT_CLASS_VIDEO_ITEM.
Referenced by _addFile(), addRecursive(), and addVirtualItem().
| void ContentManager::destroyLayout | ( | ) | [protected] |
Definition at line 1527 of file content_manager.cc.
Referenced by reloadLayout().
| int ContentManager::ensurePathExistence | ( | zmm::String | path | ) |
Definition at line 733 of file content_manager.cc.
References Singleton< ContentManager >::getInstance(), and INVALID_OBJECT_ID.
Referenced by _rescanDirectory(), ContentManager(), and handlePersistentAutoscanRecreate().
| String ContentManager::extension2mimetype | ( | zmm::String | extension | ) | [protected] |
Definition at line 1446 of file content_manager.cc.
References extension_map_case_sensitive, extension_mimetype_map, nil, and zmm::String::toLower().
Referenced by createObjectFromFile().
| Ref< CMAccounting > ContentManager::getAccounting | ( | ) |
Definition at line 545 of file content_manager.cc.
References acct.
| Ref< Array< AutoscanDirectory > > ContentManager::getAutoscanDirectories | ( | ) |
returns an array of all autoscan directories
Definition at line 1979 of file content_manager.cc.
References autoscan_timed, and nil.
| Ref< Array< AutoscanDirectory > > ContentManager::getAutoscanDirectories | ( | scan_mode_t | scanMode | ) |
returns an array of autoscan directories for the given scan mode
Definition at line 1963 of file content_manager.cc.
References autoscan_timed, InotifyScanMode, nil, and TimedScanMode.
| Ref< AutoscanDirectory > ContentManager::getAutoscanDirectory | ( | zmm::String | location | ) |
Get an AutoscanDirectory given by location on disk from the watch list.
Definition at line 1992 of file content_manager.cc.
References autoscan_timed, and nil.
| Ref< AutoscanDirectory > ContentManager::getAutoscanDirectory | ( | int | scanID, | |
| scan_mode_t | scanMode | |||
| ) |
Gets an AutocsanDirectrory from the watch list.
Definition at line 1947 of file content_manager.cc.
References autoscan_timed, InotifyScanMode, nil, and TimedScanMode.
Referenced by _rescanDirectory(), handlePeristentAutoscanRemove(), handlePersistentAutoscanRecreate(), and rescanDirectory().
| Ref< GenericTask > ContentManager::getCurrentTask | ( | ) |
Returns the task that is currently being executed.
Definition at line 549 of file content_manager.cc.
References AUTOLOCK, currentTask, and Singleton< ContentManager >::mutex.
Referenced by getTasklist(), invalidateTask(), and removeObject().
| static zmm::Ref<ContentManager > Singleton< ContentManager >::getInstance | ( | ) | [inline, static, inherited] |
Definition at line 62 of file singleton.h.
Referenced by _addFile(), _loadAccounting(), _removeObject(), _rescanDirectory(), FallbackLayout::add(), FallbackLayout::addAudio(), addContainer(), web::addObject::addContainer(), addContainerChain(), FallbackLayout::addImage(), addObject(), addRecursive(), FallbackLayout::addVideo(), addVirtualItem(), ContentManager(), ensurePathExistence(), getTasklist(), handlePeristentAutoscanRemove(), handlePersistentAutoscanRecreate(), initLayout(), invalidateTask(), main(), WebRequestHandler::open(), web::autoscan::process(), web::tasks::process(), web::remove::process(), web::edit_save::process(), web::addObject::process(), web::add::process(), web::action::process(), removeAutoscanDirectory(), removeObject(), CMLoadAccountingTask::run(), CMRescanDirectoryTask::run(), CMRemoveObjectTask::run(), CMAddFileTask::run(), setAutoscanDirectory(), threadProc(), and updateObject().
| int Object::getRefCount | ( | ) | [inherited] |
Definition at line 78 of file object.cc.
References zmm::Object::_ref_count, and atomic_get().
| Ref< Array< GenericTask > > ContentManager::getTasklist | ( | ) |
Returns the list of all enqueued tasks, including the current or nil if no tasks are present.
Definition at line 557 of file content_manager.cc.
References AUTOLOCK, getCurrentTask(), Singleton< ContentManager >::getInstance(), Singleton< ContentManager >::mutex, nil, taskQueue1, and taskQueue2.
| void ContentManager::handlePeristentAutoscanRemove | ( | int | scanID, | |
| scan_mode_t | scanMode | |||
| ) |
handles the removal of a persistent autoscan directory
Definition at line 2084 of file content_manager.cc.
References getAutoscanDirectory(), Singleton< ContentManager >::getInstance(), INVALID_OBJECT_ID, and removeAutoscanDirectory().
| void ContentManager::handlePersistentAutoscanRecreate | ( | int | scanID, | |
| scan_mode_t | scanMode | |||
| ) |
handles the recreation of a persistent autoscan directory
Definition at line 2100 of file content_manager.cc.
References ensurePathExistence(), getAutoscanDirectory(), and Singleton< ContentManager >::getInstance().
| void ContentManager::init | ( | ) | [virtual] |
Reimplemented from Singleton< ContentManager >.
Definition at line 372 of file content_manager.cc.
References _, _Exception, AS_TIMER_SUBSCRIBER_SINGLETON, autoscan_timed, Singleton< ConfigManager >::getInstance(), MIMETYPE_REGEXP, nil, NULL, reMimetype, staticThreadProc(), and taskThread.
| void ContentManager::initLayout | ( | ) | [protected] |
Definition at line 1471 of file content_manager.cc.
References AUTOLOCK, zmm::String::c_str(), CFG_IMPORT_SCRIPTING_VIRTUAL_LAYOUT_TYPE, Singleton< ContentManager >::getInstance(), zmm::Exception::getMessage(), layout, log_error, Singleton< ContentManager >::mutex, and nil.
Referenced by _addFile(), and reloadLayout().
| void ContentManager::invalidateAddTask | ( | zmm::Ref< GenericTask > | t, | |
| zmm::String | path | |||
| ) | [protected] |
Definition at line 1779 of file content_manager.cc.
References AddFile, zmm::String::c_str(), log_debug, and RefCast.
Referenced by removeObject().
| void ContentManager::invalidateTask | ( | unsigned int | taskID, | |
| task_owner_t | taskOwner = ContentManagerTask | |||
| ) |
Find a task identified by the task ID and invalidate it.
Definition at line 1792 of file content_manager.cc.
References AUTOLOCK, ContentManagerTask, getCurrentTask(), Singleton< ContentManager >::getInstance(), Singleton< ContentManager >::mutex, nil, TaskProcessorTask, taskQueue1, and taskQueue2.
| bool ContentManager::isBusy | ( | ) | [inline] |
Definition at line 217 of file content_manager.h.
References working.
| void ContentManager::loadAccounting | ( | bool | async = true |
) |
Definition at line 1605 of file content_manager.cc.
References _, _loadAccounting(), and addTask().
| String ContentManager::mimetype2upnpclass | ( | zmm::String | mimeType | ) | [protected] |
Definition at line 1457 of file content_manager.cc.
References mimetype_upnpclass_map, nil, and split_string().
Referenced by createObjectFromFile().
| void Object::operator delete | ( | void * | ptr | ) | [static, inherited] |
| void * Object::operator new | ( | size_t | size | ) | [static, inherited] |
| virtual void Singleton< ContentManager >::registerSingleton | ( | ) | [inline, protected, virtual, inherited] |
Definition at line 94 of file singleton.h.
| void Object::release | ( | ) | [inherited] |
Definition at line 66 of file object.cc.
References zmm::Object::_ref_count, atomic_dec(), and zmm::Object::mutex.
Referenced by zmm::ArrayBase::clear(), zmm::String::operator=(), DSOHash< zmm::Array< CacheObject > >::releaseData(), DSBHash< VT >::releaseData(), DSOHash< zmm::Array< CacheObject > >::remove(), zmm::ArrayBase::remove(), zmm::ArrayBase::removeUnordered(), zmm::ArrayBase::set(), zmm::ArrayBase::~ArrayBase(), DSOHash< zmm::Array< CacheObject > >::~DSOHash(), zmm::ObjectQueue< AutoscanDirectory >::~ObjectQueue(), zmm::ObjectStack< Element >::~ObjectStack(), and zmm::String::~String().
| void ContentManager::reloadLayout | ( | ) |
instructs ContentManager to reload scripting environment
Definition at line 1532 of file content_manager.cc.
References destroyLayout(), and initLayout().
| void ContentManager::removeAutoscanDirectory | ( | int | objectID | ) |
Removes an AutoscanDirectory (by objectID) from the watch list.
Definition at line 2039 of file content_manager.cc.
References _, _Exception, AS_TIMER_SUBSCRIBER_SINGLETON, autoscan_timed, Singleton< ConfigManager >::getInstance(), Singleton< ContentManager >::getInstance(), InotifyScanMode, nil, and TimedScanMode.
| void ContentManager::removeAutoscanDirectory | ( | zmm::String | location | ) |
Removes an AutoscanDirectrory (found by location) from the watch list.
Definition at line 2067 of file content_manager.cc.
References _, _Exception, autoscan_timed, Singleton< ConfigManager >::getInstance(), nil, and removeAutoscanDirectory().
| void ContentManager::removeAutoscanDirectory | ( | int | scanID, | |
| scan_mode_t | scanMode | |||
| ) |
Removes an AutoscanDirectrory (found by scanID) from the watch list.
Definition at line 2003 of file content_manager.cc.
References _, _Exception, AS_TIMER_SUBSCRIBER_SINGLETON, autoscan_timed, Singleton< ConfigManager >::getInstance(), Singleton< ContentManager >::getInstance(), InotifyScanMode, nil, and TimedScanMode.
Referenced by _rescanDirectory(), handlePeristentAutoscanRemove(), and removeAutoscanDirectory().
| void ContentManager::removeObject | ( | int | objectID, | |
| bool | async = true, |
|||
| bool | all = false | |||
| ) |
Definition at line 1835 of file content_manager.cc.
References _, _removeObject(), addTask(), AS_TIMER_SUBSCRIBER_SINGLETON, AUTOLOCK, autoscan_timed, getCurrentTask(), Singleton< ConfigManager >::getInstance(), Singleton< ContentManager >::getInstance(), invalidateAddTask(), IS_CDS_CONTAINER, log_debug, Singleton< ContentManager >::mutex, nil, string_ok(), taskQueue1, and taskQueue2.
Referenced by _rescanDirectory().
| void ContentManager::rescanDirectory | ( | int | objectID, | |
| int | scanID, | |||
| scan_mode_t | scanMode, | |||
| zmm::String | descPath = nil, |
|||
| bool | cancellable = true | |||
| ) |
Definition at line 1924 of file content_manager.cc.
References _, addTask(), BasicScanLevel, getAutoscanDirectory(), nil, and string_ok().
Referenced by _rescanDirectory(), and timerNotify().
| void Object::retain | ( | ) | [inherited] |
Definition at line 58 of file object.cc.
References zmm::Object::_ref_count, atomic_inc(), and zmm::Object::mutex.
Referenced by zmm::ArrayBase::append(), zmm::ObjectQueue< AutoscanDirectory >::enqueue(), zmm::ArrayBase::insert(), zmm::String::operator=(), zmm::ObjectStack< Element >::push(), DSOHash< zmm::Array< CacheObject > >::put(), DSBHash< VT >::put(), zmm::ArrayBase::set(), and zmm::String::String().
| void ContentManager::setAutoscanDirectory | ( | zmm::Ref< AutoscanDirectory > | dir | ) |
Update autoscan parameters for an existing autoscan directory or add a new autoscan directory.
Definition at line 2108 of file content_manager.cc.
References _, _Exception, AS_TIMER_SUBSCRIBER_SINGLETON, autoscan_timed, BasicScanLevel, CDS_ID_FS_ROOT, FS_ROOT_DIRECTORY, FullScanLevel, Singleton< SessionManager >::getInstance(), Singleton< Timer >::getInstance(), Singleton< ConfigManager >::getInstance(), Singleton< ContentManager >::getInstance(), InotifyScanMode, INVALID_SCAN_ID, IS_CDS_CONTAINER, log_debug, nil, string_ok(), TimedScanMode, and timerNotify().
| void ContentManager::setLastModifiedTime | ( | time_t | lm | ) | [protected] |
| void ContentManager::shutdown | ( | ) | [virtual] |
Reimplemented from Singleton< ContentManager >.
Definition at line 483 of file content_manager.cc.
References AUTOLOCK, autoscan_timed, AUTOUNLOCK, check_path_ex(), log_debug, Singleton< ContentManager >::mutex, nil, NULL, shutdownFlag, signal(), and taskThread.
| void ContentManager::signal | ( | ) | [inline, protected] |
Definition at line 465 of file content_manager.h.
References cond.
Referenced by addTask(), and shutdown().
| void * ContentManager::staticThreadProc | ( | void * | arg | ) | [static, protected] |
Definition at line 1583 of file content_manager.cc.
References NULL, and threadProc().
Referenced by init().
| void ContentManager::threadProc | ( | ) | [protected] |
Definition at line 1538 of file content_manager.cc.
References AUTOLOCK, AUTORELOCK, AUTOUNLOCK, zmm::String::c_str(), cond, currentTask, Singleton< ContentManager >::getInstance(), zmm::Exception::getMessage(), log_error, Singleton< ContentManager >::mutex, nil, zmm::Exception::printStackTrace(), shutdownFlag, taskQueue1, taskQueue2, and working.
Referenced by staticThreadProc().
| void ContentManager::timerNotify | ( | zmm::Ref< zmm::Object > | parameter | ) | [virtual] |
Implements TimerSubscriber.
Definition at line 453 of file content_manager.cc.
References autoscan_timed, ContentManager::TimerParameter::IDAutoscan, nil, RefCast, and rescanDirectory().
Referenced by setAutoscanDirectory().
Updates an object in the database.
| obj | the object to update |
Definition at line 1314 of file content_manager.cc.
References Singleton< ContentManager >::getInstance(), INVALID_OBJECT_ID, and IS_CDS_CONTAINER.
| void ContentManager::updateObject | ( | int | objectID, | |
| zmm::Ref< Dictionary > | parameters | |||
| ) |
Updates an object in the database using the given parameters.
| objectID | ID of the object to update | |
| parameters | key value pairs of fields to be updated |
Definition at line 1114 of file content_manager.cc.
References _, CdsObject::createObject(), Singleton< ContentManager >::getInstance(), MetadataHandler::getMetaFieldName(), INVALID_OBJECT_ID, IS_CDS_ACTIVE_ITEM, IS_CDS_CONTAINER, IS_CDS_ITEM, log_debug, M_DESCRIPTION, nil, RefCast, renderProtocolInfo(), split_string(), and string_ok().
| void CMAddFileTask::run | ( | ) | [friend] |
| void CMLoadAccountingTask::run | ( | ) | [friend] |
| void CMRemoveObjectTask::run | ( | ) | [friend] |
| void CMRescanDirectoryTask::run | ( | ) | [friend] |
mt_atomic_t zmm::Object::_ref_count [protected, inherited] |
Definition at line 54 of file object.h.
Referenced by zmm::Object::getRefCount(), zmm::Object::Object(), zmm::Object::release(), and zmm::Object::retain().
zmm::Ref<CMAccounting> ContentManager::acct [protected] |
Definition at line 471 of file content_manager.h.
Referenced by _loadAccounting(), ContentManager(), and getAccounting().
zmm::Ref<AutoscanList> ContentManager::autoscan_timed [protected] |
Definition at line 397 of file content_manager.h.
Referenced by ContentManager(), getAutoscanDirectories(), getAutoscanDirectory(), init(), removeAutoscanDirectory(), removeObject(), setAutoscanDirectory(), shutdown(), and timerNotify().
zmm::Ref<Cond> ContentManager::cond [protected] |
Definition at line 474 of file content_manager.h.
Referenced by ContentManager(), signal(), and threadProc().
zmm::Ref<GenericTask> ContentManager::currentTask [protected] |
Definition at line 482 of file content_manager.h.
Referenced by getCurrentTask(), and threadProc().
bool ContentManager::extension_map_case_sensitive [protected] |
Definition at line 391 of file content_manager.h.
Referenced by ContentManager(), and extension2mimetype().
zmm::Ref<Dictionary> ContentManager::extension_mimetype_map [protected] |
Definition at line 393 of file content_manager.h.
Referenced by ContentManager(), and extension2mimetype().
bool ContentManager::ignore_unknown_extensions [protected] |
Definition at line 390 of file content_manager.h.
Referenced by ContentManager(), and createObjectFromFile().
zmm::Ref<ContentManager > Singleton< ContentManager >::instance [static, protected, inherited] |
Definition at line 91 of file singleton.h.
zmm::Ref<Layout> ContentManager::layout [protected] |
Definition at line 430 of file content_manager.h.
Referenced by _addFile(), addRecursive(), destroyLayout(), and initLayout().
bool ContentManager::layout_enabled [protected] |
Definition at line 461 of file content_manager.h.
Referenced by _addFile(), and ContentManager().
zmm::Ref<Dictionary> ContentManager::mimetype_contenttype_map [protected] |
Definition at line 395 of file content_manager.h.
Referenced by _addFile(), ContentManager(), and createObjectFromFile().
zmm::Ref<Dictionary> ContentManager::mimetype_upnpclass_map [protected] |
Definition at line 394 of file content_manager.h.
Referenced by ContentManager(), and mimetype2upnpclass().
zmm::Ref<Mutex> Singleton< ContentManager >::mutex [static, protected, inherited] |
Reimplemented from zmm::Object.
Definition at line 90 of file singleton.h.
Referenced by _rescanDirectory(), addTask(), ContentManager(), getCurrentTask(), getTasklist(), initLayout(), invalidateTask(), removeObject(), shutdown(), and threadProc().
zmm::Ref<RExp> ContentManager::reMimetype [protected] |
Definition at line 388 of file content_manager.h.
Referenced by createObjectFromFile(), and init().
bool ContentManager::shutdownFlag [protected] |
Definition at line 478 of file content_manager.h.
Referenced by _rescanDirectory(), addRecursive(), ContentManager(), shutdown(), and threadProc().
bool Singleton< ContentManager >::singletonActive [static, protected, inherited] |
Definition at line 92 of file singleton.h.
unsigned int ContentManager::taskID [protected] |
Definition at line 484 of file content_manager.h.
Referenced by addTask(), and ContentManager().
zmm::Ref<zmm::ObjectQueue<GenericTask> > ContentManager::taskQueue1 [protected] |
Definition at line 480 of file content_manager.h.
Referenced by addTask(), ContentManager(), getTasklist(), invalidateTask(), removeObject(), and threadProc().
zmm::Ref<zmm::ObjectQueue<GenericTask> > ContentManager::taskQueue2 [protected] |
Definition at line 481 of file content_manager.h.
Referenced by addTask(), ContentManager(), getTasklist(), invalidateTask(), removeObject(), and threadProc().
pthread_t ContentManager::taskThread [protected] |
Definition at line 473 of file content_manager.h.
Referenced by init(), and shutdown().
bool ContentManager::working [protected] |
Definition at line 476 of file content_manager.h.
Referenced by ContentManager(), isBusy(), and threadProc().
1.6.1