mirror of
https://projects.vdr-developer.org/git/vdr-plugin-scraper2vdr.git
synced 2023-10-19 17:58:31 +02:00
removed some unnecessary code
This commit is contained in:
parent
d736d269a1
commit
62610f6fc6
@ -14,8 +14,6 @@
|
|||||||
// Constants
|
// Constants
|
||||||
//***************************************************************************
|
//***************************************************************************
|
||||||
static const char *VERSION = "0.1.3";
|
static const char *VERSION = "0.1.3";
|
||||||
static const char *VERSION_DATE = "14.05.2014";
|
|
||||||
#define DB_API 4
|
|
||||||
static const char *DESCRIPTION = "'scraper2vdr' plugin";
|
static const char *DESCRIPTION = "'scraper2vdr' plugin";
|
||||||
static const char *MAINMENUENTRY = "Scraper2Vdr";
|
static const char *MAINMENUENTRY = "Scraper2Vdr";
|
||||||
|
|
||||||
@ -36,7 +34,6 @@ public:
|
|||||||
cPluginScraper2vdr(void);
|
cPluginScraper2vdr(void);
|
||||||
virtual ~cPluginScraper2vdr();
|
virtual ~cPluginScraper2vdr();
|
||||||
virtual const char *Version(void) { return VERSION; }
|
virtual const char *Version(void) { return VERSION; }
|
||||||
virtual const char *VersionDate(void) { return VERSION_DATE; }
|
|
||||||
virtual const char *Description(void) { return DESCRIPTION; }
|
virtual const char *Description(void) { return DESCRIPTION; }
|
||||||
virtual const char *CommandLineHelp(void);
|
virtual const char *CommandLineHelp(void);
|
||||||
virtual bool ProcessArgs(int argc, char *argv[]);
|
virtual bool ProcessArgs(int argc, char *argv[]);
|
||||||
|
34
update.c
34
update.c
@ -46,7 +46,6 @@ cUpdate::cUpdate(cScrapManager *manager) : cThread("update thread started", true
|
|||||||
imgPathSeries = config.imageDir + "/series";
|
imgPathSeries = config.imageDir + "/series";
|
||||||
imgPathMovies = config.imageDir + "/movies";
|
imgPathMovies = config.imageDir + "/movies";
|
||||||
lastScrap = 0;
|
lastScrap = 0;
|
||||||
lastInit = 0;
|
|
||||||
forceUpdate = false;
|
forceUpdate = false;
|
||||||
forceRecordingUpdate = false;
|
forceRecordingUpdate = false;
|
||||||
forceVideoDirUpdate = false;
|
forceVideoDirUpdate = false;
|
||||||
@ -450,35 +449,6 @@ bool cUpdate::CheckEpgdBusy(void) {
|
|||||||
return busy;
|
return busy;
|
||||||
}
|
}
|
||||||
|
|
||||||
time_t cUpdate::LastPluginInit(void) {
|
|
||||||
time_t init = 0;
|
|
||||||
vdrDb->clear();
|
|
||||||
vdrDb->setValue(cTableVdrs::fiUuid, config.uuid.c_str());
|
|
||||||
if (vdrDb->find()) {
|
|
||||||
init = vdrDb->getIntValue(cTableVdrs::fiUpdSp);
|
|
||||||
}
|
|
||||||
char buf[50+TB];
|
|
||||||
strftime(buf, 50, "%y.%m.%d %H:%M:%S", localtime(&init));
|
|
||||||
tell(0, "Last plugin init was at '%s'", buf);
|
|
||||||
vdrDb->setValue(cTableVdrs::fiState, "attached");
|
|
||||||
vdrDb->store();
|
|
||||||
return init;
|
|
||||||
}
|
|
||||||
|
|
||||||
void cUpdate::SaveLastPluginInit(void) {
|
|
||||||
char* v;
|
|
||||||
asprintf(&v, "vdr %s scraper2vdr 0.1.3", VDRVERSION);
|
|
||||||
vdrDb->clear();
|
|
||||||
vdrDb->setValue(cTableVdrs::fiUuid, config.uuid.c_str());
|
|
||||||
vdrDb->setValue(cTableVdrs::fiIp, getFirstIp());
|
|
||||||
vdrDb->setValue(cTableVdrs::fiName, getHostName());
|
|
||||||
vdrDb->setValue(cTableVdrs::fiVersion, v);
|
|
||||||
vdrDb->setValue(cTableVdrs::fiState, "detached");
|
|
||||||
vdrDb->setValue(cTableVdrs::fiMaster, "n");
|
|
||||||
vdrDb->store();
|
|
||||||
free(v);
|
|
||||||
}
|
|
||||||
|
|
||||||
int cUpdate::ReadScrapedEvents(void) {
|
int cUpdate::ReadScrapedEvents(void) {
|
||||||
int eventId = 0;
|
int eventId = 0;
|
||||||
int seriesId = 0;
|
int seriesId = 0;
|
||||||
@ -1257,9 +1227,6 @@ void cUpdate::Action()
|
|||||||
if (CheckConnection(reconnectTimeout) != success)
|
if (CheckConnection(reconnectTimeout) != success)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (init)
|
|
||||||
lastInit = LastPluginInit();
|
|
||||||
|
|
||||||
// auch beim init auf den epgd warten, wenn der gerade busy ist müssen die sich User etwas gedulden ;)
|
// auch beim init auf den epgd warten, wenn der gerade busy ist müssen die sich User etwas gedulden ;)
|
||||||
|
|
||||||
if (CheckEpgdBusy())
|
if (CheckEpgdBusy())
|
||||||
@ -1387,7 +1354,6 @@ void cUpdate::Action()
|
|||||||
|
|
||||||
worked = no;
|
worked = no;
|
||||||
}
|
}
|
||||||
SaveLastPluginInit();
|
|
||||||
loopActive = no;
|
loopActive = no;
|
||||||
tell(0, "Update thread ended (pid=%d)", getpid());
|
tell(0, "Update thread ended (pid=%d)", getpid());
|
||||||
}
|
}
|
||||||
|
3
update.h
3
update.h
@ -31,7 +31,6 @@ class cUpdate : public cThread {
|
|||||||
cTableMovieMedia* tMovieMedia;
|
cTableMovieMedia* tMovieMedia;
|
||||||
cTableRecordings* tRecordings;
|
cTableRecordings* tRecordings;
|
||||||
int lastScrap;
|
int lastScrap;
|
||||||
time_t lastInit;
|
|
||||||
cCondVar waitCondition;
|
cCondVar waitCondition;
|
||||||
cMutex mutex;
|
cMutex mutex;
|
||||||
bool forceUpdate;
|
bool forceUpdate;
|
||||||
@ -43,8 +42,6 @@ class cUpdate : public cThread {
|
|||||||
int dbConnected(int force = no) { return connection && (!force || connection->check() == success); };
|
int dbConnected(int force = no) { return connection && (!force || connection->check() == success); };
|
||||||
int CheckConnection(int& timeout);
|
int CheckConnection(int& timeout);
|
||||||
bool CheckEpgdBusy(void);
|
bool CheckEpgdBusy(void);
|
||||||
time_t LastPluginInit(void);
|
|
||||||
void SaveLastPluginInit(void);
|
|
||||||
void Action(void);
|
void Action(void);
|
||||||
int ReadScrapedEvents(void);
|
int ReadScrapedEvents(void);
|
||||||
//SERIES
|
//SERIES
|
||||||
|
Loading…
Reference in New Issue
Block a user