diff options
-rw-r--r-- | po/fi_FI.po | 2 | ||||
-rw-r--r-- | regexp.c | 45 |
2 files changed, 28 insertions, 19 deletions
diff --git a/po/fi_FI.po b/po/fi_FI.po index 435193a..2e969b3 100644 --- a/po/fi_FI.po +++ b/po/fi_FI.po @@ -5,7 +5,7 @@ # msgid "" msgstr "" -"Project-Id-Version: vdr-epgfixer 0.2.0\n" +"Project-Id-Version: vdr-epgfixer 0.2.1\n" "Report-Msgid-Bugs-To: <see README>\n" "POT-Creation-Date: 2012-08-14 13:49+0300\n" "PO-Revision-Date: 2012-05-09 23:20+0300\n" @@ -252,32 +252,41 @@ bool cRegexp::Apply(cEvent *Event) while (i < 10) { if (pcre_get_named_substring(re, tmpstring, ovector, rc, strBackrefs[i], &string) != PCRE_ERROR_NOSUBSTRING) { switch (i) { - case TITLE: - Event->SetTitle(string); - break; case ATITLE: - Event->SetTitle(*cString::sprintf("%s %s", Event->Title(), string)); - break; case PTITLE: - Event->SetTitle(*cString::sprintf("%s %s", string, Event->Title())); - break; - case SHORTTEXT: - Event->SetShortText(string); + if (Event->Title()) { + if (i == ATITLE) + Event->SetTitle(*cString::sprintf("%s %s", Event->Title(), string)); + else + Event->SetTitle(*cString::sprintf("%s %s", string, Event->Title())); + break; + } + case TITLE: + Event->SetTitle(string); break; case ASHORTTEXT: - Event->SetShortText(*cString::sprintf("%s %s", Event->ShortText(), string)); - break; case PSHORTTEXT: - Event->SetShortText(*cString::sprintf("%s %s", string, Event->ShortText())); - break; - case DESCRIPTION: - Event->SetDescription(string); + if (Event->ShortText()) { + if (i == ASHORTTEXT) + Event->SetShortText(*cString::sprintf("%s %s", Event->ShortText(), string)); + else + Event->SetShortText(*cString::sprintf("%s %s", string, Event->ShortText())); + break; + } + case SHORTTEXT: + Event->SetShortText(string); break; case ADESCRIPTION: - Event->SetDescription(*cString::sprintf("%s %s", Event->Description(), string)); - break; case PDESCRIPTION: - Event->SetDescription(*cString::sprintf("%s %s", string, Event->Description())); + if (Event->Description()) { + if (i == ADESCRIPTION) + Event->SetDescription(*cString::sprintf("%s %s", Event->Description(), string)); + else + Event->SetDescription(*cString::sprintf("%s %s", string, Event->Description())); + break; + } + case DESCRIPTION: + Event->SetDescription(string); break; case RATING: Event->SetParentalRating(atoi(string)); |