Skip to content

Commit

Permalink
Server name replacement!
Browse files Browse the repository at this point in the history
  • Loading branch information
aassif committed Apr 30, 2020
1 parent fada0cf commit 148f6ad
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/Freebox.cpp
Expand Up @@ -717,6 +717,13 @@ string Freebox::Event::GetCastActors () const
return accumulate (cast.begin (), cast.end (), string (), CONCAT);
}

inline string freebox_replace_server (string url, const string & server)
{
static const string SERVER = "mafreebox.freebox.fr";
size_t k = url.find (SERVER);
return k != string::npos ? url.replace (k, SERVER.length (), server) : url;
}

bool Freebox::ProcessChannels ()
{
m_tv_channels.clear ();
Expand Down Expand Up @@ -845,7 +852,7 @@ bool Freebox::ProcessChannels ()
const string & t = s["type"].GetString ();
const string & q = s["quality"].GetString ();
const string & r = s["rtsp"].GetString ();
data.emplace_back (ParseSource (t), ParseQuality (q), r);
data.emplace_back (ParseSource (t), ParseQuality (q), freebox_replace_server (r, m_server));
}
}
m_tv_channels.emplace (ChannelId (ch.uuid), Channel (ch.uuid, name, logo, ch.major, ch.minor, data));
Expand Down

0 comments on commit 148f6ad

Please sign in to comment.