Ticket #7306: mythcommflag_video_cutlist.diff
File mythcommflag_video_cutlist.diff, 3.8 KB (added by , 15 years ago) |
---|
-
programs/mythcommflag/main.cpp
230 230 return COMMFLAG_EXIT_NO_ERROR_WITH_NO_BREAKS; 231 231 } 232 232 233 int SetCutList(QString chanid, QString starttime, QString newCutList) 233 int SetCutList(QString chanid, QString starttime, QString newCutList, 234 ProgramInfo *pginfo=NULL) 234 235 { 235 236 QMap<long long, int> cutlist; 236 237 … … 245 246 cutlist[cutpair[1].toInt()] = MARK_CUT_END; 246 247 } 247 248 248 ProgramInfo *pginfo = 249 ProgramInfo::GetProgramFromRecorded(chanid, starttime); 249 if (pginfo == NULL) 250 { 251 pginfo = ProgramInfo::GetProgramFromRecorded(chanid, starttime); 250 252 251 if (!pginfo) 252 { 253 VERBOSE(VB_IMPORTANT, 254 QString("No program data exists for channel %1 at %2") 255 .arg(chanid).arg(starttime)); 256 return COMMFLAG_BUGGY_EXIT_NO_CHAN_DATA; 253 if (!pginfo) 254 { 255 VERBOSE(VB_IMPORTANT, 256 QString("No program data exists for channel %1 at %2") 257 .arg(chanid).arg(starttime)); 258 return COMMFLAG_BUGGY_EXIT_NO_CHAN_DATA; 259 } 257 260 } 258 261 259 262 pginfo->SetCutList(cutlist); … … 263 266 return COMMFLAG_EXIT_NO_ERROR_WITH_NO_BREAKS; 264 267 } 265 268 266 int GetMarkupList(QString list, QString chanid, QString starttime) 269 int GetMarkupList(QString list, QString chanid, QString starttime, 270 ProgramInfo *pginfo=NULL) 267 271 { 268 272 QMap<long long, int> cutlist; 269 273 QMap<long long, int>::Iterator it; 270 274 QString result; 271 275 272 ProgramInfo *pginfo = 273 ProgramInfo::GetProgramFromRecorded(chanid, starttime); 276 if (pginfo == NULL) 277 { 278 pginfo = ProgramInfo::GetProgramFromRecorded(chanid, starttime); 274 279 275 if (!pginfo) 276 { 277 VERBOSE(VB_IMPORTANT, 278 QString("No program data exists for channel %1 at %2") 279 .arg(chanid).arg(starttime)); 280 return COMMFLAG_BUGGY_EXIT_NO_CHAN_DATA; 280 if (!pginfo) 281 { 282 VERBOSE(VB_IMPORTANT, 283 QString("No program data exists for channel %1 at %2") 284 .arg(chanid).arg(starttime)); 285 return COMMFLAG_BUGGY_EXIT_NO_CHAN_DATA; 286 } 281 287 } 282 288 283 289 if (list == "cutlist") … … 1235 1241 if (copyToCutlist) 1236 1242 return CopySkipListToCutList(chanid, starttime); 1237 1243 1238 if (clearCutlist )1244 if (clearCutlist && !isVideo) 1239 1245 return SetCutList(chanid, starttime, ""); 1240 1246 1241 if (!newCutList.isEmpty() )1247 if (!newCutList.isEmpty() && !isVideo) 1242 1248 return SetCutList(chanid, starttime, newCutList); 1243 1249 1244 if (getCutlist )1250 if (getCutlist && !isVideo) 1245 1251 return GetMarkupList("cutlist", chanid, starttime); 1246 1252 1247 1253 if (getSkipList) … … 1309 1315 cerr << "------ -------------- " 1310 1316 "----------------------------------------- ------\n"; 1311 1317 } 1312 else 1318 else if (newCutList.isEmpty() && !clearCutlist && !getCutlist) 1313 1319 { 1314 1320 cerr << "Building seek table for: " 1315 1321 << filename.toLocal8Bit().constData() << endl; … … 1328 1334 else 1329 1335 pginfo->pathname = QFileInfo(filename).absoluteFilePath(); 1330 1336 1331 result = BuildVideoMarkup(pginfo, useDB); 1337 if (!newCutList.isEmpty()) 1338 result = SetCutList(chanid, starttime, newCutList, pginfo); 1339 else if (clearCutlist) 1340 result = SetCutList(chanid, starttime, "", pginfo); 1341 else if (getCutlist) 1342 result = GetMarkupList("cutlist", chanid, starttime, pginfo); 1343 else 1344 result = BuildVideoMarkup(pginfo, useDB); 1332 1345 1333 1346 delete pginfo; 1334 1347 }