Fix problem with Cam4 edge URLs
The edge URLs are already abosulte, so the base URL does not have to be prepended
This commit is contained in:
parent
df37f4a61c
commit
3d4bd6f331
|
@ -1,3 +1,7 @@
|
|||
3.12.2
|
||||
========================
|
||||
* Fix: Some Cam4 URLs where broken
|
||||
|
||||
3.12.1
|
||||
========================
|
||||
* Fix: "Resume all" started the recordings of models marked for later recording
|
||||
|
|
|
@ -191,9 +191,13 @@ public class Cam4Model extends AbstractModel {
|
|||
StreamSource src = new StreamSource();
|
||||
src.bandwidth = playlist.getStreamInfo().getBandwidth();
|
||||
src.height = Optional.ofNullable(playlist.getStreamInfo()).map(StreamInfo::getResolution).map(res -> res.height).orElse(0);
|
||||
String masterUrl = getPlaylistUrl();
|
||||
String baseUrl = masterUrl.substring(0, masterUrl.lastIndexOf('/') + 1);
|
||||
src.mediaPlaylistUrl = baseUrl + playlist.getUri();
|
||||
if (playlist.getUri().startsWith("http")) {
|
||||
src.mediaPlaylistUrl = playlist.getUri();
|
||||
} else {
|
||||
String masterUrl = getPlaylistUrl();
|
||||
String baseUrl = masterUrl.substring(0, masterUrl.lastIndexOf('/') + 1);
|
||||
src.mediaPlaylistUrl = baseUrl + playlist.getUri();
|
||||
}
|
||||
LOG.trace("Media playlist {}", src.mediaPlaylistUrl);
|
||||
sources.add(src);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue