MythTV  master
Public Member Functions | Static Public Member Functions | Static 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...
 

Static Protected Member Functions

static int ImageId (int id)
 
static QString ImageId (const QString &id)
 
static int DbId (int id)
 
static QString DbIds (const QString &ids)
 

Private Attributes

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

Additional Inherited Members

- 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 ()=default
 
 ~DeviceManager ()
 

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 230 of file imagemanager.h.

Constructor & Destructor Documentation

◆ ImageAdapterSg()

ImageAdapterSg::ImageAdapterSg ( )
inline

Definition at line 233 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 412 of file imagemanager.cpp.

◆ GetScanDirs()

StringMap ImageAdapterSg::GetScanDirs ( ) const

Returns SG dirs.

Returns
StringMap Map <Arbitrary id, Device Path>

Definition at line 472 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 489 of file imagemanager.cpp.

◆ MakeFileUrl()

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

Construct URL of a remote image.

Definition at line 244 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 249 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 461 of file imagemanager.cpp.

◆ ImageId() [1/2]

static int ImageAdapterSg::ImageId ( int  id)
inlinestaticprotected

Definition at line 258 of file imagemanager.h.

◆ ImageId() [2/2]

static QString ImageAdapterSg::ImageId ( const QString &  id)
inlinestaticprotected

Definition at line 259 of file imagemanager.h.

◆ DbId()

static int ImageAdapterSg::DbId ( int  id)
inlinestaticprotected

Definition at line 260 of file imagemanager.h.

◆ DbIds()

static QString ImageAdapterSg::DbIds ( const QString &  ids)
inlinestaticprotected

Definition at line 261 of file imagemanager.h.

Member Data Documentation

◆ m_hostname

QString ImageAdapterSg::m_hostname
private

Host of SG.

Definition at line 265 of file imagemanager.h.

Referenced by MakeFileUrl(), and MakeThumbUrl().

◆ m_hostport

int ImageAdapterSg::m_hostport
private

Definition at line 266 of file imagemanager.h.

Referenced by MakeFileUrl(), and MakeThumbUrl().

◆ m_sg

StorageGroup ImageAdapterSg::m_sg
mutableprivate

Images storage group.

Definition at line 269 of file imagemanager.h.

Referenced by GetAbsFilePath(), and GetScanDirs().


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