41 | | m_comHemTSub("\\s+-\\s+([^\\-]+)") |
| 41 | m_comHemTSub("\\s+-\\s+([^\\-]+)"), |
| 42 | m_kdEpisode("[\\(]{1}[0-9]+[\\)]{1}"), |
| 43 | m_kdPartTotal("([0-9]+)\\s(?:Episoden|Folgen|Teile)"), |
| 44 | m_kdPartNumber("(?:Episode|Folge|Teil)\\s([0-9]+)"), |
| 45 | m_kdInfos("^([^;]+)\\*"), |
| 46 | m_kdOTitle("^(\\([^\\)]+\\))"), |
| 47 | m_kdSubtitle("^([^\\(\\)]+)"), |
| 48 | m_kdActors("(?:Mit|G[aä]st[e]?:)\\s(.+\\w+)\\s"), |
| 49 | m_kdDirector("R:\\s(.+)\\s"), |
| 50 | m_kdHost("(?:Moderation:|Presented by)\\s(.+)\\s"), |
| 51 | m_kdCategory("^([\\w-]+\\s?\\w*)(?: nach| mit| frei nach| von|$)"), |
| 52 | m_kdCatCountryYear("([\\w-]+\\s?\\w*)(?:(?: nach| mit| frei nach| von)[^,]+)?,\\s([A-Z/]+)(?:\\s([0-9-/]{4,}))?(?:,\\s[0-9]+\\sMinuten,?)?(?:,|\\s\\*|$|\\s)"), |
| 53 | m_prInfos("([^.]+)?\\s?([0-9]{4})\\.\\s[0-9]+\\sMin\\.(?:\\sVon\\s([^,]+)(?:,|\\su\\.\\sa\\.)\\smit\\s(.+)\\.)?") |
| 648 | |
| 649 | /** \fn EITFixUp::FixPro7Sat(DBEvent&) const |
| 650 | * \brief Use this to standardize DVB-C guide in Germany |
| 651 | * for the providers Kabel Deutschland and Premiere. |
| 652 | */ |
| 653 | void EITFixUp::FixPro7Sat(DBEvent &event) const |
| 654 | { |
| 655 | QString country = ""; |
| 656 | QString possible_subtitle = ""; |
| 657 | QString replacement = ""; |
| 658 | // Episodes |
| 659 | QRegExp tmpPartTotal = m_kdPartTotal; |
| 660 | if (tmpPartTotal.search(event.description)!= -1) |
| 661 | { |
| 662 | QStringList parttotal = tmpPartTotal.capturedTexts(); |
| 663 | event.parttotal = parttotal[1].toUInt(); |
| 664 | } |
| 665 | // Episode Number |
| 666 | QRegExp tmpPartNumber = m_kdPartNumber; |
| 667 | if (tmpPartNumber.search(event.description)!= -1) |
| 668 | { |
| 669 | QStringList partnumber = tmpPartNumber.capturedTexts(); |
| 670 | event.partnumber = partnumber[1].toUInt(); |
| 671 | } |
| 672 | // Find infos about Category, Country and Year (Kabel Deutschland) |
| 673 | QRegExp tmpCatCountryYear = m_kdCatCountryYear; |
| 674 | if ((tmpCatCountryYear.search(event.subtitle)!= -1)||(tmpCatCountryYear.search(event.description)!= -1)) |
| 675 | { |
| 676 | QStringList catcountryyear = tmpCatCountryYear.capturedTexts(); |
| 677 | if (event.category.isEmpty()) |
| 678 | event.category = catcountryyear[1]; |
| 679 | if (catcountryyear[2].length()>0) |
| 680 | country = catcountryyear[2]; |
| 681 | if (catcountryyear[3].length()>0) |
| 682 | event.airdate = catcountryyear[3]; |
| 683 | event.subtitle = event.subtitle.replace(catcountryyear[0],""); |
| 684 | event.description = event.description.replace(catcountryyear[0],""); |
| 685 | } |
| 686 | |
| 687 | // Find infos about Country, Credits and Year (Premiere) |
| 688 | QRegExp tmpInfos = m_prInfos; |
| 689 | if (tmpInfos.search(event.description)!=-1) |
| 690 | { |
| 691 | QStringList list = tmpInfos.capturedTexts(); |
| 692 | country = list[1]; |
| 693 | event.airdate = list[2]; |
| 694 | event.AddPerson(DBPerson::kDirector, list[3]); |
| 695 | QStringList actors = QStringList::split(", ", list[4]); |
| 696 | for(QStringList::size_type j=0;j<actors.count();j++) |
| 697 | event.AddPerson(DBPerson::kActor, actors[j]); |
| 698 | event.description = event.description.replace(list[0],""); |
| 699 | } |
| 700 | |
| 701 | // Find extra infos (category, credits, subtitle, original title) |
| 702 | tmpInfos = m_kdInfos; |
| 703 | if (tmpInfos.search(event.description)!=-1) |
| 704 | { |
| 705 | QStringList list = tmpInfos.capturedTexts(); |
| 706 | QStringList infos; |
| 707 | infos = QStringList::split("*", list[1]); |
| 708 | |
| 709 | QRegExp tmpDirector = m_kdDirector; |
| 710 | QRegExp tmpHost = m_kdHost; |
| 711 | QRegExp tmpActor = m_kdActors; |
| 712 | QRegExp tmpOTitle = m_kdOTitle; |
| 713 | QRegExp tmpCategory = m_kdCategory; |
| 714 | QRegExp tmpSubtitle = m_kdSubtitle; |
| 715 | |
| 716 | for(QStringList::size_type i=0;i<infos.count();i++) |
| 717 | { |
| 718 | if (tmpDirector.search(infos[i])!=-1) |
| 719 | { |
| 720 | QStringList director = tmpDirector.capturedTexts(); |
| 721 | event.AddPerson(DBPerson::kDirector, director[1]); |
| 722 | event.description = event.description.replace(infos[i]+"*",""); |
| 723 | } |
| 724 | else if (tmpHost.search(infos[i])!=-1) |
| 725 | { |
| 726 | QStringList host = tmpHost.capturedTexts(); |
| 727 | event.AddPerson(DBPerson::kHost, host[1]); |
| 728 | event.description = event.description.replace(infos[i]+"*",""); |
| 729 | } |
| 730 | else if (tmpActor.search(infos[i])!=-1) |
| 731 | { |
| 732 | QStringList actorlist = tmpActor.capturedTexts(); |
| 733 | QStringList actors = QStringList::split(", ", actorlist[1]); |
| 734 | for(QStringList::size_type j=0;j<actors.count();j++) |
| 735 | event.AddPerson(DBPerson::kActor, actors[j]); |
| 736 | event.description = event.description.replace(infos[i]+"*",""); |
| 737 | } |
| 738 | else if (tmpOTitle.search(infos[i])!=-1) |
| 739 | { |
| 740 | QStringList origtitle = tmpOTitle.capturedTexts(); |
| 741 | event.title += " " + origtitle[1]; |
| 742 | event.description = event.description.replace(infos[i]+"*",""); |
| 743 | } |
| 744 | else if (event.category.isEmpty() && (tmpCategory.search(infos[i])!=-1)) |
| 745 | { |
| 746 | QStringList category = tmpCategory.capturedTexts(); |
| 747 | event.category = category[1]; |
| 748 | event.description = event.description.replace(infos[i]+"*",""); |
| 749 | } |
| 750 | else if (tmpSubtitle.search(infos[i])!=-1) |
| 751 | { |
| 752 | possible_subtitle = tmpSubtitle.capturedTexts()[1]; |
| 753 | replacement = infos[i]; |
| 754 | } |
| 755 | } |
| 756 | |
| 757 | } |
| 758 | if (event.category.isEmpty()&&!event.subtitle.isEmpty()) |
| 759 | { |
| 760 | QRegExp tmpCategory = m_kdCategory; |
| 761 | if (tmpCategory.search(event.subtitle)!=-1) |
| 762 | { |
| 763 | event.category = event.subtitle; |
| 764 | event.subtitle = ""; |
| 765 | } |
| 766 | } |
| 767 | if (event.subtitle.isEmpty()&&!possible_subtitle.isEmpty()) |
| 768 | { |
| 769 | event.subtitle = possible_subtitle; |
| 770 | event.description = event.description.replace(replacement+"*",""); |
| 771 | } |
| 772 | |
| 773 | // write found country at the description end |
| 774 | if (!country.isEmpty()) |
| 775 | event.description += " " + country; |
| 776 | |
| 777 | |
| 778 | // Get Episode Number from event title |
| 779 | int position = event.title.find(m_kdEpisode); |
| 780 | if (position != -1) |
| 781 | { |
| 782 | event.partnumber = event.title.mid(position + 1, event.title.length() - position - 2).toUInt(); |
| 783 | event.title = event.title.left(position); |
| 784 | } |
| 785 | } |