mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-27 23:42:51 +02:00
adding caching xmltv logos
Origin commit data
------------------
Commit: 3955d83961
Author: TangoCash <eric@loxat.de>
Date: 2018-09-20 (Thu, 20 Sep 2018)
This commit is contained in:
@@ -1744,6 +1744,28 @@ std::string downloadUrlToRandomFile(std::string url, std::string directory, unsi
|
||||
return url;
|
||||
}
|
||||
|
||||
std::string downloadUrlToLogo(std::string url, std::string directory, t_channel_id channel_id)
|
||||
{
|
||||
|
||||
if (channel_id == 0)
|
||||
return downloadUrlToRandomFile(url,directory);
|
||||
|
||||
if (strstr(url.c_str(), "://"))
|
||||
{
|
||||
//get channel id as string
|
||||
char strChnId[16];
|
||||
snprintf(strChnId, 16, "%llx", channel_id & 0xFFFFFFFFFFFFULL);
|
||||
strChnId[15] = '\0';
|
||||
|
||||
std::string file = directory + "/" + strChnId + url.substr(url.find_last_of("."));
|
||||
if (file_exists(file))
|
||||
return file;
|
||||
if (downloadUrl(url, file))
|
||||
return file;
|
||||
}
|
||||
return url;
|
||||
}
|
||||
|
||||
// curl
|
||||
static void *myrealloc(void *ptr, size_t size)
|
||||
{
|
||||
|
Reference in New Issue
Block a user