9 #include <QScopedPointer>
28 QString timedate = QString(
"%1 - %2")
40 #if QT_VERSION < QT_VERSION_CHECK(6,0,0)
41 int maxll = std::max(title.length(), 20);
43 int maxll = std::max(title.length(), 20LL);
45 if (extra.length() > maxll)
46 extra = extra.left(maxll - 3) +
"...";
49 return QString(
"%1%2 - %3").arg(title, extra, timedate);
54 std::cout <<
"Checking Recordings" << std::endl;
57 std::vector<ProgramInfo *> missingRecordings;
58 std::vector<ProgramInfo *> zeroByteRecordings;
59 std::vector<ProgramInfo *> noSeektableRecordings;
63 std::cout <<
"ERROR - failed to get recording list from backend" << std::endl;
69 std::cout <<
"Fix seektable is: " << fixSeektable << std::endl;
71 if (!recordingList->empty())
73 for (
auto i = recordingList->begin(); i != recordingList->end(); ++i)
77 if (
p->GetRecordingGroup() ==
"LiveTV" ||
78 p->GetRecordingGroup() ==
"Deleted")
80 i = recordingList->erase(i);
86 bool foundFile =
true;
88 QString url =
p->GetPlaybackURL();
90 if (url.startsWith(
'/'))
95 std::cout <<
"File not found" << std::endl;
96 missingRecordings.push_back(
p);
103 std::cout <<
"File was found but has zero length" << std::endl;
104 zeroByteRecordings.push_back(
p);
108 else if (url.startsWith(
"myth:"))
112 std::cout <<
"File not found" << std::endl;
113 missingRecordings.push_back(
p);
121 std::cout <<
"File was found but has zero length" << std::endl;
122 zeroByteRecordings.push_back(
p);
129 if (posMap.isEmpty())
131 if (posMap.isEmpty())
134 if (posMap.isEmpty())
136 std::cout <<
"No seektable found" << std::endl;
138 noSeektableRecordings.push_back(
p);
140 if (foundFile && fixSeektable)
143 QString(
"--rebuild --chanid %1 --starttime %2")
146 std::cout <<
"Running - " << qPrintable(command) << std::endl;
151 std::cout <<
"ERROR - mythcommflag exited with result: " << cmd.data()->GetExitCode() << std::endl;
156 std::cout <<
"-------------------------------------------------------------------" << std::endl;
160 if (!missingRecordings.empty())
162 std::cout << std::endl << std::endl;
163 std::cout <<
"MISSING RECORDINGS" << std::endl;
164 std::cout <<
"------------------" << std::endl;
165 for (
auto *
p : missingRecordings)
168 std::cout << qPrintable(
p->GetPlaybackURL()) << std::endl;
169 std::cout <<
"-------------------------------------------------------------------" << std::endl;
173 if (!zeroByteRecordings.empty())
175 std::cout << std::endl << std::endl;
176 std::cout <<
"ZERO BYTE RECORDINGS" << std::endl;
177 std::cout <<
"--------------------" << std::endl;
178 for (
auto *
p : zeroByteRecordings)
181 std::cout << qPrintable(
p->GetPlaybackURL()) << std::endl;
182 std::cout <<
"-------------------------------------------------------------------" << std::endl;
186 if (!noSeektableRecordings.empty())
188 std::cout << std::endl << std::endl;
189 std::cout <<
"NO SEEKTABLE RECORDINGS" << std::endl;
190 std::cout <<
"-----------------------" << std::endl;
191 for (
auto *
p : noSeektableRecordings)
194 std::cout << qPrintable(
p->GetPlaybackURL()) << std::endl;
196 std::cout <<
"-------------------------------------------------------------------" << std::endl;
200 std::cout << std::endl << std::endl <<
"SUMMARY" << std::endl;
201 std::cout <<
"Recordings : " << recordingList->size() << std::endl;
202 std::cout <<
"Missing Recordings : " << missingRecordings.size() << std::endl;
203 std::cout <<
"Zero byte Recordings : " << zeroByteRecordings.size() << std::endl;
204 std::cout <<
"Missing Seektables : " << noSeektableRecordings.size() << std::endl;