MythTV
master
|
A handler for image operations. Requires a database/filesystem adapter. More...
#include <libmythmetadata/imagemanager.h>
Public Member Functions | |
QStringList | HandleRename (const QString &id, const QString &newBase) const |
Change name of an image/dir. More... | |
QStringList | HandleDelete (const QString &ids) const |
Deletes images/dirs. More... | |
QStringList | HandleDbCreate (QStringList defs) const |
Creates images for files created by a copy operation. More... | |
QStringList | HandleDbMove (const QString &ids, const QString &srcPath, QString destPath) const |
Updates images that have been renamed. More... | |
QStringList | HandleHide (bool hide, const QString &ids) const |
Hides/unhides images/dirs. More... | |
QStringList | HandleTransform (int transform, const QString &ids) const |
Change orientation of pictures by applying a transformation. More... | |
QStringList | HandleDirs (const QString &destId, bool rescan, const QStringList &relPaths) const |
Creates new image directories. More... | |
QStringList | HandleCover (int dir, int cover) const |
Updates/resets cover thumbnail for an image dir. More... | |
QStringList | HandleIgnore (const QString &exclusions) const |
Updates exclusion list for images. More... | |
QStringList | HandleScanRequest (const QString &command, int devId=DEVICE_INVALID) const |
Process scan requests. More... | |
QStringList | HandleCreateThumbnails (const QStringList &message) const |
Creates thumbnails on-demand. More... | |
QStringList | HandleGetMetadata (const QString &id) const |
Read meta data for an image. More... | |
Protected Member Functions | |
ImageHandler () | |
~ImageHandler () override | |
void | RemoveFiles (ImageList &images) const |
Deletes images and dirs from the filesystem. More... | |
Protected Attributes | |
ImageThumb< DBFS > * | m_thumbGen {nullptr} |
Thumbnail generator. More... | |
ImageScanThread< DBFS > * | m_scanner {nullptr} |
File scanner. More... | |
A handler for image operations. Requires a database/filesystem adapter.
Definition at line 345 of file imagemanager.h.
|
inlineprotected |
Definition at line 363 of file imagemanager.h.
|
inlineoverrideprotected |
Definition at line 367 of file imagemanager.h.
QStringList ImageHandler< DBFS >::HandleRename | ( | const QString & | id, |
const QString & | newBase | ||
) | const |
Change name of an image/dir.
Renames file, updates db and thumbnail
id | File/dir id |
newBase | New file basename |
Definition at line 1211 of file imagemanager.cpp.
Referenced by MainServer::ProcessRequestWork().
QStringList ImageHandler< DBFS >::HandleDelete | ( | const QString & | ids | ) | const |
Deletes images/dirs.
Removes files and dirs, updates db and thumbnails. Dirs containing other files will not be deleted. Only fails if nothing is deleted.
ids | Csv list of dir/file ids |
Definition at line 1287 of file imagemanager.cpp.
Referenced by MainServer::ProcessRequestWork().
QStringList ImageHandler< DBFS >::HandleDbCreate | ( | QStringList | defs | ) | const |
Creates images for files created by a copy operation.
Creates skeleton database entries from image state definitions in order to retain state of the copied images. Initiates a scan to populate them fully and generate thumbnails. This retains
defs | A list of image definitions in the form <id><sep><type><sep><filepath><sep><hidden> <sep><orientation><sep><cover id> where <sep> is the first list item. Dirs must follow their children (files & subdirs) |
Definition at line 1330 of file imagemanager.cpp.
Referenced by MainServer::ProcessRequestWork().
QStringList ImageHandler< DBFS >::HandleDbMove | ( | const QString & | ids, |
const QString & | srcPath, | ||
QString | destPath | ||
) | const |
Updates images that have been renamed.
Updates filepaths of moved images, renames thumbnail and initiates scanner to repair other attributes
ids | Csv of image ids to rename |
srcPath | Images current parent path |
destPath | Images new parent path |
Definition at line 1389 of file imagemanager.cpp.
QStringList ImageHandler< DBFS >::HandleHide | ( | bool | hide, |
const QString & | ids | ||
) | const |
Hides/unhides images/dirs.
Updates hidden status in db and updates clients
hide | hide flag: 0 = Show, 1 = Hide |
ids | Csv list of file/dir ids |
Definition at line 1456 of file imagemanager.cpp.
QStringList ImageHandler< DBFS >::HandleTransform | ( | int | transform, |
const QString & | ids | ||
) | const |
Change orientation of pictures by applying a transformation.
Updates orientation in Db and thumbnail. Does not update file Exif data. Only fails if nothing is modified.
transform | transformation id, |
ids | Csv list of file ids |
Definition at line 1478 of file imagemanager.cpp.
QStringList ImageHandler< DBFS >::HandleDirs | ( | const QString & | destId, |
bool | rescan, | ||
const QStringList & | relPaths | ||
) | const |
Creates new image directories.
Creates dirs in filesystem and optionally updates Db.
destId | Parent dir |
rescan | Whether to start a scan after creating the dirs |
relPaths | List of relative paths of new dirs |
Definition at line 1525 of file imagemanager.cpp.
QStringList ImageHandler< DBFS >::HandleCover | ( | int | dir, |
int | cover | ||
) | const |
Updates/resets cover thumbnail for an image dir.
dir | Directory id |
cover | Id to use as cover. 0 resets dir to use its own thumbnail |
Definition at line 1581 of file imagemanager.cpp.
QStringList ImageHandler< DBFS >::HandleIgnore | ( | const QString & | exclusions | ) | const |
Updates exclusion list for images.
Stores new exclusions setting & rescans. Exclusions is a global setting that dictates which files the scanner ignores. However it is set by any client (last writer wins). Glob characters * and ? are valid.
exclusions | Csv list of exclusion patterns |
Definition at line 1604 of file imagemanager.cpp.
Referenced by MainServer::ProcessRequestWork().
QStringList ImageHandler< DBFS >::HandleScanRequest | ( | const QString & | command, |
int | devId = DEVICE_INVALID |
||
) | const |
Process scan requests.
Handles start scan, stop scan, clear Db and scan progress queries
command | IMAGE_SCAN, START | STOP | QUERY | CLEAR |
devId | Device id. Only used for CLEAR |
Definition at line 1624 of file imagemanager.cpp.
Referenced by MainServer::ProcessRequestWork().
QStringList ImageHandler< DBFS >::HandleCreateThumbnails | ( | const QStringList & | message | ) | const |
Creates thumbnails on-demand.
Display requests are the highest priority. Thumbnails required for an image node will be created before those that are part of a directory thumbnail. A THUMBNAIL_CREATED event is broadcast for each image.
message | For Directory flag, image id |
Definition at line 1670 of file imagemanager.cpp.
Referenced by MainServer::customEvent().
QStringList ImageHandler< DBFS >::HandleGetMetadata | ( | const QString & | id | ) | const |
Read meta data for an image.
Reads exif tags from a picture or FFMPEG video tags
id | Image id |
Definition at line 1180 of file imagemanager.cpp.
Referenced by MainServer::customEvent().
|
protected |
Deletes images and dirs from the filesystem.
Dirs will only be deleted if empty. Items are deleted in reverse order so that parent dirs at front of list will be empty once their subdirs at back of list have been deleted. Files/dirs that failed to delete are removed from the list.
[in,out] | images | List of images/dirs to delete. On return the files that were successfully deleted. |
Definition at line 1702 of file imagemanager.cpp.
|
protected |
Thumbnail generator.
Definition at line 375 of file imagemanager.h.
|
protected |
File scanner.
Definition at line 376 of file imagemanager.h.