9#include <QScopedPointer>
27 QString timedate = QString(
"%1 - %2")
39#if QT_VERSION < QT_VERSION_CHECK(6,0,0)
40 int maxll = std::max(title.length(), 20);
42 int maxll = std::max(title.length(),
static_cast<qsizetype
>(20));
44 if (extra.length() > maxll)
45 extra = extra.left(maxll - 3) +
"...";
48 return QString(
"%1%2 - %3").arg(title, extra, timedate);
53 std::cout <<
"Checking Recordings" << std::endl;
56 std::vector<ProgramInfo *> missingRecordings;
57 std::vector<ProgramInfo *> zeroByteRecordings;
58 std::vector<ProgramInfo *> noSeektableRecordings;
62 std::cout <<
"ERROR - failed to get recording list from backend" << std::endl;
68 std::cout <<
"Fix seektable is: " << fixSeektable << std::endl;
70 if (!recordingList->empty())
72 for (
auto i = recordingList->begin(); i != recordingList->end(); ++i)
76 if (
p->GetRecordingGroup() ==
"LiveTV" ||
77 p->GetRecordingGroup() ==
"Deleted")
79 i = recordingList->erase(i);
85 bool foundFile =
true;
87 QString url =
p->GetPlaybackURL();
89 if (url.startsWith(
'/'))
94 std::cout <<
"File not found" << std::endl;
95 missingRecordings.push_back(
p);
102 std::cout <<
"File was found but has zero length" << std::endl;
103 zeroByteRecordings.push_back(
p);
107 else if (url.startsWith(
"myth:"))
111 std::cout <<
"File not found" << std::endl;
112 missingRecordings.push_back(
p);
120 std::cout <<
"File was found but has zero length" << std::endl;
121 zeroByteRecordings.push_back(
p);
128 if (posMap.isEmpty())
130 if (posMap.isEmpty())
133 if (posMap.isEmpty())
135 std::cout <<
"No seektable found" << std::endl;
137 noSeektableRecordings.push_back(
p);
139 if (foundFile && fixSeektable)
142 QString(
"--rebuild --chanid %1 --starttime %2")
145 std::cout <<
"Running - " << qPrintable(command) << std::endl;
150 std::cout <<
"ERROR - mythcommflag exited with result: " << cmd.data()->GetExitCode() << std::endl;
155 std::cout <<
"-------------------------------------------------------------------" << std::endl;
159 if (!missingRecordings.empty())
161 std::cout << std::endl << std::endl;
162 std::cout <<
"MISSING RECORDINGS" << std::endl;
163 std::cout <<
"------------------" << std::endl;
164 for (
auto *
p : missingRecordings)
167 std::cout << qPrintable(
p->GetPlaybackURL()) << std::endl;
168 std::cout <<
"-------------------------------------------------------------------" << std::endl;
172 if (!zeroByteRecordings.empty())
174 std::cout << std::endl << std::endl;
175 std::cout <<
"ZERO BYTE RECORDINGS" << std::endl;
176 std::cout <<
"--------------------" << std::endl;
177 for (
auto *
p : zeroByteRecordings)
180 std::cout << qPrintable(
p->GetPlaybackURL()) << std::endl;
181 std::cout <<
"-------------------------------------------------------------------" << std::endl;
185 if (!noSeektableRecordings.empty())
187 std::cout << std::endl << std::endl;
188 std::cout <<
"NO SEEKTABLE RECORDINGS" << std::endl;
189 std::cout <<
"-----------------------" << std::endl;
190 for (
auto *
p : noSeektableRecordings)
193 std::cout << qPrintable(
p->GetPlaybackURL()) << std::endl;
195 std::cout <<
"-------------------------------------------------------------------" << std::endl;
199 std::cout << std::endl << std::endl <<
"SUMMARY" << std::endl;
200 std::cout <<
"Recordings : " << recordingList->size() << std::endl;
201 std::cout <<
"Missing Recordings : " << missingRecordings.size() << std::endl;
202 std::cout <<
"Zero byte Recordings : " << zeroByteRecordings.size() << std::endl;
203 std::cout <<
"Missing Seektables : " << noSeektableRecordings.size() << std::endl;
bool toBool(const QString &key) const
Returns stored QVariant as a boolean.
static MythSystem * Create(const QStringList &args, uint flags=kMSNone, const QString &startPath=QString(), Priority cpuPriority=kInheritPriority, Priority diskPriority=kInheritPriority)
Holds information on recordings and videos.
QString GetTitle(void) const
QDateTime GetRecordingStartTime(void) const
Approximate time the recording started.
QDateTime GetRecordingEndTime(void) const
Approximate time the recording should have ended, did end, or is intended to end.
QString GetSubtitle(void) const
static bool Exists(const QString &url, struct stat *fileinfo)
long long GetFileSize(void) const
GetFileSize: returns the remote file's size at the time it was first opened Will query the server in ...
@ GENERIC_EXIT_OK
Exited with no error.
@ GENERIC_EXIT_NOT_OK
Exited with error.
MythCommFlagCommandLineParser cmdline
QString GetAppBinDir(void)
QMap< QString, UtilFunc > UtilMap
QString toString(const QDateTime &raw_dt, uint format)
Returns formatted string representing the time.
@ kDateTimeFull
Default local time.
@ kSimplify
Do Today/Yesterday/Tomorrow transform.
@ kTime
Default local time.
MBASE_PUBLIC QString formatBytes(int64_t sizeB, int prec=1)
QMap< long long, long long > frm_pos_map_t
Frame # -> File offset map.
void registerRecordingUtils(UtilMap &utilMap)
static QString CreateProgramInfoString(const ProgramInfo &pginfo)
static int CheckRecordings(const MythUtilCommandLineParser &cmdline)
std::vector< ProgramInfo * > * RemoteGetRecordedList(int sort)