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) { if (currentFile != null) {
index = files.indexOf(currentFile); index = files.indexOf(currentFile);
} }

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

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

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

Loading…
Cancel
Save