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