Removed unused variables, imports, empty statements (#1361)

Also some unnecessary whitespace.
master
Evan Harris 5 years ago committed by Jonas L
parent 821d8d6b8c
commit a79b56fe5a
  1. 7
      airsonic-main/src/main/java/org/airsonic/player/ajax/PlayQueueService.java
  2. 1
      airsonic-main/src/main/java/org/airsonic/player/controller/ImportPlaylistController.java
  3. 1
      airsonic-main/src/main/java/org/airsonic/player/controller/InternetRadioSettingsController.java
  4. 4
      airsonic-main/src/main/java/org/airsonic/player/io/ShoutCastOutputStream.java
  5. 1
      airsonic-main/src/main/java/org/airsonic/player/service/SettingsService.java
  6. 10
      airsonic-main/src/main/java/org/airsonic/player/service/search/DocumentFactory.java
  7. 7
      airsonic-main/src/main/java/org/airsonic/player/service/search/QueryFactory.java

@ -28,8 +28,6 @@ import org.airsonic.player.service.*;
import org.airsonic.player.service.PlaylistService; import org.airsonic.player.service.PlaylistService;
import org.airsonic.player.util.StringUtil; import org.airsonic.player.util.StringUtil;
import org.directwebremoting.WebContextFactory; import org.directwebremoting.WebContextFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.web.servlet.support.RequestContextUtils; import org.springframework.web.servlet.support.RequestContextUtils;
@ -82,8 +80,6 @@ public class PlayQueueService {
@Autowired @Autowired
private InternetRadioService internetRadioService; private InternetRadioService internetRadioService;
private static final Logger LOG = LoggerFactory.getLogger(PlayQueueService.class);
/** /**
* Returns the play queue for the player of the current user. * Returns the play queue for the player of the current user.
* *
@ -382,7 +378,6 @@ public class PlayQueueService {
HttpServletRequest request = WebContextFactory.get().getHttpServletRequest(); HttpServletRequest request = WebContextFactory.get().getHttpServletRequest();
HttpServletResponse response = WebContextFactory.get().getHttpServletResponse(); HttpServletResponse response = WebContextFactory.get().getHttpServletResponse();
String username = securityService.getCurrentUsername(request); String username = securityService.getCurrentUsername(request);
UserSettings userSettings = settingsService.getUserSettings(securityService.getCurrentUsername(request));
MusicFolder selectedMusicFolder = settingsService.getSelectedMusicFolder(username); MusicFolder selectedMusicFolder = settingsService.getSelectedMusicFolder(username);
List<MusicFolder> musicFolders = settingsService.getMusicFoldersForUser(username, List<MusicFolder> musicFolders = settingsService.getMusicFoldersForUser(username,
@ -664,8 +659,6 @@ public class PlayQueueService {
private PlayQueueInfo convert(HttpServletRequest request, Player player, boolean serverSidePlaylist, int offset) { private PlayQueueInfo convert(HttpServletRequest request, Player player, boolean serverSidePlaylist, int offset) {
String url = NetworkService.getBaseUrl(request);
Locale locale = RequestContextUtils.getLocale(request);
PlayQueue playQueue = player.getPlayQueue(); PlayQueue playQueue = player.getPlayQueue();
List<PlayQueueInfo.Entry> entries; List<PlayQueueInfo.Entry> entries;

@ -76,7 +76,6 @@ public class ImportPlaylistController {
} }
String playlistName = FilenameUtils.getBaseName(item.getName()); String playlistName = FilenameUtils.getBaseName(item.getName());
String fileName = FilenameUtils.getName(item.getName()); String fileName = FilenameUtils.getName(item.getName());
String format = StringUtils.lowerCase(FilenameUtils.getExtension(item.getName()));
String username = securityService.getCurrentUsername(request); String username = securityService.getCurrentUsername(request);
Playlist playlist = playlistService.importPlaylist(username, playlistName, fileName, Playlist playlist = playlistService.importPlaylist(username, playlistName, fileName,
item.getInputStream(), null); item.getInputStream(), null);

@ -64,7 +64,6 @@ public class InternetRadioSettingsController {
public String doPost(HttpServletRequest request, RedirectAttributes redirectAttributes) { public String doPost(HttpServletRequest request, RedirectAttributes redirectAttributes) {
String error = handleParameters(request); String error = handleParameters(request);
Map<String, Object> map = new HashMap<>();
if (error == null) { if (error == null) {
redirectAttributes.addFlashAttribute("settings_toast", true); redirectAttributes.addFlashAttribute("settings_toast", true);
redirectAttributes.addFlashAttribute("settings_reload", true); redirectAttributes.addFlashAttribute("settings_reload", true);

@ -23,8 +23,6 @@ import org.airsonic.player.domain.MediaFile;
import org.airsonic.player.domain.PlayQueue; import org.airsonic.player.domain.PlayQueue;
import org.airsonic.player.service.SettingsService; import org.airsonic.player.service.SettingsService;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.IOException; import java.io.IOException;
import java.io.OutputStream; import java.io.OutputStream;
@ -40,8 +38,6 @@ import java.nio.charset.StandardCharsets;
*/ */
public class ShoutCastOutputStream extends OutputStream { public class ShoutCastOutputStream extends OutputStream {
private static final Logger LOG = LoggerFactory.getLogger(ShoutCastOutputStream.class);
/** /**
* Number of bytes between each SHOUTcast metadata block. * Number of bytes between each SHOUTcast metadata block.
*/ */

@ -168,7 +168,6 @@ public class SettingsService {
private static final int DEFAULT_PODCAST_EPISODE_DOWNLOAD_COUNT = 1; private static final int DEFAULT_PODCAST_EPISODE_DOWNLOAD_COUNT = 1;
private static final long DEFAULT_DOWNLOAD_BITRATE_LIMIT = 0; private static final long DEFAULT_DOWNLOAD_BITRATE_LIMIT = 0;
private static final long DEFAULT_UPLOAD_BITRATE_LIMIT = 0; private static final long DEFAULT_UPLOAD_BITRATE_LIMIT = 0;
private static final boolean DEFAULT_ENABLE_SEEK = true;
private static final String DEFAULT_DOWNSAMPLING_COMMAND = "ffmpeg -i %s -map 0:0 -b:a %bk -v 0 -f mp3 -"; private static final String DEFAULT_DOWNSAMPLING_COMMAND = "ffmpeg -i %s -map 0:0 -b:a %bk -v 0 -f mp3 -";
private static final String DEFAULT_HLS_COMMAND = "ffmpeg -ss %o -t %d -i %s -async 1 -b:v %bk -s %wx%h -ar 44100 -ac 2 -v 0 -f mpegts -c:v libx264 -preset superfast -c:a libmp3lame -threads 0 -"; private static final String DEFAULT_HLS_COMMAND = "ffmpeg -ss %o -t %d -i %s -async 1 -b:v %bk -s %wx%h -ar 44100 -ac 2 -v 0 -f mpegts -c:v libx264 -preset superfast -c:a libmp3lame -threads 0 -";
private static final String DEFAULT_JUKEBOX_COMMAND = "ffmpeg -ss %o -i %s -map 0:0 -v 0 -ar 44100 -ac 2 -f s16be -"; private static final String DEFAULT_JUKEBOX_COMMAND = "ffmpeg -ss %o -i %s -map 0:0 -v 0 -ar 44100 -ac 2 -f s16be -";

@ -85,8 +85,6 @@ public class DocumentFactory {
} }
;
private BiConsumer<@NonNull Document, @NonNull Integer> fieldId = (doc, value) -> { private BiConsumer<@NonNull Document, @NonNull Integer> fieldId = (doc, value) -> {
doc.add(new StoredField(FieldNames.ID, Integer.toString(value), TYPE_ID)); doc.add(new StoredField(FieldNames.ID, Integer.toString(value), TYPE_ID));
}; };
@ -129,19 +127,19 @@ public class DocumentFactory {
public final Term createPrimarykey(Integer id) { public final Term createPrimarykey(Integer id) {
return new Term(FieldNames.ID, Integer.toString(id)); return new Term(FieldNames.ID, Integer.toString(id));
}; }
public final Term createPrimarykey(Album album) { public final Term createPrimarykey(Album album) {
return createPrimarykey(album.getId()); return createPrimarykey(album.getId());
}; }
public final Term createPrimarykey(Artist artist) { public final Term createPrimarykey(Artist artist) {
return createPrimarykey(artist.getId()); return createPrimarykey(artist.getId());
}; }
public final Term createPrimarykey(MediaFile mediaFile) { public final Term createPrimarykey(MediaFile mediaFile) {
return createPrimarykey(mediaFile.getId()); return createPrimarykey(mediaFile.getId());
}; }
/** /**
* Create a document. * Create a document.

@ -141,8 +141,7 @@ public class QueryFactory {
} }
return mainQuery.build(); return mainQuery.build();
}
};
/* /*
* XXX 3.x -> 8.x : * XXX 3.x -> 8.x :
@ -178,7 +177,6 @@ public class QueryFactory {
mainQuery.add(folderQuery, Occur.MUST); mainQuery.add(folderQuery, Occur.MUST);
return mainQuery.build(); return mainQuery.build();
} }
/** /**
@ -213,7 +211,6 @@ public class QueryFactory {
query.add(toFolderQuery.apply(false, criteria.getMusicFolders()), Occur.MUST); query.add(toFolderQuery.apply(false, criteria.getMusicFolders()), Occur.MUST);
return query.build(); return query.build();
} }
/** /**
@ -255,7 +252,6 @@ public class QueryFactory {
} }
return mainQuery.build(); return mainQuery.build();
} }
/** /**
@ -283,5 +279,4 @@ public class QueryFactory {
.add(toFolderQuery.apply(true, musicFolders), Occur.SHOULD) .add(toFolderQuery.apply(true, musicFolders), Occur.SHOULD)
.build(); .build();
} }
} }

Loading…
Cancel
Save