|
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 bool | remoteGetFileList (const QString &host, const QString &path, QStringList *list, QString sgroup, bool fileNamesOnly=false) |
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 48 of file storagegroup.cpp.
|
static |
Definition at line 708 of file storagegroup.cpp.
Referenced by run_backend().
|
static |
Definition at line 839 of file storagegroup.cpp.
Referenced by PBHEventHandler::PBHEventHandler(), and VideoDialog::VideoDialog().
| bool StorageGroup::FileExists | ( | const QString & | filename | ) |
Definition at line 355 of file storagegroup.cpp.
Referenced by GetFileInfo(), and ProgramInfo::GetPlaybackURL().
|
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 533 of file storagegroup.cpp.
Referenced by GetGroupToUse(), Init(), and ScanMusic().
| QString StorageGroup::FindFile | ( | const QString & | filename | ) |
Definition at line 594 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(), MainServer::HandleDeleteFile(), FileServerHandler::HandleDeleteFile(), MainServer::HandleMoveFile(), MainServer::HandleMusicTagAddImage(), MainServer::HandleMusicTagChangeImage(), MainServer::HandleQueryFileExists(), FileServerHandler::HandleQueryFileExists(), MainServer::HandleQueryFileHash(), FileServerHandler::HandleQueryFileHash(), MainServer::HandleQueryFindFile(), UPnpCDSTv::LoadRecordings(), UPnpCDSVideo::LoadVideos(), FileServerHandler::LocalFilePath(), MainServer::LocalFilePath(), HtmlServerExtension::ProcessRequest(), MetadataImageDownload::run(), PreviewGenerator::Run(), and VideoMetadata::VideoFileHash().
| QString StorageGroup::FindFileDir | ( | const QString & | filename | ) |
Definition at line 617 of file storagegroup.cpp.
Referenced by FindFile(), and FindFileDir().
| QString StorageGroup::FindNextDirMostFree | ( | void | ) |
Definition at line 663 of file storagegroup.cpp.
Referenced by V2Content::DownloadFile(), ExtractImage(), ImageAdapterSg::GetAbsFilePath(), DBUtil::GetBackupDirectory(), getLocalStorageGroupPath(), TVRec::GetProgramRingBufferForLiveTV(), FileServerHandler::HandleAnnounce(), MainServer::HandleAnnounce(), MainServer::HandleDownloadFile(), and FileServerHandler::HandleDownloadFile().
|
static |
Definition at line 879 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(), MythFrontendService::PlayVideo(), Frontend::PlayVideo(), VideoDialog::RemoteImageCheck(), MetadataOptions::SelectLocalBanner(), MetadataOptions::SelectLocalCoverart(), MetadataOptions::SelectLocalFanart(), SetArtwork(), VideoSetupWizard::testHDVideo(), VideoSetupWizard::testSDVideo(), UpdateHashes(), and VideoMetadata::VideoFileHash().
| QStringList StorageGroup::GetDirFileList | ( | const QString & | dir, |
| const QString & | base, | ||
| bool | recursive = false, |
||
| bool | onlyDirs = false |
||
| ) |
Definition at line 203 of file storagegroup.cpp.
Referenced by GetDirFileList(), GetDirList(), and GetFileList().
Definition at line 257 of file storagegroup.cpp.
|
inline |
Definition at line 23 of file storagegroup.h.
Referenced by ExtractImage(), Scheduler::FillRecordingDir(), DBUtil::GetBackupDirectory(), V2Content::GetDirList(), and ImageAdapterSg::GetScanDirs().
| QStringList StorageGroup::GetFileInfo | ( | const QString & | filename | ) |
Definition at line 381 of file storagegroup.cpp.
Referenced by FileServerHandler::HandleFileQuery(), and MainServer::HandleSGFileQuery().
| QStringList StorageGroup::GetFileInfoList | ( | const QString & | Path | ) |
Definition at line 290 of file storagegroup.cpp.
Referenced by FileServerHandler::HandleGetFileList(), MainServer::HandleSGGetFileList(), HttpConfig::ProcessRequest(), and anonymous_namespace{dirscan.cpp}::scan_sg_dir().
Definition at line 272 of file storagegroup.cpp.
Referenced by RemoteFile::FindFileList(), V2Content::GetFileList(), FileServerHandler::HandleGetFileList(), MainServer::HandleQueryFindFile(), and MainServer::HandleSGGetFileList().
Definition at line 190 of file storagegroup.cpp.
Referenced by HTTPLiveStream::HTTPLiveStream(), MythUIThemeHelper::InitThemeHelper(), HttpConfig::ProcessRequest(), and ThemeChooser::ThemeChooser().
|
static |
Definition at line 795 of file storagegroup.cpp.
Referenced by CDRipperThread::CDRipperThread(), GetVideoDirsByHost(), ImportMusicDialog::ImportMusicDialog(), Ripper::Ripper(), Ripper::setSaveHost(), and ImportMusicDialog::setSaveHost().
|
static |
Definition at line 845 of file storagegroup.cpp.
Referenced by generate_file_url(), and remoteGetFileList().
|
inline |
Definition at line 21 of file storagegroup.h.
|
static |
Definition at line 768 of file storagegroup.cpp.
Referenced by V2Dvr::GetRecStorageGroupList(), and StoreOptMixin::Load().
|
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 421 of file storagegroup.cpp.
Referenced by ProgramInfo::ClearMarkupMap(), ProgramInfo::ClearPositionMap(), doUpgradeVideoDatabaseSchema(), MainServer::HandleDownloadFile(), FileServerHandler::HandleDownloadFile(), ProgramInfo::QueryKeyFrameInfo(), ProgramInfo::QueryMarkup(), ProgramInfo::QueryMarkupMap(), ProgramInfo::QueryPositionMap(), ProgramInfo::QueryTotalFrames(), ProgramInfo::SaveMarkup(), ProgramInfo::SaveMarkupMap(), ProgramInfo::SavePositionMap(), ProgramInfo::SavePositionMapDelta(), ProgramInfo::SaveTotalDuration(), and ProgramInfo::SaveTotalFrames().
| 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 107 of file storagegroup.cpp.
Referenced by FileServerHandler::LocalFilePath(), MainServer::LocalFilePath(), and StorageGroup().
|
static |
Definition at line 888 of file storagegroup.cpp.
Referenced by VideoDialog::GetCoverImage(), anonymous_namespace{videodlg.cpp}::GetLocalVideoImage(), and anonymous_namespace{dirscan.cpp}::scan_sg_dir().
|
staticprivate |
Definition at line 61 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 getRecordingsGroups(), StorageGroupListEditor::Load(), FileServerHandler::QueryFileSystems(), StorageGroupEditor::SetLabel(), StorageGroupEditor::ShowDeleteDialog(), and ProgramInfo::ToMap().
|
private |
Definition at line 71 of file storagegroup.h.
Referenced by FindFileDir(), FindNextDirMostFree(), Init(), and StorageGroup().
|
staticprivate |
Definition at line 74 of file storagegroup.h.
Referenced by FindDirs(), GetRelativePathname(), Init(), and StaticInit().
|
private |
Definition at line 72 of file storagegroup.h.
Referenced by FileExists(), FindFileDir(), FindNextDirMostFree(), GetDirList(), GetFileInfoList(), GetFileList(), GetFirstDir(), Init(), and StorageGroup().
|
private |
Definition at line 69 of file storagegroup.h.
Referenced by CheckAllStorageGroupDirs(), FindFileDir(), Init(), and StorageGroup().
|
private |
Definition at line 70 of file storagegroup.h.
Referenced by Init(), and StorageGroup().
Definition at line 66 of file storagegroup.h.
Referenced by StaticInit().
|
staticprivate |
Definition at line 67 of file storagegroup.h.
Referenced by StaticInit().
|
staticprivate |
Definition at line 77 of file storagegroup.h.
Referenced by ClearGroupToUseCache(), and GetGroupToUse().
|
staticprivate |
Definition at line 76 of file storagegroup.h.
Referenced by ClearGroupToUseCache(), and GetGroupToUse().