Skip to content

Commit

Permalink
Fix #61
Browse files Browse the repository at this point in the history
  • Loading branch information
aassif committed Oct 25, 2020
1 parent 286e768 commit 7144107
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/Freebox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -734,6 +734,16 @@ inline string freebox_replace_server (string url, const string & server)
return k != string::npos ? url.replace (k, SERVER.length (), server) : url;
}

void freebox_channel_logo_fix (const std::string & url, const std::string & path)
{
string response;
long http = freebox_http ("GET", url, "", &response, "");
std::cout << url << " : " << http << " (" << response.length () << ')' << std::endl;
ofstream ofs (path, ios::binary | ios::out);
ofs.write (response.c_str (), response.length ());
ofs.close ();
}

bool Freebox::ProcessChannels ()
{
m_tv_channels.clear ();
Expand Down Expand Up @@ -866,7 +876,16 @@ bool Freebox::ProcessChannels ()
data.emplace_back (ParseSource (t), ParseQuality (q), freebox_replace_server (u, m_server));
}
}
#if 1
if (! kodi::vfs::DirectoryExists (m_path + "logos"))
kodi::vfs::CreateDirectory (m_path + "logos");

std::string path = m_path + "logos/" + ch.uuid;
freebox_channel_logo_fix (logo, path);
m_tv_channels.emplace (ChannelId (ch.uuid), Channel (ch.uuid, name, path, ch.major, ch.minor, data));
#else
m_tv_channels.emplace (ChannelId (ch.uuid), Channel (ch.uuid, name, logo, ch.major, ch.minor, data));
#endif
}
}

Expand Down

0 comments on commit 7144107

Please sign in to comment.