diff --git a/po/ca_ES.po b/po/ca_ES.po index 3c45475..8007492 100644 --- a/po/ca_ES.po +++ b/po/ca_ES.po @@ -3,7 +3,7 @@ msgid "" msgstr "" "Project-Id-Version: vdr-tvguide 0.0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-01-06 14:31+0100\n" +"POT-Creation-Date: 2020-02-12 17:37+0100\n" "PO-Revision-Date: 2013-09-21 17:49+0200\n" "Last-Translator: My friend Thanks David \n" "Language-Team: \n" @@ -57,6 +57,9 @@ msgstr "" msgid "images" msgstr "" +msgid "tvguide: RemoteTimerModifications failed" +msgstr "" + msgid "root video folder" msgstr "Directori principal per a vídeo" diff --git a/po/de_DE.po b/po/de_DE.po index 0758f91..81138ce 100644 --- a/po/de_DE.po +++ b/po/de_DE.po @@ -3,7 +3,7 @@ msgid "" msgstr "" "Project-Id-Version: vdr-tvguide 0.0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-01-06 14:31+0100\n" +"POT-Creation-Date: 2020-02-12 17:37+0100\n" "PO-Revision-Date: 2012-08-25 17:49+0200\n" "Last-Translator: Horst\n" "Language-Team: \n" @@ -54,6 +54,9 @@ msgstr "Favoriten" msgid "images" msgstr "Bilder" +msgid "tvguide: RemoteTimerModifications failed" +msgstr "" + msgid "root video folder" msgstr "Video Hauptverzeichnis" diff --git a/po/it_IT.po b/po/it_IT.po index 266e7b6..0931b0c 100644 --- a/po/it_IT.po +++ b/po/it_IT.po @@ -3,7 +3,7 @@ msgid "" msgstr "" "Project-Id-Version: vdr-tvguide 0.0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-01-06 14:31+0100\n" +"POT-Creation-Date: 2020-02-12 17:37+0100\n" "PO-Revision-Date: 2012-08-25 17:49+0200\n" "Last-Translator: fiveten_59\n" "Language-Team: \n" @@ -54,6 +54,9 @@ msgstr "Favoriti" msgid "images" msgstr "Immagini" +msgid "tvguide: RemoteTimerModifications failed" +msgstr "" + msgid "root video folder" msgstr "cartella video di root" diff --git a/po/ru_RU.po b/po/ru_RU.po index dcc3d12..67f05dd 100644 --- a/po/ru_RU.po +++ b/po/ru_RU.po @@ -3,7 +3,7 @@ msgid "" msgstr "" "Project-Id-Version: vdr-tvguide 1.0.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-01-06 14:31+0100\n" +"POT-Creation-Date: 2020-02-12 17:37+0100\n" "PO-Revision-Date: 2013-09-25 17:49+0400\n" "Last-Translator: AmiD, ilya\n" "Language-Team: Russia-Cherepovets(wm.amid@gmail.com)\n" @@ -54,6 +54,9 @@ msgstr "" msgid "images" msgstr "" +msgid "tvguide: RemoteTimerModifications failed" +msgstr "" + msgid "root video folder" msgstr "Главная видео директория" diff --git a/po/sk_SK.po b/po/sk_SK.po index deb93d3..3283b9a 100644 --- a/po/sk_SK.po +++ b/po/sk_SK.po @@ -3,7 +3,7 @@ msgid "" msgstr "" "Project-Id-Version: vdr-tvguide 1.1.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-01-06 14:31+0100\n" +"POT-Creation-Date: 2020-02-12 17:37+0100\n" "PO-Revision-Date: 2013-09-15 00:12+0100\n" "Last-Translator: Milan Hrala \n" "Language-Team: \n" @@ -54,6 +54,9 @@ msgstr "" msgid "images" msgstr "" +msgid "tvguide: RemoteTimerModifications failed" +msgstr "" + msgid "root video folder" msgstr "Hlavn video adresr" diff --git a/recmanager.c b/recmanager.c index 4ecdb66..18e38e9 100644 --- a/recmanager.c +++ b/recmanager.c @@ -96,10 +96,11 @@ cTimer *cRecManager::createTimer(const cEvent *event, std::string path) { cTimer *cRecManager::createLocalTimer(const cEvent *event, std::string path) { cTimer *timer = new cTimer(event); #if VDRVERSNUM >= 20301 - if (Setup.SVDRPPeering && *Setup.SVDRPDefaultHost) - ((cTimer*)timer)->SetRemote(Setup.SVDRPDefaultHost); LOCK_TIMERS_WRITE; cTimers* timers = Timers; + timers->SetExplicitModify(); + if (Setup.SVDRPPeering && *Setup.SVDRPDefaultHost) + timer->SetRemote(Setup.SVDRPDefaultHost); #else cTimers* timers = &Timers; #endif @@ -115,11 +116,20 @@ cTimer *cRecManager::createLocalTimer(const cEvent *event, std::string path) { timer = t; isyslog("timer %s reactivated", *t->ToDescr()); } else { + SetTimerPath(timer, event, path); timers->Add(timer); + timers->SetModified(); +#if VDRVERSNUM >= 20301 + if (!HandleRemoteTimerModifications(timer)) { + timers->Del(timer); + esyslog(tr("tvguide: RemoteTimerModifications failed")); + } else { + isyslog("timer %s added (active)", *timer->ToDescr()); + } +#else isyslog("timer %s added (active)", *timer->ToDescr()); +#endif } - SetTimerPath(timer, event, path); - timers->SetModified(); return timer; } @@ -204,6 +214,12 @@ void cRecManager::DeleteTimer(const cTimer *timer) { #if VDRVERSNUM >= 20301 LOCK_TIMERS_WRITE; cTimers* timers = Timers; + if (timer && timer->Remote() && !timer->Recording()) { + if (HandleRemoteTimerModifications(NULL, (cTimer*)timer)) { + timers->Del((cTimer*)timer); + } + timers->SetModified(); + } cTimer* t = timers->GetTimer(timer); #else cTimers* timers = &Timers; @@ -238,24 +254,33 @@ void cRecManager::DeleteRemoteTimer(const cEvent *event) { } } -void cRecManager::SaveTimer(const cTimer *t, cTimer newTimerSettings) { +void cRecManager::SaveTimer(const cTimer *t, cTimer *newTimerSettings) { if (!t) return; #if VDRVERSNUM >= 20301 LOCK_TIMERS_WRITE; - cTimer *timer = Timers->GetTimer(t); + cTimers* timers = Timers; + timers->SetExplicitModify(); + if (t && t->Remote()) { + if (!HandleRemoteTimerModifications(newTimerSettings, (cTimer *)t)) { + esyslog(tr("tvguide: RemoteTimerModifications failed")); + } + } #else - cTimer *timer = Timers.GetTimer((cTimer*)t); + cTimers* timers = &Timers; #endif - - bool active = newTimerSettings.HasFlags(tfActive); - int prio = newTimerSettings.Priority(); - int lifetime = newTimerSettings.Lifetime(); - time_t day = newTimerSettings.Day(); - int start = newTimerSettings.Start(); - int stop = newTimerSettings.Stop(); - std::string fileName = newTimerSettings.File(); + cTimer *timer = timers->GetTimer(t); + if (!timer) { + return; + } + bool active = newTimerSettings->HasFlags(tfActive); + int prio = newTimerSettings->Priority(); + int lifetime = newTimerSettings->Lifetime(); + time_t day = newTimerSettings->Day(); + int start = newTimerSettings->Start(); + int stop = newTimerSettings->Stop(); + std::string fileName = newTimerSettings->File(); timer->SetDay(day); timer->SetStart(start); @@ -264,10 +289,10 @@ void cRecManager::SaveTimer(const cTimer *t, cTimer newTimerSettings) { timer->SetLifetime(lifetime); timer->SetFile(fileName.c_str()); - if (timer->HasFlags(tfActive) && !active) - timer->ClrFlags(tfActive); - else if (!timer->HasFlags(tfActive) && active) - timer->SetFlags(tfActive); + if (active) + timer->SetFlags(tfActive); + else + timer->ClrFlags(tfActive); #if VDRVERSNUM < 20300 timer->SetEventFromSchedule(); @@ -280,9 +305,9 @@ void cRecManager::SaveTimer(const cTimer *t, cTimer newTimerSettings) { RefreshRemoteTimers(); } else { #if VDRVERSNUM >= 20301 - Timers->SetModified(); + timers->SetModified(); #else - Timers.SetModified(); + timers.SetModified(); #endif } } diff --git a/recmanager.h b/recmanager.h index 173fc41..bc405ba 100644 --- a/recmanager.h +++ b/recmanager.h @@ -37,7 +37,7 @@ public: void DeleteTimer(const cEvent *event); void DeleteLocalTimer(const cEvent *event); void DeleteRemoteTimer(const cEvent *event); - void SaveTimer(const cTimer *timer, cTimer newTimerSettings); + void SaveTimer(const cTimer *timer, cTimer *newTimerSettings); bool IsRecorded(const cEvent *event); cTVGuideTimerConflicts *CheckTimerConflict(void); void CreateSeriesTimer(cTimer *seriesTimer); diff --git a/recmenus.c b/recmenus.c index 2d15082..80213cc 100644 --- a/recmenus.c +++ b/recmenus.c @@ -467,17 +467,17 @@ const cTimer *cRecMenuEditTimer::GetOriginalTimer(void) { return originalTimer; } -cTimer cRecMenuEditTimer::GetTimer(void) { - cTimer t; +cTimer *cRecMenuEditTimer::GetTimer(void) { + cTimer *t = (cTimer *)originalTimer; if (timerActive) - t.SetFlags(tfActive); + t->SetFlags(tfActive); else - t.SetFlags(tfNone); - t.SetDay(day); - t.SetStart(start); - t.SetStop(stop); - t.SetPriority(prio); - t.SetLifetime(lifetime); + t->ClrFlags(tfActive); + t->SetDay(day); + t->SetStart(start); + t->SetStop(stop); + t->SetPriority(prio); + t->SetLifetime(lifetime); std::string newFolder(folder); std::string newFile = originalTimer->File(); size_t found = newFile.find_last_of('~'); @@ -492,7 +492,7 @@ cTimer cRecMenuEditTimer::GetTimer(void) { newFile = *cString::sprintf("%s~%s", newFolder.c_str(), newFile.c_str()); } std::replace(newFile.begin(), newFile.end(), '/', '~'); - t.SetFile(newFile.c_str()); + t->SetFile(newFile.c_str()); return t; } diff --git a/recmenus.h b/recmenus.h index 93a480e..d8401e8 100644 --- a/recmenus.h +++ b/recmenus.h @@ -136,7 +136,7 @@ public: cRecMenuEditTimer(const cTimer *timer, eRecMenuState nextState); const cTimer *GetOriginalTimer(void); virtual ~cRecMenuEditTimer(void) {}; - cTimer GetTimer(void); + cTimer *GetTimer(void); }; /****************************************************************************************** diff --git a/recmenuview.c b/recmenuview.c index 1437ff4..f8a5493 100644 --- a/recmenuview.c +++ b/recmenuview.c @@ -206,7 +206,7 @@ eOSState cRecMenuView::StateMachine(eRecMenuState nextState) { case rmsSaveTimer: { //caller: cRecMenuEditTimer //save timer for active event - cTimer timerModified; + cTimer *timerModified; const cTimer *originalTimer; if (cRecMenuEditTimer *menu = dynamic_cast(activeMenu)) { timerModified = menu->GetTimer(); @@ -290,7 +290,7 @@ eOSState cRecMenuView::StateMachine(eRecMenuState nextState) { case rmsSaveTimerConflictMenu: { //caller: cRecMenuEditTimer //save timer from current timer conflict - cTimer timerModified; + cTimer *timerModified; const cTimer *originalTimer; if (cRecMenuEditTimer *menu = dynamic_cast(activeMenu)) { timerModified = menu->GetTimer(); @@ -749,7 +749,7 @@ eOSState cRecMenuView::StateMachine(eRecMenuState nextState) { } break;} case rmsTimelineTimerSave: { - cTimer timerModified; + cTimer *timerModified; const cTimer *originalTimer; if (cRecMenuEditTimer *menu = dynamic_cast(activeMenu)) { timerModified = menu->GetTimer();