Merge remote-tracking branch 'airsonic/pr/598'
This commit is contained in:
@@ -113,20 +113,20 @@ public class NowPlayingService {
|
||||
|
||||
String artist = mediaFile.getArtist();
|
||||
String title = mediaFile.getTitle();
|
||||
String streamUrl = url + "/stream?player=" + player.getId() + "&id=" + mediaFile.getId();
|
||||
String albumUrl = url + "/main.view?id=" + mediaFile.getId();
|
||||
String streamUrl = url + "stream?player=" + player.getId() + "&id=" + mediaFile.getId();
|
||||
String albumUrl = url + "main.view?id=" + mediaFile.getId();
|
||||
String lyricsUrl = null;
|
||||
if (!mediaFile.isVideo()) {
|
||||
lyricsUrl = url + "/lyrics.view?artistUtf8Hex=" + StringUtil.utf8HexEncode(artist) +
|
||||
lyricsUrl = url + "lyrics.view?artistUtf8Hex=" + StringUtil.utf8HexEncode(artist) +
|
||||
"&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;
|
||||
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) {
|
||||
avatarUrl = url + "/avatar.view?usernameUtf8Hex=" + StringUtil.utf8HexEncode(username);
|
||||
avatarUrl = url + "avatar.view?usernameUtf8Hex=" + StringUtil.utf8HexEncode(username);
|
||||
}
|
||||
|
||||
String tooltip = StringUtil.toHtml(artist) + " – " + StringUtil.toHtml(title);
|
||||
|
||||
@@ -647,7 +647,7 @@ public class PlayQueueService {
|
||||
private PlayQueueInfo convert(HttpServletRequest request, Player player, boolean serverSidePlaylist, int offset) throws Exception {
|
||||
String url = NetworkService.getBaseUrl(request);
|
||||
|
||||
/* if (serverSidePlaylist && player.isJukebox()) {
|
||||
/* if (serverSidePlaylist && player.isJukebox()) {
|
||||
updateJukebox(player, offset);
|
||||
} */
|
||||
boolean isCurrentPlayer = player.getIpAddress() != null && player.getIpAddress().equals(request.getRemoteAddr());
|
||||
@@ -661,12 +661,12 @@ public class PlayQueueService {
|
||||
|
||||
for (MediaFile file : playQueue.getFiles()) {
|
||||
|
||||
String albumUrl = url + "/main.view?id=" + file.getId();
|
||||
String streamUrl = url + "/stream?player=" + player.getId() + "&id=" + file.getId();
|
||||
String coverArtUrl = url + "/coverArt.view?id=" + file.getId();
|
||||
String albumUrl = url + "main.view?id=" + file.getId();
|
||||
String streamUrl = url + "stream?player=" + player.getId() + "&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 remoteCoverArtUrl = jwtSecurityService.addJWTToken(url + "/ext/coverArt.view?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 format = formatFormat(player, file);
|
||||
String username = securityService.getCurrentUsername(request);
|
||||
|
||||
+2
-2
@@ -128,7 +128,7 @@ public class ExternalPlayerController {
|
||||
}
|
||||
|
||||
public MediaFileWithUrlInfo addUrlInfo(HttpServletRequest request, Player player, MediaFile mediaFile, Date expires) {
|
||||
String prefix = "/ext";
|
||||
String prefix = "ext";
|
||||
String streamUrl = jwtSecurityService.addJWTToken(
|
||||
UriComponentsBuilder
|
||||
.fromHttpUrl(NetworkService.getBaseUrl(request) + prefix + "/stream")
|
||||
@@ -149,4 +149,4 @@ public class ExternalPlayerController {
|
||||
.toUriString();
|
||||
return new MediaFileWithUrlInfo(mediaFile, coverArtUrl, streamUrl);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -71,8 +71,8 @@ public class VideoPlayerController {
|
||||
Integer duration = file.getDurationSeconds();
|
||||
String playerId = playerService.getPlayer(request, response).getId();
|
||||
String url = NetworkService.getBaseUrl(request);
|
||||
String streamUrl = url + "/stream?id=" + file.getId() + "&player=" + playerId + "&format=mp4";
|
||||
String coverArtUrl = url + "/coverArt.view?id=" + file.getId();
|
||||
String streamUrl = url + "stream?id=" + file.getId() + "&player=" + playerId + "&format=mp4";
|
||||
String coverArtUrl = url + "coverArt.view?id=" + file.getId();
|
||||
|
||||
map.put("video", file);
|
||||
map.put("streamUrl", streamUrl);
|
||||
|
||||
@@ -125,7 +125,7 @@ public class ShareService {
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
@@ -144,4 +144,4 @@ public class ShareService {
|
||||
public void setJwtSecurityService(JWTSecurityService jwtSecurityService) {
|
||||
this.jwtSecurityService = jwtSecurityService;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user