Changes from code review: fixes the incorrect class for logging in

DispatchingContentDirectory, broadcasts search capabilities, and removes
an assignment that was not longer necessary.

Also added a couple of comments for clarity on the '- All Albums-' options.
master
Allen Petersen 8 years ago
parent b3ae8faac6
commit 8930f1833b
  1. 2
      libresonic-main/src/main/java/org/libresonic/player/service/upnp/ArtistUpnpProcessor.java
  2. 3
      libresonic-main/src/main/java/org/libresonic/player/service/upnp/DispatchingContentDirectory.java
  3. 5
      libresonic-main/src/main/java/org/libresonic/player/service/upnp/LibresonicContentDirectory.java
  4. 2
      libresonic-main/src/main/java/org/libresonic/player/service/upnp/RecentAlbumUpnpProcessor.java

@ -73,6 +73,8 @@ public class ArtistUpnpProcessor extends UpnpContentProcessor <Artist, Album> {
List<MusicFolder> allFolders = getDispatcher().getSettingsService().getAllMusicFolders(); List<MusicFolder> allFolders = getDispatcher().getSettingsService().getAllMusicFolders();
List<Album> allAlbums = getAlbumProcessor().getAlbumDao().getAlbumsForArtist(artist.getName(), allFolders); List<Album> allAlbums = getAlbumProcessor().getAlbumDao().getAlbumsForArtist(artist.getName(), allFolders);
if (allAlbums.size() > 1) { if (allAlbums.size() > 1) {
// if the artist has more than one album, add in an option to
// view the tracks in all the albums together
Album viewAll = new Album(); Album viewAll = new Album();
viewAll.setName("- All Albums -"); viewAll.setName("- All Albums -");
viewAll.setId(-1); viewAll.setId(-1);

@ -51,7 +51,7 @@ import java.util.Arrays;
*/ */
public class DispatchingContentDirectory extends LibresonicContentDirectory { public class DispatchingContentDirectory extends LibresonicContentDirectory {
public static final Logger LOG = LoggerFactory.getLogger(FolderBasedContentDirectory.class); public static final Logger LOG = LoggerFactory.getLogger(DispatchingContentDirectory.class);
public static final String CONTAINER_ID_ROOT = "0"; public static final String CONTAINER_ID_ROOT = "0";
public static final String CONTAINER_ID_PLAYLIST_PREFIX = "playlist"; public static final String CONTAINER_ID_PLAYLIST_PREFIX = "playlist";
@ -118,7 +118,6 @@ public class DispatchingContentDirectory extends LibresonicContentDirectory {
// if it's null then assume it's a file, and that the id // if it's null then assume it's a file, and that the id
// is all that's there. // is all that's there.
itemId = browseRoot; itemId = browseRoot;
browseRoot = "folder";
processor = getMediaFileProcessor(); processor = getMediaFileProcessor();
} }

@ -19,6 +19,7 @@
*/ */
package org.libresonic.player.service.upnp; package org.libresonic.player.service.upnp;
import com.google.common.collect.Lists;
import org.apache.commons.io.FilenameUtils; import org.apache.commons.io.FilenameUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.fourthline.cling.support.contentdirectory.AbstractContentDirectoryService; import org.fourthline.cling.support.contentdirectory.AbstractContentDirectoryService;
@ -51,6 +52,10 @@ public abstract class LibresonicContentDirectory extends AbstractContentDirector
private TranscodingService transcodingService; private TranscodingService transcodingService;
protected JWTSecurityService jwtSecurityService; protected JWTSecurityService jwtSecurityService;
public LibresonicContentDirectory() {
super(Lists.newArrayList("*"), Lists.newArrayList());
}
protected Res createResourceForSong(MediaFile song) { protected Res createResourceForSong(MediaFile song) {
Player player = playerService.getGuestPlayer(null); Player player = playerService.getGuestPlayer(null);

@ -39,6 +39,8 @@ public class RecentAlbumUpnpProcessor extends AlbumUpnpProcessor {
List<MusicFolder> allFolders = getDispatchingContentDirectory().getSettingsService().getAllMusicFolders(); List<MusicFolder> allFolders = getDispatchingContentDirectory().getSettingsService().getAllMusicFolders();
List<Album> recentAlbums = getAlbumDao().getNewestAlbums(0, RECENT_COUNT, allFolders); List<Album> recentAlbums = getAlbumDao().getNewestAlbums(0, RECENT_COUNT, allFolders);
if (recentAlbums.size() > 1) { if (recentAlbums.size() > 1) {
// if there is more than one recent album, add in an option to
// view the tracks in all the recent albums together
Album viewAll = new Album(); Album viewAll = new Album();
viewAll.setName("- All Albums -"); viewAll.setName("- All Albums -");
viewAll.setId(-1); viewAll.setId(-1);

Loading…
Cancel
Save