MythTV
master
|
#include <libmythbase/storagegroup.h>
Public Member Functions | |
StorageGroup (QString group="", QString hostname="", bool allowFallback=true) | |
StorageGroup constructor. More... | |
void | Init (const QString &group="Default", const QString &hostname="", bool allowFallback=true) |
Initilizes the groupname, hostname, and dirlist. More... | |
QString | getName (void) const |
QStringList | GetDirList (void) const |
QString | GetFirstDir (bool appendSlash=false) const |
QStringList | GetDirFileList (const QString &dir, const QString &base, bool recursive=false, bool onlyDirs=false) |
QStringList | GetDirList (const QString &Path, bool recursive=false) |
QStringList | GetFileList (const QString &Path, bool recursive=false) |
QStringList | GetFileInfoList (const QString &Path) |
bool | FileExists (const QString &filename) |
QStringList | GetFileInfo (const QString &filename) |
QString | FindFile (const QString &filename) |
QString | FindFileDir (const QString &filename) |
QString | FindNextDirMostFree (void) |
Static Public Member Functions | |
static QString | GetRelativePathname (const QString &filename) |
Returns the relative pathname of a file by comparing the filename against all Storage Group directories (and MythVideo's startupdir) More... | |
static bool | FindDirs (const QString &group="Default", const QString &hostname="", QStringList *dirlist=nullptr) |
Finds and and optionally initialize a directory list associated with a Storage Group. More... | |
static void | CheckAllStorageGroupDirs (void) |
static QStringList | getRecordingsGroups (void) |
static QStringList | getGroupDirs (const QString &groupname, const QString &host) |
static void | ClearGroupToUseCache (void) |
static QString | GetGroupToUse (const QString &host, const QString &sgroup) |
static QString | generate_file_url (const QString &storage_group, const QString &host, const QString &path) |
Static Public Attributes | |
static const char * | kDefaultStorageDir = "/mnt/store" |
static const QStringList | kSpecialGroups |
Static Private Member Functions | |
static void | StaticInit (void) |
Private Attributes | |
QString | m_groupname |
QString | m_hostname |
bool | m_allowFallback |
QStringList | m_dirlist |
Static Private Attributes | |
static bool | m_staticInitDone = false |
static QMutex | m_staticInitLock |
static QMap< QString, QString > | m_builtinGroups |
static QMutex | s_groupToUseLock |
static QHash< QString, QString > | s_groupToUseCache |
Definition at line 11 of file storagegroup.h.
|
explicit |
StorageGroup constructor.
group | storage group to search, blank will search all groups. |
hostname | hostname where to search, blank will search all hosts' directories, but only in local directory structure. This is parameter is ignored if group is an empty string. |
allowFallback | allow the storage group search code to fall back if no dirs exist for the specified group/host |
Definition at line 47 of file storagegroup.cpp.
void StorageGroup::Init | ( | const QString & | group = "Default" , |
const QString & | hostname = "" , |
||
bool | allowFallback = true |
||
) |
Initilizes the groupname, hostname, and dirlist.
First attempts to find the Storage Group defined with the specified name for the given host. If not found, checks for the named Storage Group, as defined across all hosts. If not found, tries the "Default" Storage Group for the given host. If not found, tries the "Default" Storage Group, as defined across all hosts.
group | The name of the Storage Group |
hostname | The host whose Storage Group definition is desired |
allowFallback | allow the storage group search code to fall back if no dirs exist for the specified group/host |
Definition at line 106 of file storagegroup.cpp.
Referenced by FileServerHandler::LocalFilePath(), MainServer::LocalFilePath(), and StorageGroup().
|
inline |
Definition at line 21 of file storagegroup.h.
|
inline |
Definition at line 23 of file storagegroup.h.
Referenced by ExtractImage(), Scheduler::FillRecordingDir(), DBUtil::GetBackupDirectory(), V2Content::GetDirList(), and ImageAdapterSg::GetScanDirs().
Definition at line 189 of file storagegroup.cpp.
Referenced by HTTPLiveStream::HTTPLiveStream(), MythUIThemeHelper::InitThemeHelper(), HttpConfig::ProcessRequest(), and ThemeChooser::ThemeChooser().
QStringList StorageGroup::GetDirFileList | ( | const QString & | dir, |
const QString & | base, | ||
bool | recursive = false , |
||
bool | onlyDirs = false |
||
) |
Definition at line 202 of file storagegroup.cpp.
Referenced by GetDirList(), and GetFileList().
Definition at line 256 of file storagegroup.cpp.
Definition at line 271 of file storagegroup.cpp.
Referenced by RemoteFile::FindFileList(), V2Content::GetFileList(), FileServerHandler::HandleGetFileList(), MainServer::HandleQueryFindFile(), and MainServer::HandleSGGetFileList().
QStringList StorageGroup::GetFileInfoList | ( | const QString & | Path | ) |
Definition at line 289 of file storagegroup.cpp.
Referenced by FileServerHandler::HandleGetFileList(), MainServer::HandleSGGetFileList(), HttpConfig::ProcessRequest(), and anonymous_namespace{dirscan.cpp}::scan_sg_dir().
bool StorageGroup::FileExists | ( | const QString & | filename | ) |
Definition at line 354 of file storagegroup.cpp.
Referenced by GetFileInfo(), and ProgramInfo::GetPlaybackURL().
QStringList StorageGroup::GetFileInfo | ( | const QString & | filename | ) |
Definition at line 380 of file storagegroup.cpp.
Referenced by FileServerHandler::HandleFileQuery(), and MainServer::HandleSGFileQuery().
|
static |
Returns the relative pathname of a file by comparing the filename against all Storage Group directories (and MythVideo's startupdir)
filename | The full pathname of the file to use |
Definition at line 420 of file storagegroup.cpp.
Referenced by ProgramInfo::ClearMarkupMap(), ProgramInfo::ClearPositionMap(), doUpgradeVideoDatabaseSchema(), FileServerHandler::HandleDownloadFile(), MainServer::HandleDownloadFile(), ProgramInfo::QueryKeyFrameInfo(), ProgramInfo::QueryMarkup(), ProgramInfo::QueryMarkupMap(), ProgramInfo::QueryPositionMap(), ProgramInfo::QueryTotalFrames(), ProgramInfo::SaveMarkup(), ProgramInfo::SaveMarkupMap(), ProgramInfo::SavePositionMap(), ProgramInfo::SavePositionMapDelta(), ProgramInfo::SaveTotalDuration(), and ProgramInfo::SaveTotalFrames().
|
static |
Finds and and optionally initialize a directory list associated with a Storage Group.
group | The name of the Storage Group |
hostname | The host whose directory list should be checked, first |
dirlist | Optional pointer to a QStringList to hold found dir list |
Definition at line 532 of file storagegroup.cpp.
Referenced by GetGroupToUse(), Init(), and ScanMusic().
QString StorageGroup::FindFile | ( | const QString & | filename | ) |
Definition at line 597 of file storagegroup.cpp.
Referenced by V2Video::AddVideo(), RemoteFile::Exists(), ExtractImage(), RemoteFile::FindFileList(), ImageAdapterSg::GetAbsFilePath(), V2Guide::GetChannelIcon(), V2Content::GetFile(), GetFileInfo(), V2Content::GetHash(), V2Content::GetImageFile(), MusicMetadata::getLocalFilename(), ProgramInfo::GetPlaybackURL(), V2Video::GetStreamInfo(), VideoSelector::getVideoListFromDB(), FileServerHandler::HandleDeleteFile(), MainServer::HandleDeleteFile(), MainServer::HandleMoveFile(), MainServer::HandleMusicTagAddImage(), MainServer::HandleMusicTagChangeImage(), FileServerHandler::HandleQueryFileExists(), MainServer::HandleQueryFileExists(), FileServerHandler::HandleQueryFileHash(), MainServer::HandleQueryFileHash(), MainServer::HandleQueryFindFile(), UPnpCDSTv::LoadRecordings(), UPnpCDSVideo::LoadVideos(), FileServerHandler::LocalFilePath(), MainServer::LocalFilePath(), HtmlServerExtension::ProcessRequest(), PreviewGenerator::Run(), MetadataImageDownload::run(), and VideoMetadata::VideoFileHash().
QString StorageGroup::FindFileDir | ( | const QString & | filename | ) |
Definition at line 620 of file storagegroup.cpp.
Referenced by FindFile(), and FindFileDir().
QString StorageGroup::FindNextDirMostFree | ( | void | ) |
Definition at line 666 of file storagegroup.cpp.
Referenced by V2Content::DownloadFile(), ExtractImage(), ImageAdapterSg::GetAbsFilePath(), DBUtil::GetBackupDirectory(), getLocalStorageGroupPath(), TVRec::GetProgramRingBufferForLiveTV(), FileServerHandler::HandleAnnounce(), MainServer::HandleAnnounce(), FileServerHandler::HandleDownloadFile(), and MainServer::HandleDownloadFile().
|
static |
Definition at line 724 of file storagegroup.cpp.
Referenced by run_backend().
|
static |
Definition at line 784 of file storagegroup.cpp.
Referenced by V2Dvr::GetRecStorageGroupList(), and StoreOptMixin::Load().
|
static |
Definition at line 811 of file storagegroup.cpp.
Referenced by CDRipperThread::CDRipperThread(), GetVideoDirsByHost(), ImportMusicDialog::ImportMusicDialog(), Ripper::Ripper(), ImportMusicDialog::setSaveHost(), and Ripper::setSaveHost().
|
static |
Definition at line 855 of file storagegroup.cpp.
Referenced by PBHEventHandler::PBHEventHandler(), and VideoDialog::VideoDialog().
|
static |
Definition at line 861 of file storagegroup.cpp.
Referenced by generate_file_url(), and RemoteGetFileList().
|
static |
Definition at line 895 of file storagegroup.cpp.
Referenced by VideoPlayerCommandPrivate::AltPlayerFor(), anonymous_namespace{videodlg.cpp}::CopyMetadataToUI(), VideoMetadataImp::DeleteFile(), NetBase::DoDownloadAndPlay(), EditMetadataDialog::fillWidgets(), EditMetadataDialog::FindBanner(), EditMetadataDialog::FindCoverArt(), EditMetadataDialog::FindFanart(), EditMetadataDialog::FindScreenshot(), EditMetadataDialog::FindTrailer(), GetArtwork(), VideoDialog::GetBanner(), VideoDialog::GetCoverImage(), VideoDialog::GetFanart(), VideoDialog::GetFirstImage(), VideoMetadataImp::GetImage(), VideoMetadataImp::GetImageMap(), VideoDialog::GetScreenshot(), VideoSelector::getVideoListFromDB(), MetadataFactory::Lookup(), VideoPlayerCommandPrivate::PlayerFor(), VideoDialog::playTrailer(), Frontend::PlayVideo(), MythFrontendService::PlayVideo(), VideoDialog::RemoteImageCheck(), MetadataOptions::SelectLocalBanner(), MetadataOptions::SelectLocalCoverart(), MetadataOptions::SelectLocalFanart(), SetArtwork(), VideoSetupWizard::testHDVideo(), VideoSetupWizard::testSDVideo(), UpdateHashes(), and VideoMetadata::VideoFileHash().
|
staticprivate |
Definition at line 60 of file storagegroup.cpp.
Referenced by FindDirs(), GetRelativePathname(), and Init().
|
static |
Definition at line 45 of file storagegroup.h.
Referenced by FindNextDirMostFree(), and Init().
|
static |
Definition at line 46 of file storagegroup.h.
Referenced by MainServer::BackendQueryDiskSpace(), getRecordingsGroups(), StorageGroupListEditor::Load(), FileServerHandler::QueryFileSystems(), StorageGroupEditor::SetLabel(), StorageGroupEditor::ShowDeleteDialog(), and ProgramInfo::ToMap().
Definition at line 61 of file storagegroup.h.
Referenced by StaticInit().
|
staticprivate |
Definition at line 62 of file storagegroup.h.
Referenced by StaticInit().
|
private |
Definition at line 64 of file storagegroup.h.
Referenced by CheckAllStorageGroupDirs(), FindFileDir(), Init(), and StorageGroup().
|
private |
Definition at line 65 of file storagegroup.h.
Referenced by Init(), and StorageGroup().
|
private |
Definition at line 66 of file storagegroup.h.
Referenced by FindFileDir(), FindNextDirMostFree(), Init(), and StorageGroup().
|
private |
Definition at line 67 of file storagegroup.h.
Referenced by FileExists(), FindFileDir(), FindNextDirMostFree(), GetDirList(), GetFileInfoList(), GetFileList(), GetFirstDir(), Init(), and StorageGroup().
|
staticprivate |
Definition at line 69 of file storagegroup.h.
Referenced by FindDirs(), GetRelativePathname(), Init(), and StaticInit().
|
staticprivate |
Definition at line 71 of file storagegroup.h.
Referenced by ClearGroupToUseCache(), and GetGroupToUse().
|
staticprivate |
Definition at line 72 of file storagegroup.h.
Referenced by ClearGroupToUseCache(), and GetGroupToUse().