Stop airsonic from creating double slashes in urls.
Signed-off-by: Jim Hribar <me@jimhribar.com>
This commit is contained in:
@@ -113,20 +113,20 @@ public class NowPlayingService {
|
|||||||
|
|
||||||
String artist = mediaFile.getArtist();
|
String artist = mediaFile.getArtist();
|
||||||
String title = mediaFile.getTitle();
|
String title = mediaFile.getTitle();
|
||||||
String streamUrl = url + "/stream?player=" + player.getId() + "&id=" + mediaFile.getId();
|
String streamUrl = url + "stream?player=" + player.getId() + "&id=" + mediaFile.getId();
|
||||||
String albumUrl = url + "/main.view?id=" + mediaFile.getId();
|
String albumUrl = url + "main.view?id=" + mediaFile.getId();
|
||||||
String lyricsUrl = null;
|
String lyricsUrl = null;
|
||||||
if (!mediaFile.isVideo()) {
|
if (!mediaFile.isVideo()) {
|
||||||
lyricsUrl = url + "/lyrics.view?artistUtf8Hex=" + StringUtil.utf8HexEncode(artist) +
|
lyricsUrl = url + "lyrics.view?artistUtf8Hex=" + StringUtil.utf8HexEncode(artist) +
|
||||||
"&songUtf8Hex=" + StringUtil.utf8HexEncode(title);
|
"&songUtf8Hex=" + StringUtil.utf8HexEncode(title);
|
||||||
}
|
}
|
||||||
String coverArtUrl = url + "/coverArt.view?size=60&id=" + mediaFile.getId();
|
String coverArtUrl = url + "coverArt.view?size=60&id=" + mediaFile.getId();
|
||||||
|
|
||||||
String avatarUrl = null;
|
String avatarUrl = null;
|
||||||
if (userSettings.getAvatarScheme() == AvatarScheme.SYSTEM) {
|
if (userSettings.getAvatarScheme() == AvatarScheme.SYSTEM) {
|
||||||
avatarUrl = url + "/avatar.view?id=" + userSettings.getSystemAvatarId();
|
avatarUrl = url + "avatar.view?id=" + userSettings.getSystemAvatarId();
|
||||||
} else if (userSettings.getAvatarScheme() == AvatarScheme.CUSTOM && settingsService.getCustomAvatar(username) != null) {
|
} else if (userSettings.getAvatarScheme() == AvatarScheme.CUSTOM && settingsService.getCustomAvatar(username) != null) {
|
||||||
avatarUrl = url + "/avatar.view?usernameUtf8Hex=" + StringUtil.utf8HexEncode(username);
|
avatarUrl = url + "avatar.view?usernameUtf8Hex=" + StringUtil.utf8HexEncode(username);
|
||||||
}
|
}
|
||||||
|
|
||||||
String tooltip = StringUtil.toHtml(artist) + " – " + StringUtil.toHtml(title);
|
String tooltip = StringUtil.toHtml(artist) + " – " + StringUtil.toHtml(title);
|
||||||
|
|||||||
@@ -661,12 +661,12 @@ public class PlayQueueService {
|
|||||||
|
|
||||||
for (MediaFile file : playQueue.getFiles()) {
|
for (MediaFile file : playQueue.getFiles()) {
|
||||||
|
|
||||||
String albumUrl = url + "/main.view?id=" + file.getId();
|
String albumUrl = url + "main.view?id=" + file.getId();
|
||||||
String streamUrl = url + "/stream?player=" + player.getId() + "&id=" + file.getId();
|
String streamUrl = url + "stream?player=" + player.getId() + "&id=" + file.getId();
|
||||||
String coverArtUrl = url + "/coverArt.view?id=" + file.getId();
|
String coverArtUrl = url + "coverArt.view?id=" + file.getId();
|
||||||
|
|
||||||
String remoteStreamUrl = jwtSecurityService.addJWTToken(url + "/ext/stream?player=" + player.getId() + "&id=" + file.getId());
|
String remoteStreamUrl = jwtSecurityService.addJWTToken(url + "ext/stream?player=" + player.getId() + "&id=" + file.getId());
|
||||||
String remoteCoverArtUrl = jwtSecurityService.addJWTToken(url + "/ext/coverArt.view?id=" + file.getId());
|
String remoteCoverArtUrl = jwtSecurityService.addJWTToken(url + "ext/coverArt.view?id=" + file.getId());
|
||||||
|
|
||||||
String format = formatFormat(player, file);
|
String format = formatFormat(player, file);
|
||||||
String username = securityService.getCurrentUsername(request);
|
String username = securityService.getCurrentUsername(request);
|
||||||
|
|||||||
+1
-1
@@ -128,7 +128,7 @@ public class ExternalPlayerController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public MediaFileWithUrlInfo addUrlInfo(HttpServletRequest request, Player player, MediaFile mediaFile, Date expires) {
|
public MediaFileWithUrlInfo addUrlInfo(HttpServletRequest request, Player player, MediaFile mediaFile, Date expires) {
|
||||||
String prefix = "/ext";
|
String prefix = "ext";
|
||||||
String streamUrl = jwtSecurityService.addJWTToken(
|
String streamUrl = jwtSecurityService.addJWTToken(
|
||||||
UriComponentsBuilder
|
UriComponentsBuilder
|
||||||
.fromHttpUrl(NetworkService.getBaseUrl(request) + prefix + "/stream")
|
.fromHttpUrl(NetworkService.getBaseUrl(request) + prefix + "/stream")
|
||||||
|
|||||||
+2
-2
@@ -71,8 +71,8 @@ public class VideoPlayerController {
|
|||||||
Integer duration = file.getDurationSeconds();
|
Integer duration = file.getDurationSeconds();
|
||||||
String playerId = playerService.getPlayer(request, response).getId();
|
String playerId = playerService.getPlayer(request, response).getId();
|
||||||
String url = NetworkService.getBaseUrl(request);
|
String url = NetworkService.getBaseUrl(request);
|
||||||
String streamUrl = url + "/stream?id=" + file.getId() + "&player=" + playerId + "&format=mp4";
|
String streamUrl = url + "stream?id=" + file.getId() + "&player=" + playerId + "&format=mp4";
|
||||||
String coverArtUrl = url + "/coverArt.view?id=" + file.getId();
|
String coverArtUrl = url + "coverArt.view?id=" + file.getId();
|
||||||
|
|
||||||
map.put("video", file);
|
map.put("video", file);
|
||||||
map.put("streamUrl", streamUrl);
|
map.put("streamUrl", streamUrl);
|
||||||
|
|||||||
@@ -125,7 +125,7 @@ public class ShareService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public String getShareUrl(HttpServletRequest request, Share share) {
|
public String getShareUrl(HttpServletRequest request, Share share) {
|
||||||
String shareUrl = NetworkService.getBaseUrl(request) + "/ext/share/" + share.getName();
|
String shareUrl = NetworkService.getBaseUrl(request) + "ext/share/" + share.getName();
|
||||||
return jwtSecurityService.addJWTToken(UriComponentsBuilder.fromUriString(shareUrl), share.getExpires()).build().toUriString();
|
return jwtSecurityService.addJWTToken(UriComponentsBuilder.fromUriString(shareUrl), share.getExpires()).build().toUriString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user