mirror of
https://projects.vdr-developer.org/git/vdr-plugin-skindesigner.git
synced 2023-10-19 17:58:31 +02:00
fixed bug that hasposter is only true if poster really exists
This commit is contained in:
parent
2129df34cb
commit
e84c60f48a
1
HISTORY
1
HISTORY
@ -37,6 +37,7 @@ Version 0.0.2
|
|||||||
- added device info in displaychannel, example in metrixHD
|
- added device info in displaychannel, example in metrixHD
|
||||||
- improved menu icon display, additionally using menu cat
|
- improved menu icon display, additionally using menu cat
|
||||||
- changed devices list, device numbers start with 0
|
- changed devices list, device numbers start with 0
|
||||||
|
- fixed bug that hasposter is only true if poster really exists
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -90,6 +90,11 @@ bool isNumber(const string& s) {
|
|||||||
return !s.empty() && it == s.end();
|
return !s.empty() && it == s.end();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool FileExists(const string &fullpath) {
|
||||||
|
struct stat buffer;
|
||||||
|
return (stat (fullpath.c_str(), &buffer) == 0);
|
||||||
|
}
|
||||||
|
|
||||||
bool FileExists(const string &path, const string &name, const string &ext) {
|
bool FileExists(const string &path, const string &name, const string &ext) {
|
||||||
stringstream fileName;
|
stringstream fileName;
|
||||||
fileName << path << name << "." << ext;
|
fileName << path << name << "." << ext;
|
||||||
|
@ -12,6 +12,7 @@ int Minimum(int a, int b, int c, int d, int e, int f);
|
|||||||
std::string CutText(string &text, int width, string fontName, int fontSize);
|
std::string CutText(string &text, int width, string fontName, int fontSize);
|
||||||
std::string StrToLowerCase(string str);
|
std::string StrToLowerCase(string str);
|
||||||
bool isNumber(const string& s);
|
bool isNumber(const string& s);
|
||||||
|
bool FileExists(const string &fullpath);
|
||||||
bool FileExists(const string &path, const string &name, const string &ext);
|
bool FileExists(const string &path, const string &name, const string &ext);
|
||||||
bool FolderExists(const string &path);
|
bool FolderExists(const string &path);
|
||||||
bool FirstFileInFolder(string &path, string &extension, string &fileName);
|
bool FirstFileInFolder(string &path, string &extension, string &fileName);
|
||||||
|
@ -42,7 +42,7 @@ void cDisplayMenuItemCurrentView::SetScraperPoster(const cEvent *event, const cR
|
|||||||
call.event = event;
|
call.event = event;
|
||||||
call.recording = recording;
|
call.recording = recording;
|
||||||
if (pScraper->Service("GetPoster", &call)) {
|
if (pScraper->Service("GetPoster", &call)) {
|
||||||
intTokens.insert(pair<string,int>("hasposter", true));
|
intTokens.insert(pair<string,int>("hasposter", FileExists(call.poster.path)));
|
||||||
intTokens.insert(pair<string,int>("posterwidth", call.poster.width));
|
intTokens.insert(pair<string,int>("posterwidth", call.poster.width));
|
||||||
intTokens.insert(pair<string,int>("posterheight", call.poster.height));
|
intTokens.insert(pair<string,int>("posterheight", call.poster.height));
|
||||||
stringTokens.insert(pair<string,string>("posterpath", call.poster.path));
|
stringTokens.insert(pair<string,string>("posterpath", call.poster.path));
|
||||||
|
@ -706,7 +706,7 @@ void cDisplayMenuItemRecordingView::SetTokens(void) {
|
|||||||
call.event = NULL;
|
call.event = NULL;
|
||||||
call.recording = usedRecording;
|
call.recording = usedRecording;
|
||||||
if (pScraper->Service("GetPosterThumb", &call)) {
|
if (pScraper->Service("GetPosterThumb", &call)) {
|
||||||
intTokens.insert(pair<string,int>("hasposterthumbnail", true));
|
intTokens.insert(pair<string,int>("hasposterthumbnail", FileExists(call.poster.path)));
|
||||||
intTokens.insert(pair<string,int>("thumbnailbwidth", call.poster.width));
|
intTokens.insert(pair<string,int>("thumbnailbwidth", call.poster.width));
|
||||||
intTokens.insert(pair<string,int>("thumbnailheight", call.poster.height));
|
intTokens.insert(pair<string,int>("thumbnailheight", call.poster.height));
|
||||||
stringTokens.insert(pair<string,string>("thumbnailpath", call.poster.path));
|
stringTokens.insert(pair<string,string>("thumbnailpath", call.poster.path));
|
||||||
|
Loading…
Reference in New Issue
Block a user