summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkamel5 <vdr.kamel5 (at) gmx (dot) net>2020-07-15 15:27:18 +0200
committerkamel5 <vdr.kamel5 (at) gmx (dot) net>2020-07-15 15:27:18 +0200
commita1619348198d1b485aaebc91176403c15dbec47d (patch)
treebcd3ba0988b49d50f66817a81f323a41befe9fde
parent344cc88d61119abd632c3adc68ccc2c0d34130fc (diff)
downloadvdr-plugin-tvguideng-a1619348198d1b485aaebc91176403c15dbec47d.tar.gz
vdr-plugin-tvguideng-a1619348198d1b485aaebc91176403c15dbec47d.tar.bz2
Add isactors as token
-rw-r--r--definitions.h1
-rw-r--r--detailview.c51
2 files changed, 31 insertions, 21 deletions
diff --git a/definitions.h b/definitions.h
index 17207b9..d4cfff7 100644
--- a/definitions.h
+++ b/definitions.h
@@ -327,6 +327,7 @@ enum class eScraperIT {
movieadult,
movieruntime,
isseries,
+ isactors,
posterwidth,
posterheight,
fanartwidth,
diff --git a/detailview.c b/detailview.c
index 1dae0b9..0915c99 100644
--- a/detailview.c
+++ b/detailview.c
@@ -230,6 +230,7 @@ void cDetailView::DefineTabTokens(skindesignerapi::cTokenContainer *tk) {
tk->DefineIntToken("{seriesbanner2height}", (int)eScraperIT::seriesbanner2height);
tk->DefineIntToken("{seriesbanner3width}", (int)eScraperIT::seriesbanner3width);
tk->DefineIntToken("{seriesbanner3height}", (int)eScraperIT::seriesbanner3height);
+ tk->DefineIntToken("{isactors}", (int)eScraperIT::isactors);
tk->DefineLoopToken("{reruns[title]}", (int)eRerunsLT::title);
tk->DefineLoopToken("{reruns[shorttext]}", (int)eRerunsLT::shorttext);
tk->DefineLoopToken("{reruns[date]}", (int)eRerunsLT::date);
@@ -689,16 +690,20 @@ void cDetailView::SetScraperTokens(void) {
tabs->AddIntToken((int)eScraperIT::collectionfanartwidth, movie->collectionFanart.width);
tabs->AddIntToken((int)eScraperIT::collectionfanartheight, movie->collectionFanart.height);
- int actorsIndex = tabs->GetLoopIndex("actors");
- int i=0;
- for (vector<cActor>::iterator act = movie->actors.begin(); act != movie->actors.end(); act++) {
- tabs->AddLoopToken(actorsIndex, i, (int)eScraperLT::name, (*act).name.c_str());
- tabs->AddLoopToken(actorsIndex, i, (int)eScraperLT::role, (*act).role.c_str());
- tabs->AddLoopToken(actorsIndex, i, (int)eScraperLT::thumb, (*act).actorThumb.path.c_str());
- tabs->AddLoopToken(actorsIndex, i, (int)eScraperLT::thumbwidth, *cString::sprintf("%d", (*act).actorThumb.width));
- tabs->AddLoopToken(actorsIndex, i, (int)eScraperLT::thumbheight, *cString::sprintf("%d", (*act).actorThumb.height));
- i++;
- }
+ if (movie->actors.size() > 0) {
+ tabs->AddIntToken((int)eScraperIT::isactors, true);
+ int actorsIndex = tabs->GetLoopIndex("actors");
+ int i=0;
+ for (vector<cActor>::iterator act = movie->actors.begin(); act != movie->actors.end(); act++) {
+ tabs->AddLoopToken(actorsIndex, i, (int)eScraperLT::name, (*act).name.c_str());
+ tabs->AddLoopToken(actorsIndex, i, (int)eScraperLT::role, (*act).role.c_str());
+ tabs->AddLoopToken(actorsIndex, i, (int)eScraperLT::thumb, (*act).actorThumb.path.c_str());
+ tabs->AddLoopToken(actorsIndex, i, (int)eScraperLT::thumbwidth, *cString::sprintf("%d", (*act).actorThumb.width));
+ tabs->AddLoopToken(actorsIndex, i, (int)eScraperLT::thumbheight, *cString::sprintf("%d", (*act).actorThumb.height));
+ i++;
+ }
+ } else
+ tabs->AddIntToken((int)eScraperIT::isactors, false);
} else if (series) {
tabs->AddIntToken((int)eScraperIT::ismovie, false);
tabs->AddIntToken((int)eScraperIT::isseries, true);
@@ -761,16 +766,20 @@ void cDetailView::SetScraperTokens(void) {
indexStr++;
}
//Actors
- int actorsIndex = tabs->GetLoopIndex("actors");
- int i=0;
- for (vector<cActor>::iterator act = series->actors.begin(); act != series->actors.end(); act++) {
- tabs->AddLoopToken(actorsIndex, i, (int)eScraperLT::name, (*act).name.c_str());
- tabs->AddLoopToken(actorsIndex, i, (int)eScraperLT::role, (*act).role.c_str());
- tabs->AddLoopToken(actorsIndex, i, (int)eScraperLT::thumb, (*act).actorThumb.path.c_str());
- tabs->AddLoopToken(actorsIndex, i, (int)eScraperLT::thumbwidth, *cString::sprintf("%d", (*act).actorThumb.width));
- tabs->AddLoopToken(actorsIndex, i, (int)eScraperLT::thumbheight, *cString::sprintf("%d", (*act).actorThumb.height));
- i++;
- }
+ if (series->actors.size() > 0) {
+ tabs->AddIntToken((int)eScraperIT::isactors, true);
+ int actorsIndex = tabs->GetLoopIndex("actors");
+ int i=0;
+ for (vector<cActor>::iterator act = series->actors.begin(); act != series->actors.end(); act++) {
+ tabs->AddLoopToken(actorsIndex, i, (int)eScraperLT::name, (*act).name.c_str());
+ tabs->AddLoopToken(actorsIndex, i, (int)eScraperLT::role, (*act).role.c_str());
+ tabs->AddLoopToken(actorsIndex, i, (int)eScraperLT::thumb, (*act).actorThumb.path.c_str());
+ tabs->AddLoopToken(actorsIndex, i, (int)eScraperLT::thumbwidth, *cString::sprintf("%d", (*act).actorThumb.width));
+ tabs->AddLoopToken(actorsIndex, i, (int)eScraperLT::thumbheight, *cString::sprintf("%d", (*act).actorThumb.height));
+ i++;
+ }
+ } else
+ tabs->AddIntToken((int)eScraperIT::isactors, false);
} else {
tabs->AddIntToken((int)eScraperIT::ismovie, false);
tabs->AddIntToken((int)eScraperIT::isseries, false);
@@ -791,4 +800,4 @@ void cDetailView::SetEpgPictures(int eventId) {
tabs->AddStringToken((int)eDetailedEpgST::epgpic1path + i, "");
}
}
-} \ No newline at end of file
+}