9 #include <QScopedPointer>
28 QString timedate = QString(
"%1 - %2")
40 int maxll = std::max(
static_cast<int>(title.length()), 20);
41 if (extra.length() > maxll)
42 extra = extra.left(maxll - 3) +
"...";
45 return QString(
"%1%2 - %3").arg(title, extra, timedate);
50 std::cout <<
"Checking Recordings" << std::endl;
53 std::vector<ProgramInfo *> missingRecordings;
54 std::vector<ProgramInfo *> zeroByteRecordings;
55 std::vector<ProgramInfo *> noSeektableRecordings;
59 std::cout <<
"ERROR - failed to get recording list from backend" << std::endl;
65 std::cout <<
"Fix seektable is: " << fixSeektable << std::endl;
67 if (!recordingList->empty())
69 for (
auto i = recordingList->begin(); i != recordingList->end(); ++i)
73 if (
p->GetRecordingGroup() ==
"LiveTV" ||
74 p->GetRecordingGroup() ==
"Deleted")
76 i = recordingList->erase(i);
82 bool foundFile =
true;
84 QString url =
p->GetPlaybackURL();
86 if (url.startsWith(
'/'))
91 std::cout <<
"File not found" << std::endl;
92 missingRecordings.push_back(
p);
99 std::cout <<
"File was found but has zero length" << std::endl;
100 zeroByteRecordings.push_back(
p);
104 else if (url.startsWith(
"myth:"))
108 std::cout <<
"File not found" << std::endl;
109 missingRecordings.push_back(
p);
117 std::cout <<
"File was found but has zero length" << std::endl;
118 zeroByteRecordings.push_back(
p);
125 if (posMap.isEmpty())
127 if (posMap.isEmpty())
130 if (posMap.isEmpty())
132 std::cout <<
"No seektable found" << std::endl;
134 noSeektableRecordings.push_back(
p);
136 if (foundFile && fixSeektable)
139 QString(
"--rebuild --chanid %1 --starttime %2")
142 std::cout <<
"Running - " << qPrintable(command) << std::endl;
147 std::cout <<
"ERROR - mythcommflag exited with result: " << cmd.data()->GetExitCode() << std::endl;
152 std::cout <<
"-------------------------------------------------------------------" << std::endl;
156 if (!missingRecordings.empty())
158 std::cout << std::endl << std::endl;
159 std::cout <<
"MISSING RECORDINGS" << std::endl;
160 std::cout <<
"------------------" << std::endl;
161 for (
auto *
p : missingRecordings)
164 std::cout << qPrintable(
p->GetPlaybackURL()) << std::endl;
165 std::cout <<
"-------------------------------------------------------------------" << std::endl;
169 if (!zeroByteRecordings.empty())
171 std::cout << std::endl << std::endl;
172 std::cout <<
"ZERO BYTE RECORDINGS" << std::endl;
173 std::cout <<
"--------------------" << std::endl;
174 for (
auto *
p : zeroByteRecordings)
177 std::cout << qPrintable(
p->GetPlaybackURL()) << std::endl;
178 std::cout <<
"-------------------------------------------------------------------" << std::endl;
182 if (!noSeektableRecordings.empty())
184 std::cout << std::endl << std::endl;
185 std::cout <<
"NO SEEKTABLE RECORDINGS" << std::endl;
186 std::cout <<
"-----------------------" << std::endl;
187 for (
auto *
p : noSeektableRecordings)
190 std::cout << qPrintable(
p->GetPlaybackURL()) << std::endl;
192 std::cout <<
"-------------------------------------------------------------------" << std::endl;
196 std::cout << std::endl << std::endl <<
"SUMMARY" << std::endl;
197 std::cout <<
"Recordings : " << recordingList->size() << std::endl;
198 std::cout <<
"Missing Recordings : " << missingRecordings.size() << std::endl;
199 std::cout <<
"Zero byte Recordings : " << zeroByteRecordings.size() << std::endl;
200 std::cout <<
"Missing Seektables : " << noSeektableRecordings.size() << std::endl;