Merge remote-tracking branch 'origin/pr/1143'

master
Andrew DeMaria 5 years ago
commit 85e0deeab2
No known key found for this signature in database
GPG Key ID: 0A3F5E91F8364EDF
  1. 12
      airsonic-main/src/main/java/org/airsonic/player/controller/MainController.java
  2. 4
      airsonic-main/src/main/webapp/WEB-INF/jsp/albumMain.jsp

@ -129,9 +129,9 @@ public class MainController {
map.put("brand", settingsService.getBrand());
map.put("viewAsList", isViewAsList(request, userSettings));
if (dir.isAlbum()) {
List<MediaFile> sieblingAlbums = getSieblingAlbums(dir);
thereIsMoreSAlbums = trimToSize(showAll, sieblingAlbums, userPaginationPreference);
map.put("sieblingAlbums", sieblingAlbums);
List<MediaFile> siblingAlbums = getSiblingAlbums(dir);
thereIsMoreSAlbums = trimToSize(showAll, siblingAlbums, userPaginationPreference);
map.put("siblingAlbums", siblingAlbums);
map.put("artist", guessArtist(children));
map.put("album", guessAlbum(children));
map.put("musicBrainzReleaseId", guessMusicBrainzReleaseId(children));
@ -277,13 +277,13 @@ public class MainController {
return result;
}
private List<MediaFile> getSieblingAlbums(MediaFile dir) {
private List<MediaFile> getSiblingAlbums(MediaFile dir) {
List<MediaFile> result = new ArrayList<>();
MediaFile parent = mediaFileService.getParentOf(dir);
if (!mediaFileService.isRoot(parent)) {
List<MediaFile> sieblings = mediaFileService.getChildrenOf(parent, false, true, true);
result.addAll(sieblings.stream().filter(siebling -> siebling.isAlbum() && !siebling.equals(dir)).collect(Collectors.toList()));
List<MediaFile> siblings = mediaFileService.getChildrenOf(parent, false, true, true);
result.addAll(siblings.stream().filter(sibling -> sibling.isAlbum() && !sibling.equals(dir)).collect(Collectors.toList()));
}
return result;
}

@ -437,7 +437,7 @@
</tr>
</c:forEach>
<c:if test="${model.viewAsList}">
<c:forEach items="${model.sieblingAlbums}" var="album" varStatus="loopStatus">
<c:forEach items="${model.siblingAlbums}" var="album" varStatus="loopStatus">
<tr>
<c:import url="playButtons.jsp">
<c:param name="id" value="${album.id}"/>
@ -461,7 +461,7 @@
<c:if test="${not model.viewAsList}">
<div style="float: left">
<c:forEach items="${model.sieblingAlbums}" var="album" varStatus="loopStatus">
<c:forEach items="${model.siblingAlbums}" var="album" varStatus="loopStatus">
<div class="albumThumb">
<c:import url="coverArt.jsp">
<c:param name="albumId" value="${album.id}"/>

Loading…
Cancel
Save