@ -97,8 +97,8 @@ public class LyricsService {
Namespace ns = root.getNamespace();
String lyric = StringUtils.trimToNull(root.getChildText("Lyric", ns));
String song = root.getChildText("LyricSong", ns);
String artist = root.getChildText("LyricArtist", ns);
return new LyricsInfo(lyric, artist, song);
}
@ -56,7 +56,7 @@ import java.util.Map;
*/
@Controller
@RequestMapping("/avatarUpload")
public class AvatarUploadController {
private static final Logger LOG = LoggerFactory.getLogger(AvatarUploadController.class);
private static final int MAX_AVATAR_SIZE = 64;
@ -42,7 +42,7 @@ import java.util.Map;
@RequestMapping("/changeCoverArt")
public class ChangeCoverArtController {
@Autowired
private MediaFileService mediaFileService;
@ -300,7 +300,7 @@ public class CoverArtController implements LastModified {
throw new RuntimeException(e);
} else {
is = new FileInputStream(file);
mimeType = StringUtil.getMimeType(FilenameUtils.getExtension(file.getName()));
return Pair.of(is, mimeType);
@ -47,7 +47,7 @@ import java.util.Map;
@RequestMapping("/editTags")
public class EditTagsController {
private MetaDataParserFactory metaDataParserFactory;
@ -40,7 +40,7 @@ import java.util.Locale;
@RequestMapping("/generalSettings")
public class GeneralSettingsController {
private SettingsService settingsService;
@ -42,7 +42,7 @@ import static org.springframework.web.bind.ServletRequestUtils.getStringParamete
@RequestMapping("/home")
public class HomeController {
private static final int LIST_SIZE = 40;
@ -45,7 +45,7 @@ import java.util.*;
@RequestMapping("/left")
public class LeftController {
// Update this time if you want to force a refresh in clients.
private static final Calendar LAST_COMPATIBILITY_TIME = Calendar.getInstance();
@ -46,7 +46,7 @@ import java.util.List;
@RequestMapping("/play.m3u")
public class M3UController {
private PlayerService playerService;
@ -89,7 +89,7 @@ public class M3UController {
out.println("#EXTINF:" + duration + "," + mediaFile.getArtist() + " - " + mediaFile.getTitle());
String urlNoAuth = url + "player=" + player.getId() + "&id=" + mediaFile.getId() + "&suffix=." +
transcodingService.getSuffix(player, mediaFile, null);
String urlWithAuth = jwtSecurityService.addJWTToken(urlNoAuth);
out.println(urlWithAuth);
@ -44,7 +44,7 @@ import java.util.stream.Collectors;
@RequestMapping("/main")
public class MainController {
private SecurityService securityService;
@ -48,7 +48,7 @@ import java.util.Map;
@RequestMapping("/more")
public class MoreController {
@ -45,7 +45,7 @@ import java.util.Locale;
@RequestMapping("/personalSettings")
public class PersonalSettingsController {
@ -49,7 +49,7 @@ import java.util.List;
@RequestMapping("/playerSettings")
public class PlayerSettingsController {
@RequestMapping("/podcast")
public class PodcastController {
private static final DateFormat RSS_DATE_FORMAT = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss Z", Locale.US);
@ -46,7 +46,7 @@ import static org.springframework.http.HttpStatus.OK;
@RequestMapping("/proxy")
public class ProxyController {
@GetMapping
public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) throws Exception {
@ -41,7 +41,7 @@ import java.util.Map;
@RequestMapping("/right")
public class RightController {
@ -37,7 +37,7 @@ import javax.servlet.http.HttpServletRequest;
@RequestMapping("/settings")
public class SettingsController {
@ -44,7 +44,7 @@ import java.util.*;
@RequestMapping("/createShare")
public class ShareManagementController {
@ -60,7 +60,7 @@ public class AbstractDao {
protected String questionMarks(String columns) {
int numberOfColumns = StringUtils.countMatches(columns, ",") + 1;
return StringUtils.repeat("?", ", ", numberOfColumns);
@ -74,7 +74,7 @@ public class MediaFileComparator implements Comparator<MediaFile> {
return a.getPath().compareToIgnoreCase(b.getPath());
private <T extends Comparable<T>> int nullSafeCompare(T a, T b, boolean nullIsSmaller) {
if (a == null && b == null) {
return 0;
@ -99,7 +99,7 @@ public class MetricsManager {
public Timer timer(Class clazz, String name) {
com.codahale.metrics.Timer t = metrics.timer(MetricRegistry.name(clazz,name));
com.codahale.metrics.Timer.Context tContext = t.time();
return new Timer(tContext);
@ -143,7 +143,7 @@ public class MetricsManager {
@Override
public void close() {
// Does nothing
@ -53,7 +53,7 @@ public class NetworkService {
String baseUrl = uri.toString() + "/";
LOG.debug("Calculated base url to " + baseUrl);
return baseUrl;
} catch (MalformedURLException | URISyntaxException e) {
throw new RuntimeException("Could not calculate base url: " + e.getMessage());
@ -97,7 +97,7 @@ public class DocumentFactory {
doc.add(new StoredField(field, value, TYPE_KEY));
};
private BiConsumer<@NonNull Document, @NonNull String> fieldMediatype = (doc, value) ->
fieldKey.accept(doc, FieldNames.MEDIA_TYPE, value);
private BiConsumer<@NonNull Document, @NonNull String> fieldFolderPath = (doc, value) ->
@ -44,9 +44,9 @@ public class SearchServiceImpl implements SearchService {
private static final Logger LOG = LoggerFactory.getLogger(SearchServiceImpl.class);
private QueryFactory queryFactory;
private IndexManager indexManager;
private SearchServiceUtilities util;
@ -117,7 +117,7 @@ public class AlbumUpnpProcessor extends UpnpContentProcessor <Album, MediaFile>
List<Album> albumList = null;
if (album.getComment().startsWith(ALL_BY_ARTIST)) {
ArtistUpnpProcessor ap = getDispatcher().getArtistProcessor();
albumList = ap.getChildren(ap.getItemById(album.getComment().replaceAll(ALL_BY_ARTIST + "_", "")));
} else if (album.getComment().equalsIgnoreCase(ALL_RECENT)) {
albumList = getDispatcher().getRecentAlbumProcessor().getAllItems();
@ -73,7 +73,7 @@ public class ArtistUpnpProcessor extends UpnpContentProcessor <Artist, Album> {
return getArtistDao().getArtist(Integer.parseInt(id));
public List<Album> getChildren(Artist artist) {
List<MusicFolder> allFolders = getDispatcher().getSettingsService().getAllMusicFolders();
List<Album> allAlbums = getAlbumProcessor().getAlbumDao().getAlbumsForArtist(artist.getName(), allFolders);
if (allAlbums.size() > 1) {
@ -93,7 +93,7 @@ public class GenreUpnpProcessor extends UpnpContentProcessor <Genre, MediaFile>
return null;
public List<MediaFile> getChildren(Genre item) {
return getDispatcher().getMediaFileProcessor().getMediaFileDao().getSongsByGenre(item.getName(), 0, Integer.MAX_VALUE, allFolders);
@ -125,7 +125,7 @@ public abstract class UpnpContentProcessor<T extends Object, U extends Object> {
SortCriterion[] orderBy) {
DIDLContent didl = new DIDLContent();
Class clazz = (Class) ((ParameterizedType) getClass().getGenericSuperclass()).getActualTypeArguments()[0];
try {
List<MusicFolder> allFolders = getDispatchingContentDirectory().getSettingsService().getAllMusicFolders();
@ -38,7 +38,7 @@ public class RegisterPrecompiledJSPInitializer implements ServletContextInitiali
private static void registerPrecompiledJSPs(ServletContext servletContext) {
WebApp webApp = parseXmlFragment();
for (ServletDef def : webApp.getServletDefs()) {
LOG.trace("Registering precompiled JSP: {} -> {}", def.getName(), def.getSclass());
ServletRegistration.Dynamic reg = servletContext.addServlet(def.getName(), def.getSclass());
// Need to set loadOnStartup somewhere between 0 and 128. 0 is highest priority. 99 should be fine
@ -6,7 +6,7 @@ import java.util.Properties;
import java.util.SortedMap;
import java.util.TreeMap;
public class MissingTranslations {
public static void main(String[] args) throws IOException {
String[] locales = {"da", "de", "es", "pt", "fi", "fr", "is", "it", "ja_JP", "mk", "nl", "no", "pl", "ru", "sl", "sv", "zh_CN", "zh_TW"};
@ -31,7 +31,7 @@ public class VersionTestCase extends TestCase {
/**
* Tests that equals(), hashCode(), toString() and compareTo() works.
public void testVersion() {
doTestVersion("0.0", "0.1");
doTestVersion("1.5", "2.3");
doTestVersion("2.3", "2.34");
@ -69,7 +69,7 @@ public class QueryFactoryTestCase {
new MusicFolder(FID2, new File(PATH2), "music2", true, new java.util.Date());
private static final List<MusicFolder> SINGLE_FOLDERS = Arrays.asList(MUSIC_FOLDER1);
private static final List<MusicFolder> MULTI_FOLDERS = Arrays.asList(MUSIC_FOLDER1, MUSIC_FOLDER2);
/*
@ -21,7 +21,7 @@ public class PasswordSettingsValidatorTestCase extends TestCase {
PasswordSettingsValidator psv = new PasswordSettingsValidator();
Errors errors = new BeanPropertyBindingResult(psc, "psv");
psv.validate(psc, errors);
return errors;
public void testValidateEmptyPassword() {
@ -57,6 +57,7 @@
<module name="RequireThis"/>
<module name="SimplifyBooleanExpression"/>
<module name="SimplifyBooleanReturn"/>
<module name="SingleSpaceSeparator"/>
<module name="StringLiteralEquality"/>
<module name="SuperClone"/>
<module name="SuperFinalize"/>