Reinsert old tvscraper compatibility

This commit is contained in:
kamel5 2018-03-08 13:10:09 +01:00 committed by kamel5
parent cbc6f44264
commit 6ae27238af
5 changed files with 23 additions and 12 deletions

View File

@ -20,14 +20,14 @@ cDetailView::~cDetailView(void){
} }
void cDetailView::InitiateView(void) { void cDetailView::InitiateView(void) {
static cPlugin *pScraper2Vdr = cPluginManager::GetPlugin("scraper2vdr"); static cPlugin *pScraper = GetScraperPlugin();
ScraperGetEventType call; ScraperGetEventType call;
if (!event) if (!event)
return; return;
call.event = event; call.event = event;
if (!pScraper2Vdr) { if (!pScraper) {
view = new cEPGView(); view = new cEPGView();
} else if (pScraper2Vdr->Service("GetEventType", &call)) { } else if (pScraper->Service("GetEventType", &call)) {
if (call.type == tMovie) { if (call.type == tMovie) {
view = new cMovieView(call.movieId); view = new cMovieView(call.movieId);
} else if (call.type == tSeries) { } else if (call.type == tSeries) {

View File

@ -104,11 +104,11 @@ int cStatusHeader::DrawPoster(const cEvent *event, int x, int y, int height, int
ScraperGetPoster posterScraper2Vdr; ScraperGetPoster posterScraper2Vdr;
int posterWidth = 0; int posterWidth = 0;
int posterHeight = 0; int posterHeight = 0;
static cPlugin *pScraper2Vdr = cPluginManager::GetPlugin("scraper2vdr"); static cPlugin *pScraper = GetScraperPlugin();
if (pScraper2Vdr) { if (pScraper) {
posterScraper2Vdr.event = event; posterScraper2Vdr.event = event;
posterScraper2Vdr.recording = NULL; posterScraper2Vdr.recording = NULL;
if (pScraper2Vdr->Service("GetPoster", &posterScraper2Vdr)) { if (pScraper->Service("GetPoster", &posterScraper2Vdr)) {
hasPoster = true; hasPoster = true;
int posterWidthOrig = posterScraper2Vdr.poster.width; int posterWidthOrig = posterScraper2Vdr.poster.width;
int posterHeightOrig = posterScraper2Vdr.poster.height; int posterHeightOrig = posterScraper2Vdr.poster.height;

View File

@ -8,10 +8,18 @@
#include <stdio.h> #include <stdio.h>
#include <vdr/osd.h> #include <vdr/osd.h>
#include <vdr/plugin.h> #include <vdr/plugin.h>
#include <vdr/skins.h>
#include "services/epgsearch.h" #include "services/epgsearch.h"
#include "tools.h" #include "tools.h"
cPlugin *GetScraperPlugin(void) {
static cPlugin *pScraper = cPluginManager::GetPlugin("scraper2vdr");
if( !pScraper ) // if it doesn't exit, try tvscraper
pScraper = cPluginManager::GetPlugin("tvscraper");
return pScraper;
}
/**************************************************************************************** /****************************************************************************************
* CUTTEXT * CUTTEXT
****************************************************************************************/ ****************************************************************************************/

View File

@ -5,6 +5,9 @@
#include <vector> #include <vector>
#include <vdr/font.h> #include <vdr/font.h>
#include <vdr/recording.h> #include <vdr/recording.h>
#include <vdr/plugin.h>
cPlugin *GetScraperPlugin(void);
std::string CutText(std::string text, int width, const cFont *font); std::string CutText(std::string text, int width, const cFont *font);
std::string StrToLowerCase(std::string str); std::string StrToLowerCase(std::string str);

12
view.c
View File

@ -641,12 +641,12 @@ cSeriesView::~cSeriesView(void) {
} }
void cSeriesView::LoadMedia(void) { void cSeriesView::LoadMedia(void) {
static cPlugin *pScraper2Vdr = cPluginManager::GetPlugin("scraper2vdr"); static cPlugin *pScraper = GetScraperPlugin();
if (!pScraper2Vdr || seriesId < 1) if (!pScraper || seriesId < 1)
return; return;
series.seriesId = seriesId; series.seriesId = seriesId;
series.episodeId = episodeId; series.episodeId = episodeId;
pScraper2Vdr->Service("GetSeries", &series); pScraper->Service("GetSeries", &series);
} }
void cSeriesView::SetTabs(void) { void cSeriesView::SetTabs(void) {
@ -863,11 +863,11 @@ cMovieView::~cMovieView(void) {
} }
void cMovieView::LoadMedia(void) { void cMovieView::LoadMedia(void) {
static cPlugin *pScraper2Vdr = cPluginManager::GetPlugin("scraper2vdr"); static cPlugin *pScraper = GetScraperPlugin();
if (!pScraper2Vdr || movieId < 1) if (!pScraper || movieId < 1)
return; return;
movie.movieId = movieId; movie.movieId = movieId;
pScraper2Vdr->Service("GetMovie", &movie); pScraper->Service("GetMovie", &movie);
} }
void cMovieView::SetTabs(void) { void cMovieView::SetTabs(void) {