Ticket #4327: eitfixup8.patch
File eitfixup8.patch, 8.3 KB (added by , 18 years ago) |
---|
-
libs/libmythtv/eitfixup.cpp
17 17 m_bellPPVDescriptionEventId("\\([0-9]{5}\\)"), 18 18 m_ukSubtitle("\\[.*S\\]"), 19 19 m_ukThen("\\s*(Then|Followed by) 60 Seconds\\.", false), 20 m_ukNew("\\s*(Brand New|New)\\s* Series\\s*[:\\.\\-]",false),20 m_ukNew("\\s*(Brand New|New)\\s*(Series|Episode)\\s*[:\\.\\-]",false), 21 21 m_ukNew1("^New\\."), 22 22 m_ukT4("^[tT]4:"), 23 23 m_ukEQ("[:\\!\\?]"), … … 34 34 m_uk24ep("^\\d{1,2}:00[ap]m to \\d{1,2}:00[ap]m: "), 35 35 m_ukStarring("(?:Western\\s)?[Ss]tarring ([\\w\\s\\-']+)[Aa]nd\\s([\\w\\s\\-']+)[\\.|,](?:\\s)*(\\d{4})?(?:\\.\\s)?"), 36 36 m_ukBBC7rpt("\\[Rptd?[^]]+\\d{1,2}\\.\\d{1,2}[ap]m\\]\\."), 37 m_ukCBBC("^CBBC ."),38 m_ukCBeebies("^CBeebies ."),39 m_ukStarring1("star(ring )"),37 m_ukCBBC("^CBBC\\s*[\\.]"), 38 m_ukCBeebies("^CBeebies\\s*[\\.]"), 39 m_ukStarring1("star(ring|s)"), 40 40 m_ukDoubleDotEnd("\\.\\.+$"), 41 41 m_ukDoubleDotStart("^\\.\\.+"), 42 42 m_ukDotSpaceStart("^\\. "), 43 m_ukTime("\\d{1,2}[\\.:]\\d{1,2}\\s*(am|pm|)"), 43 44 m_comHemCountry("^(\\(.+\\))?\\s?([^ ]+)\\s([^\\.0-9]+)" 44 45 "(?:\\sfrån\\s([0-9]{4}))(?:\\smed\\s([^\\.]+))?\\.?"), 45 46 m_comHemDirector("[Rr]egi"), … … 357 358 event.description = event.description.remove(m_ukNew1); 358 359 event.title = event.title.remove(m_ukT4); 359 360 361 // Removal of CBBC and CBeebies 362 event.description = event.description.remove(m_ukCBBC); 363 event.description = event.description.remove(m_ukCBeebies); 364 360 365 // BBC 7 [Rpt of ...] case. 361 366 event.description = event.description.remove(m_ukBBC7rpt); 362 367 368 event.title = event.title.stripWhiteSpace(); 369 event.description = event.description.stripWhiteSpace(); 370 363 371 QRegExp tmp24ep = m_uk24ep; 364 372 if (!event.title.startsWith("CSI:") && !event.title.startsWith("CD:")) 365 373 { … … 375 383 position1++; 376 384 event.title = strFull.left(position1); 377 385 event.description = strFull.mid(position1 + 1); 386 event.description = event.description.remove(m_ukNew1); 378 387 SetUKSubtitle(event); 379 388 } 380 389 if ((position1 = strFull.find(m_ukYear)) != -1) … … 385 394 event.description = event.title.mid(position1); 386 395 event.title = event.title.left(position1); 387 396 } 388 } 397 } 389 398 } 390 399 else if ((position1 = tmp24ep.search(event.description)) != -1) 391 400 { … … 395 404 tmp24ep.cap(0).length() - 2); 396 405 event.description = event.description.remove(tmp24ep.cap(0)); 397 406 } 398 else if (((position1 = event.title.find(m_ukColonHyphen)) != -1) && 399 (event.description.find(":") < 0 )) 407 else if ((position1 = event.description.find(m_ukTime)) == -1) 400 408 { 401 if ((uint)position1 < SUBTITLE_MAX_LEN) 409 if (((position1 = event.title.find(m_ukColonHyphen)) != -1) && 410 (event.description.find(":") < 0 )) 402 411 { 403 event.subtitle = event.title.mid(position1 + 1); 404 event.title = event.title.left(position1); 412 if ((uint)position1 < SUBTITLE_MAX_LEN) 413 { 414 event.subtitle = event.title.mid(position1 + 1); 415 event.title = event.title.left(position1); 416 } 405 417 } 418 else 419 SetUKSubtitle(event); 406 420 } 407 else408 SetUKSubtitle(event);409 421 } 410 422 411 if ( event.subtitle.isEmpty())423 if ((event.description.find(m_ukTime) == -1) && (event.subtitle.isEmpty())) 412 424 { 413 425 QStringList strList1 = QStringList::split(".",event.description,TRUE); 414 426 QStringList strList2 = QStringList::split("?",event.description,TRUE); … … 426 438 QStringList strList3 = strList2.grep("Drama",false); 427 439 QStringList strList4 = strList2.grep("sitcom",false); 428 440 QStringList strList5 = strList2.grep(m_ukStarring1); 441 QStringList strList6 = strList2.grep("Series",false); 429 442 if ((strList3.count()==0) && (strList4.count()==0) && 430 (strList5.count()==0) )443 (strList5.count()==0) && (strList6.count()==0)) 431 444 { 432 445 event.subtitle = strList1[0]+strEnd; 433 446 event.description= … … 468 481 QRegExp tmpExp3 = m_ukSeries3; 469 482 if ((position1 = tmpExp1.search(event.title)) != -1) 470 483 { 471 event.partnumber = tmpExp1.cap(1).toUInt(); 472 event.parttotal = tmpExp1.cap(2).toUInt(); 473 // Remove from the title 474 event.title = 475 event.title.mid(position1 + tmpExp1.cap(0).length()); 476 series = true; 484 if ((tmpExp1.cap(1).toUInt() != tmpExp1.cap(2).toUInt()) 485 && tmpExp1.cap(2).toUInt()<=50) 486 { 487 event.partnumber = tmpExp1.cap(1).toUInt(); 488 event.parttotal = tmpExp1.cap(2).toUInt(); 489 // Remove from the title 490 event.title = 491 event.title.mid(position1 + tmpExp1.cap(0).length()); 492 series = true; 493 } 477 494 } 478 495 else if ((position1 = tmpExp1.search(event.subtitle)) != -1) 479 496 { 480 event.partnumber = tmpExp1.cap(1).toUInt(); 481 event.parttotal = tmpExp1.cap(2).toUInt(); 482 // Remove from the sub title 483 event.subtitle = 484 event.subtitle.mid(position1 + tmpExp1.cap(0).length()); 485 series = true; 497 if ((tmpExp1.cap(1).toUInt() != tmpExp1.cap(2).toUInt()) 498 && tmpExp1.cap(2).toUInt()<=50) 499 { 500 event.partnumber = tmpExp1.cap(1).toUInt(); 501 event.parttotal = tmpExp1.cap(2).toUInt(); 502 // Remove from the sub title 503 event.subtitle = 504 event.subtitle.mid(position1 + tmpExp1.cap(0).length()); 505 series = true; 506 } 486 507 } 487 508 else if ((position1 = tmpExp1.search(event.description)) != -1) 488 509 { 489 event.partnumber = tmpExp1.cap(1).toUInt(); 490 event.parttotal = tmpExp1.cap(2).toUInt(); 491 series = true; 510 if ((tmpExp1.cap(1).toUInt() != tmpExp1.cap(2).toUInt()) 511 && tmpExp1.cap(2).toUInt()<=50) 512 { 513 event.partnumber = tmpExp1.cap(1).toUInt(); 514 event.parttotal = tmpExp1.cap(2).toUInt(); 515 // Remove from the description 516 event.description = 517 event.description.mid(position1+tmpExp1.cap(0).length()); 518 series = true; 519 } 492 520 } 493 521 else if ((position1 = tmpExp2.search(event.description)) != -1) 494 522 { 495 523 event.partnumber = tmpExp2.cap(2).toUInt(); 496 524 event.parttotal = tmpExp2.cap(3).toUInt(); 525 // Remove from the description 526 event.description = 527 event.description.mid(position1+tmpExp2.cap(0).length()); 497 528 series = true; 498 529 } 499 530 else if ((position1 = tmpExp3.search(event.description)) != -1) 500 531 { 501 532 event.partnumber = tmpExp3.cap(1).toUInt(); 502 533 event.parttotal = tmpExp3.cap(2).toUInt(); 534 // Remove from the description 535 event.description = 536 event.description.mid(position1+tmpExp3.cap(0).length()); 503 537 series = true; 504 538 } 505 539 if (series) … … 549 583 event.originalairdate = QDate(y, 1, 1); 550 584 } 551 585 552 // Remove spurious channel names553 event.subtitle = event.subtitle.remove(m_ukCBBC);554 event.description = event.description.remove(m_ukCBBC);555 event.subtitle = event.subtitle.remove(m_ukCBeebies);556 event.description = event.description.remove(m_ukCBeebies);557 558 586 // Trim trailing '.' 559 587 event.title.remove(m_ukPEnd); 560 588 event.subtitle.remove(m_ukPEnd); -
libs/libmythtv/eitfixup.h
103 103 const QRegExp m_ukDoubleDotEnd; 104 104 const QRegExp m_ukDoubleDotStart; 105 105 const QRegExp m_ukDotSpaceStart; 106 const QRegExp m_ukTime; 106 107 const QRegExp m_comHemCountry; 107 108 const QRegExp m_comHemDirector; 108 109 const QRegExp m_comHemActor;