From 2b205fcc3cdd5f52b560a711253469a59addc049 Mon Sep 17 00:00:00 2001 From: Marten Richter Date: Sat, 30 Aug 2014 19:21:39 +0200 Subject: [PATCH] Add handling for recording minuatures --- picturereader.c | 16 +++++++++++++++- picturereader.h | 2 ++ vdrcommand.h | 1 + vompclientrrproc.c | 26 ++++++++++++++++++++++++++ vompclientrrproc.h | 1 + 5 files changed, 45 insertions(+), 1 deletion(-) diff --git a/picturereader.c b/picturereader.c index 62e4218..a940ebe 100644 --- a/picturereader.c +++ b/picturereader.c @@ -151,7 +151,21 @@ std::string PictureReader::getPictName(TVMediaRequest & req) } break; - + case 3: { // I do not know + // First get the recording + cRecordings Recordings; + Recordings.Load(); + cRecording *recording = Recordings.GetByName((char*) req.primary_name.c_str()); + ScraperGetPosterThumb getter; + getter.recording = recording; + getter.event = NULL; + if (x->scraper && recording) { + x->scraper->Service("GetPosterThumb",&getter); + return getter.poster.path; + } else { + return std::string(""); + } + }; break; default: return std::string(""); break; diff --git a/picturereader.h b/picturereader.h index 195feeb..f734d65 100644 --- a/picturereader.h +++ b/picturereader.h @@ -29,6 +29,7 @@ #include "vompclient.h" #include "services/scraper2vdr.h" #include +#include struct TVMediaRequest{ ULONG streamID; @@ -38,6 +39,7 @@ struct TVMediaRequest{ ULONG type_pict; ULONG container; ULONG container_member; + std::string primary_name; }; class PictureReader : public Thread diff --git a/vdrcommand.h b/vdrcommand.h index cacc86b..9b2d0e0 100644 --- a/vdrcommand.h +++ b/vdrcommand.h @@ -73,6 +73,7 @@ const static ULONG VDR_GETRECSCRAPEREVENTTYPE = 38; const static ULONG VDR_GETSCRAPERMOVIEINFO = 39; const static ULONG VDR_GETSCRAPERSERIESINFO = 40; const static ULONG VDR_LOADTVMEDIA =41; +const static ULONG VDR_LOADTVMEDIARECTHUMB =42; const static ULONG VDR_SHUTDOWN = 666; class VDR_Command : public SerializableList { diff --git a/vompclientrrproc.c b/vompclientrrproc.c index 5a67249..d8e1bb7 100644 --- a/vompclientrrproc.c +++ b/vompclientrrproc.c @@ -287,6 +287,9 @@ bool VompClientRRProc::processPacket() case VDR_LOADTVMEDIA: result = processLoadTvMedia(); break; + case VDR_LOADTVMEDIARECTHUMB: + result = processLoadTvMediaRecThumb(); + break; #endif case VDR_GETMEDIALIST: result = processGetMediaList(); @@ -2172,6 +2175,29 @@ int VompClientRRProc::processLoadTvMedia() return 1; } + +int VompClientRRProc::processLoadTvMediaRecThumb() +{ + TVMediaRequest tvreq; + tvreq.streamID = req->requestID; + tvreq.type = 3; // unknown but primary_name is set + tvreq.primary_id = 0; + tvreq.primary_name = std::string((const char*) req->data); + tvreq.secondary_id = 0; + tvreq.type_pict = 1; + tvreq.container = 0; + tvreq.container_member = 0; + log->log("RRProc", Log::DEBUG, "TVMedia request %d %s",req->requestID,req->data); + x.pict->addTVMediaRequest(tvreq); + + + resp->finalise(); + + x.tcp.sendPacket(resp->getPtr(), resp->getLen()); + + return 1; +} + diff --git a/vompclientrrproc.h b/vompclientrrproc.h index daa58cc..0d2cf1e 100644 --- a/vompclientrrproc.h +++ b/vompclientrrproc.h @@ -87,6 +87,7 @@ class VompClientRRProc : public Thread int processGetScraperMovieInfo(); int processGetScraperSeriesInfo(); int processLoadTvMedia(); + int processLoadTvMediaRecThumb(); #endif int processLogin(); int processConfigSave(); -- 2.39.2