More lambdaification

master
jvoisin 5 years ago
parent 45d789b64e
commit 889add6848
  1. 2
      airsonic-main/src/main/java/org/airsonic/player/domain/PlayQueue.java
  2. 8
      airsonic-main/src/main/java/org/airsonic/player/service/LastFmService.java
  3. 2
      airsonic-main/src/main/java/org/airsonic/player/service/PodcastService.java
  4. 7
      airsonic-main/src/main/java/org/airsonic/player/service/UPnPService.java

@ -278,7 +278,7 @@ public class PlayQueue {
}
};
Collections.sort(files, comparator);
files.sort(comparator);
if (currentFile != null) {
index = files.indexOf(currentFile);
}

@ -19,7 +19,6 @@
package org.airsonic.player.service;
import com.google.common.base.Function;
import com.google.common.base.Predicates;
import com.google.common.collect.FluentIterable;
import com.google.common.collect.Lists;
@ -364,12 +363,7 @@ public class LastFmService {
Collection<Album> matches = Album.search(query.toString(), LAST_FM_KEY);
return FluentIterable.from(matches)
.transform(new Function<Album, LastFmCoverArt>() {
@Override
public LastFmCoverArt apply(Album album) {
return convert(album);
}
})
.transform(album1 -> convert(album1))
.filter(Predicates.notNull())
.toList();
} catch (Throwable x) {

@ -451,7 +451,7 @@ public class PodcastService {
}
// Sort episode in reverse chronological order (newest first)
Collections.sort(episodes, (a, b) -> {
episodes.sort((a, b) -> {
long timeA = a.getPublishDate() == null ? 0L : a.getPublishDate().getTime();
long timeB = b.getPublishDate() == null ? 0L : b.getPublishDate().getTime();

@ -76,12 +76,7 @@ public class UPnPService {
setMediaServerEnabled(true);
}
}
Runtime.getRuntime().addShutdownHook(new Thread() {
@Override
public void run() {
ensureServiceStopped();
}
});
Runtime.getRuntime().addShutdownHook(new Thread(() -> ensureServiceStopped()));
}
public void ensureServiceStarted() {

Loading…
Cancel
Save