]> git.vomp.tv Git - vompclient.git/blob - event.cc
Replace TCP. Use new IP API only, getMAC works with if!=eth0
[vompclient.git] / event.cc
1 /*
2     Copyright 2004-2005 Chris Tallon
3     Copyright 2014 Marten Richter
4
5     This file is part of VOMP.
6
7     VOMP is free software; you can redistribute it and/or modify
8     it under the terms of the GNU General Public License as published by
9     the Free Software Foundation; either version 2 of the License, or
10     (at your option) any later version.
11
12     VOMP is distributed in the hope that it will be useful,
13     but WITHOUT ANY WARRANTY; without even the implied warranty of
14     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15     GNU General Public License for more details.
16
17     You should have received a copy of the GNU General Public License
18     along with VOMP.  If not, see <https://www.gnu.org/licenses/>.
19 */
20
21 #include "event.h"
22 #include "log.h"
23 #include "command.h"
24 #include "movieinfo.h"
25 #include "seriesinfo.h"
26 #include "vdr.h"
27
28 MovieInfo* Event::movieInfo = NULL;
29 SeriesInfo* Event::seriesInfo = NULL;
30
31 void Event::loadinfos(UINT channelid)
32 {
33   VDR* vdr = VDR::getInstance();
34   if (movieInfo) delete movieInfo;
35   if (seriesInfo) delete seriesInfo;
36
37   movieInfo = NULL;
38   seriesInfo = NULL;
39
40   if (movieID == 0 && seriesID == 0)
41   {
42     vdr->getScraperEventType(channelid, id, movieID, seriesID, episodeID, epgImage);
43     Log::getInstance()->log("Event", Log::DEBUG, "Got Scraper EventType %d %d, %d %d %d %d",
44                             id, channelid, movieID, seriesID, episodeID);
45   }
46
47   if (!vdr->isConnected()) Command::getInstance()->connectionLost();
48
49   if (movieID != 0)
50   {
51     movieInfo = vdr->getScraperMovieInfo(movieID);
52     Log::getInstance()->log("Event", Log::DEBUG, "Got Scraper MovieInfo");
53   }
54   else if (seriesID != 0)
55   {
56     seriesInfo = vdr->getScraperSeriesInfo(seriesID, episodeID);
57     Log::getInstance()->log("Event", Log::DEBUG, "Got Scraper SeriesInfo");
58   }
59
60   if (!vdr->isConnected()) Command::getInstance()->connectionLost();
61 }