-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathplgconfig.c
73 lines (63 loc) · 2.41 KB
/
plgconfig.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
/*
* config.c:
*
* See the README file for copyright information and how to reach the author.
*
*/
#include "plgconfig.h"
cScraper2VdrConfig scraper2VdrConfig;
//***************************************************************************
// cEpg2VdrConfig
//***************************************************************************
cScraper2VdrConfig::cScraper2VdrConfig()
: cEpgConfig()
{
mainMenuEntry = yes;
headless = no;
imgDirSet = no;
imageDir = "";
recScrapInfoName = "scrapinfo";
thumbHeight = 200;
useFixPosterSize = no;
fixPosterWidth = 500;
fixPosterHeight = 735;
fixSeasonPosterWidth = 400;
fixSeasonPosterHeight = 588;
maxPosterDistortion = 5;
}
void cScraper2VdrConfig::SetImageDir(cString dir)
{
imageDir = *dir;
imgDirSet = true;
}
void cScraper2VdrConfig::SetDefaultImageDir(void)
{
if (!imgDirSet)
imageDir = cPlugin::CacheDirectory(PLUGIN_NAME_I18N);
tell (0, "using image directory %s", imageDir.c_str());
}
void cScraper2VdrConfig::SetMode(string mode)
{
if (!mode.compare("headless"))
headless = true;
}
bool cScraper2VdrConfig::SetupParse(const char *Name, const char *Value)
{
if (strcasecmp(Name, "mainMenuEntry") == 0) mainMenuEntry = atoi(Value);
else if (strcasecmp(Name, "DbHost") == 0) sstrcpy(dbHost, Value, sizeof(dbHost));
else if (strcasecmp(Name, "DbPort") == 0) dbPort = atoi(Value);
else if (strcasecmp(Name, "DbName") == 0) sstrcpy(dbName, Value, sizeof(dbName));
else if (strcasecmp(Name, "DbUser") == 0) sstrcpy(dbUser, Value, sizeof(dbUser));
else if (strcasecmp(Name, "DbPass") == 0) sstrcpy(dbPass, Value, sizeof(dbPass));
else if (strcasecmp(Name, "thumbHeight") == 0) thumbHeight = atoi(Value);
else if (strcasecmp(Name, "useFixPosterSize") == 0) useFixPosterSize = atoi(Value);
else if (strcasecmp(Name, "fixPosterWidth") == 0) fixPosterWidth = atoi(Value);
else if (strcasecmp(Name, "fixPosterHeight") == 0) fixPosterHeight = atoi(Value);
else if (strcasecmp(Name, "fixSeasonPosterWidth") == 0) fixSeasonPosterWidth = atoi(Value);
else if (strcasecmp(Name, "fixSeasonPosterHeight") == 0) fixSeasonPosterHeight = atoi(Value);
else if (strcasecmp(Name, "maxPosterDistortion") == 0) maxPosterDistortion = atoi(Value);
else if (strcasecmp(Name, "LogLevel") == 0) loglevel = atoi(Value);
else
return false;
return true;
}