- helpers: rework new random-functions to get the code more reuseable

* introduceand use LOGODIR_TMP (storage dir for webchannel logos)

Signed-off-by: Thilo Graf <dbt@novatux.de>
This commit is contained in:
svenhoefer
2018-09-18 21:18:40 +02:00
committed by Thilo Graf
parent 1de8919514
commit f5754b74f2
7 changed files with 33 additions and 29 deletions

View File

@@ -644,13 +644,14 @@ void *insertEventsfromXMLTV(void * data)
pthread_exit(NULL);
}
std::string url = (char *) data;
std::string url_ext = getFileExt(url);
std::string tmp_name = genTmpName(url_ext,8);
std::string tmp_name = randomFile(getFileExt(url), "/tmp", 8);
int64_t now = time_monotonic_ms();
if (url.compare(0, 1, "/") == 0)
{
readEventsFromXMLTV(url, ev_count);
}
else if (::downloadUrl(url, tmp_name))
{
readEventsFromXMLTV(tmp_name, ev_count);