MythTV  master
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Attributes | List of all members
ImageAdapterSg Class Reference

Filesystem adapter for Backend, managing Photographs storage group. More...

#include <imagemanager.h>

Inheritance diagram for ImageAdapterSg:
Inheritance graph
[legend]
Collaboration diagram for ImageAdapterSg:
Collaboration graph
[legend]

Public Member Functions

 ImageAdapterSg ()
 
ImageItemCreateItem (const QFileInfo &fi, int parentId, int devId, const QString &base) const
 Construct a remote image from a file. More...
 
StringMap GetScanDirs () const
 Returns SG dirs. More...
 
QString GetAbsFilePath (const ImagePtrK &im) const
 Get absolute filepath for a remote image. More...
 
QString MakeFileUrl (const QString &path) const
 Construct URL of a remote image. More...
 
QString MakeThumbUrl (const QString &devPath, const QString &path="") const
 Construct URL of the thumbnail of a remote image. More...
 
- Public Member Functions inherited from ImageAdapterBase
QDir GetImageFilters () const
 Get filters for detecting recognised images/videos. More...
 
ImageNodeType GetImageType (const QString &ext) const
 Determine file type from its extension. More...
 
- Public Member Functions inherited from DeviceManager
QStringList CloseDevices (int devId, const QString &action)
 Remove a device (or all devices) More...
 
QString DeviceMount (int devId) const
 Get path at which the device is mounted. More...
 
QString DeviceName (int devId) const
 Get model name of the device. More...
 
int DeviceCount () const
 
QString ThumbDir (int fs) const
 

Static Public Member Functions

static void Notify (const QString &mesg, const QStringList &extra)
 Send message to all clients about remote ids. More...
 
- Static Public Member Functions inherited from ImageAdapterBase
static QStringList SupportedImages ()
 Return recognised pictures. More...
 
static QStringList SupportedVideos ()
 Return recognised video extensions. More...
 
static QString ConstructPath (const QString &path, const QString &name)
 Assembles a canonical file path without corrupting its absolute/relative nature. More...
 
static QString BaseNameOf (const QString &path)
 Extracts file name (incl extension) from a filepath. More...
 
static QString PathOf (const QString &path)
 Extracts path from a filepath. More...
 
static QString FormatSize (int sizeKib)
 
static QString GetAbsThumbPath (const QString &devPath, const QString &path)
 Get absolute filepath for thumbnail of an image. More...
 
static QString ThumbPath (const ImageItem &im)
 Thumbnails of videos are a JPEG snapshot with jpg suffix appended. More...
 

Protected Member Functions

int ImageId (int id) const
 
QString ImageId (const QString &id) const
 
int DbId (int id) const
 
QString DbIds (const QString &ids) const
 
- Protected Member Functions inherited from ImageAdapterBase
 ImageAdapterBase ()
 Constructor. More...
 
virtual ~ImageAdapterBase ()=default
 
- Protected Member Functions inherited from DeviceManager
int OpenDevice (const QString &name, const QString &mount, MythMediaDevice *media=nullptr, QTemporaryDir *dir=nullptr)
 Define a new device and assign it a unique id. If the device is already known, its existing id is returned. More...
 
int LocateMount (const QString &mount) const
 Find the id of a device. More...
 
StringMap GetDeviceDirs () const
 Get all known devices. More...
 
QList< int > GetAbsentees ()
 Get list of mountpoints for non-import devices. More...
 
 DeviceManager ()
 
 ~DeviceManager ()
 

Private Attributes

QString m_hostname
 Host of SG. More...
 
int m_hostport
 
StorageGroup m_sg
 Images storage group. More...
 

Detailed Description

Filesystem adapter for Backend, managing Photographs storage group.

Scanner will scan SG. Creates images with positive ids and relative filepaths Thumbnails are stored in Temp SG.

Definition at line 223 of file imagemanager.h.

Constructor & Destructor Documentation

◆ ImageAdapterSg()

ImageAdapterSg::ImageAdapterSg ( )
inline

Definition at line 226 of file imagemanager.h.

Member Function Documentation

◆ CreateItem()

ImageItem * ImageAdapterSg::CreateItem ( const QFileInfo &  fi,
int  parentId,
int  devId,
const QString &  base 
) const

Construct a remote image from a file.

Parameters
fiFile
parentIdId of the parent dir
devIdUnused
baseSG dir path
Returns
ImageItem An image object

Definition at line 410 of file imagemanager.cpp.

◆ GetScanDirs()

StringMap ImageAdapterSg::GetScanDirs ( ) const

Returns SG dirs.

Returns
StringMap Map <Arbitrary id, Device Path>

Definition at line 474 of file imagemanager.cpp.

◆ GetAbsFilePath()

QString ImageAdapterSg::GetAbsFilePath ( const ImagePtrK im) const

Get absolute filepath for a remote image.

For the SG node the path of SG dir with most space is returned

Parameters
imImage
Returns
QString Absolute filepath

Definition at line 490 of file imagemanager.cpp.

◆ MakeFileUrl()

QString ImageAdapterSg::MakeFileUrl ( const QString &  path) const
inline

Construct URL of a remote image.

Definition at line 237 of file imagemanager.h.

◆ MakeThumbUrl()

QString ImageAdapterSg::MakeThumbUrl ( const QString &  devPath,
const QString &  path = "" 
) const
inline

Construct URL of the thumbnail of a remote image.

Definition at line 242 of file imagemanager.h.

◆ Notify()

void ImageAdapterSg::Notify ( const QString &  mesg,
const QStringList &  extra 
)
static

Send message to all clients about remote ids.

Parameters
mesgMessage name
extraMessage data

Definition at line 463 of file imagemanager.cpp.

◆ ImageId() [1/2]

int ImageAdapterSg::ImageId ( int  id) const
inlineprotected

Definition at line 251 of file imagemanager.h.

◆ ImageId() [2/2]

QString ImageAdapterSg::ImageId ( const QString &  id) const
inlineprotected

Definition at line 252 of file imagemanager.h.

◆ DbId()

int ImageAdapterSg::DbId ( int  id) const
inlineprotected

Definition at line 253 of file imagemanager.h.

◆ DbIds()

QString ImageAdapterSg::DbIds ( const QString &  ids) const
inlineprotected

Definition at line 254 of file imagemanager.h.

Member Data Documentation

◆ m_hostname

QString ImageAdapterSg::m_hostname
private

Host of SG.

Definition at line 258 of file imagemanager.h.

Referenced by MakeFileUrl(), and MakeThumbUrl().

◆ m_hostport

int ImageAdapterSg::m_hostport
private

Definition at line 259 of file imagemanager.h.

Referenced by MakeFileUrl(), and MakeThumbUrl().

◆ m_sg

StorageGroup ImageAdapterSg::m_sg
mutableprivate

Images storage group.

Definition at line 262 of file imagemanager.h.

Referenced by GetAbsFilePath(), and GetScanDirs().


The documentation for this class was generated from the following files: