Go to the documentation of this file.
7 #include <QWaitCondition>
45 void run(
void)
override;
66 explicit AutoExpire(QMap<int, EncoderLink *> *tvList);
79 static void Update(
int encoder,
int fsID,
bool immediately);
80 static void Update(
bool immediately) {
Update(0, -1, immediately); }
103 void Sleep(std::chrono::milliseconds sleepTime);
108 uint chanid,
const QDateTime &recstartts);
QWaitCondition m_instanceCond
void PrintExpireList(const QString &expHost="ALL")
Prints a summary of the files that can be deleted.
ExpireThread(AutoExpire *p)
Provides an interface to both local and remote TVRec's for the mythbackend.
static bool IsInExpireList(const pginfolist_t &expireList, uint chanid, const QDateTime &recstartts)
static void Update(int encoder, int fsID, bool immediately)
This is used to update the global AutoExpire instance "expirer".
bool wait(std::chrono::milliseconds time=std::chrono::milliseconds::max())
Wait for the MThread to exit, with a maximum timeout.
QPointer< AutoExpire > m_parent
static void ClearExpireList(pginfolist_t &expireList, bool deleteProg=true)
Clears expireList, freeing any ProgramInfo's if necessary.
Used to expire recordings to make space for new recordings.
void ExpireOldDeleted(void)
This expires deleted programs older than DeletedMaxAge.
void ExpireEpisodesOverMax(void)
This deletes programs exceeding the maximum number of episodes of that program desired....
void GetAllExpiring(QStringList &strList)
Gets the full list of programs that can expire in expiration order.
void run(void) override
This calls AutoExpire::RunExpirer() from within a new thread.
QMap< int, int64_t > m_desiredSpace
UpdateEntry(int _encoder, int _fsID)
void Sleep(std::chrono::milliseconds sleepTime)
Sleeps for sleepTime milliseconds; unless the expire thread is told to quit.
QMap< int, int > m_usedEncoders
void ExpireRecordings(void)
This expires normal recordings.
bool IsInDontExpireSet(uint chanid, const QDateTime &recstartts) const
std::vector< ProgramInfo * > pginfolist_t
void SetMainServer(MainServer *ms)
static void SendDeleteMessages(pginfolist_t &deleteList)
This sends delete message to main event thread.
void FillExpireList(pginfolist_t &expireList)
Uses the "AutoExpireMethod" setting in the database to fill the list of files that are deletable.
QSet< QString > m_dontExpireSet
@ emNormalDeletedPrograms
void RunExpirer(void)
This contains the main loop for the auto expire process.
Holds information on recordings and videos.
void FillDBOrdered(pginfolist_t &expireList, int expMethod)
Creates a list of programs to delete using the database to order list.
ExpireThread * m_expireThread
~AutoExpire() override
AutoExpire destructor stops auto delete thread if it is running.
This is a wrapper around QThread that does several additional things.
MainServer * m_mainServer
void ExpireQuickDeleted(void)
This expires deleted programs within a few minutes.
void ExpireLiveTV(int type)
This expires LiveTV programs.
uint64_t GetDesiredSpace(int fsID) const
Used by the scheduler to select the next recording dir.
QMap< int, EncoderLink * > * m_encoderList
std::vector< EncoderLink * > enclinklist_t
QQueue< UpdateEntry > m_updateQueue
void UpdateDontExpireSet(void)
static void Update(bool immediately)