forked from mdre77/vdr-plugin-vnsiserver
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support for TVScraper and VDR resumepoints
Also have to bump protocol version
- Loading branch information
Showing
5 changed files
with
654 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Oops, something went wrong.