Skip to content

Commit

Permalink
Support for TVScraper and VDR resumepoints
Browse files Browse the repository at this point in the history
Also have to bump protocol version
  • Loading branch information
Dis90 committed Jan 26, 2023
1 parent e6b321f commit 1f54d53
Show file tree
Hide file tree
Showing 5 changed files with 654 additions and 2 deletions.
46 changes: 46 additions & 0 deletions services_live.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#ifndef __LIVE_SERVICES_LIVE_H
#define __LIVE_SERVICES_LIVE_H

class cLiveImageProvider {
public:
virtual std::string getImageUrl(const std::string &imagePath, bool fullPath = true) = 0;
///< input: imagePath on file system.
///< if fullPath = true: e.g. /var/cache/vdr/plugins/tvscraper/movies/300803_poster.jpg
///< if fullPath = false: e.g. movies/300803_poster.jpg
///< for images returned by the "old" tvscraper interface: use the default fullPath = true
///< output:
///< in case of no error:
///< URL to the image, e.g. http://rpi.fritz.box:8008/tvscraper/movies/300803_poster.jpg
///< in case of errors:
///< If fullPath = true, the input (imagePath) will be returned
///< If fullPath = false, the full file system path will be returned (if possible)
///< Also, an error message will be written to the system log
///< possible errors:
///< missing server url. This url must be provided to live with -u URL, --url=URL
///< missing directory for scraper images:
///< tvscraper makes this directory available to live with the service interface
///< for others, e.g. scraper2vdr: provide this to live with -t <dir>, --tvscraperimages=<dir>
///< image path %s does not start with %s: Will only occur if fullPath == true
///< imagePath does not start with directory for scraper images.
///< example:
///< directory for scraper images: /var/cache/vdr/plugins/tvscraper/
///< imagePath = /tmp/test.img
///< In this example, this error will occur.
///< This is a restriction of live, implemented for security reasons:
///< Only files under the scraper images path will be delivered
virtual ~cLiveImageProvider() {}
};
// service to return cLiveImageProvider instance
class cGetLiveImageProvider {
public:
cPlugin *call(cPlugin *pLive = NULL) {
if (!pLive) return cPluginManager::CallFirstService("GetLiveImageProvider", this);
return pLive->Service("GetLiveImageProvider", this)?pLive:NULL;
}
//IN: Use constructor to set these values
// No input parameters
//OUT
std::unique_ptr<cLiveImageProvider> m_liveImageProvider;
};

#endif // __LIVE_SERVICES_LIVE_H
Loading

0 comments on commit 1f54d53

Please sign in to comment.