Skip to content

Commit aee0b76

Browse files
committed
Logging + simplifying PlaylistProvider
1 parent 07109da commit aee0b76

17 files changed

Lines changed: 49 additions & 69 deletions

conf.properties

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ player.preferredAudioQuality=VORBIS_160
3333
player.normalisationPregain=0
3434
# Initial volume (0-65536)
3535
player.initialVolume=65536
36-
# Default unshuffle behaviour (can't unshuffle if client is loaded with shuffled playlist)
37-
player.defaultUnshuffleBehaviour=false
3836
# Log available mixers
3937
player.logAvailableMixers=true
4038
# Mixer/backend search keywords

core/src/main/java/xyz/gianlu/librespot/DefaultConfiguration.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,6 @@ public float normalisationPregain() {
2828
return 0;
2929
}
3030

31-
@Override
32-
public boolean defaultUnshuffleBehaviour() {
33-
return false;
34-
}
35-
3631
@Override
3732
public @NotNull String[] mixerSearchKeywords() {
3833
return new String[0];

core/src/main/java/xyz/gianlu/librespot/FileConfiguration.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -121,11 +121,6 @@ public float normalisationPregain() {
121121
return getFloat("player.normalisationPregain", defaults.normalisationPregain());
122122
}
123123

124-
@Override
125-
public boolean defaultUnshuffleBehaviour() {
126-
return getBoolean("player.defaultUnshuffleBehaviour", defaults.defaultUnshuffleBehaviour());
127-
}
128-
129124
@NotNull
130125
@Override
131126
public String[] mixerSearchKeywords() {

core/src/main/java/xyz/gianlu/librespot/player/Player.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ private void handleSeek(int pos) {
294294

295295
private void loadTracksProvider(@NotNull String uri) throws SpotifyContext.UnsupportedContextException {
296296
SpotifyContext context = SpotifyContext.from(uri);
297-
tracksProvider = context.initProvider(session, state.state, conf);
297+
tracksProvider = context.initProvider(session, state.state);
298298
}
299299

300300
@Override
@@ -618,8 +618,6 @@ public interface Configuration {
618618

619619
float normalisationPregain();
620620

621-
boolean defaultUnshuffleBehaviour();
622-
623621
@Nullable
624622
String[] mixerSearchKeywords();
625623

core/src/main/java/xyz/gianlu/librespot/player/contexts/AlbumContext.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import org.jetbrains.annotations.NotNull;
44
import xyz.gianlu.librespot.common.proto.Spirc;
55
import xyz.gianlu.librespot.core.Session;
6-
import xyz.gianlu.librespot.player.Player;
76
import xyz.gianlu.librespot.player.tracks.PlaylistProvider;
87
import xyz.gianlu.librespot.player.tracks.TracksProvider;
98

@@ -12,7 +11,7 @@
1211
*/
1312
public final class AlbumContext extends AbsTrackContext {
1413
@Override
15-
public @NotNull TracksProvider initProvider(@NotNull Session session, Spirc.State.@NotNull Builder state, Player.@NotNull Configuration conf) {
16-
return new PlaylistProvider(session, state, conf);
14+
public @NotNull TracksProvider initProvider(@NotNull Session session, Spirc.State.@NotNull Builder state) {
15+
return new PlaylistProvider(session, state);
1716
}
1817
}

core/src/main/java/xyz/gianlu/librespot/player/contexts/ArtistContext.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import org.jetbrains.annotations.NotNull;
44
import xyz.gianlu.librespot.common.proto.Spirc;
55
import xyz.gianlu.librespot.core.Session;
6-
import xyz.gianlu.librespot.player.Player;
76
import xyz.gianlu.librespot.player.tracks.PlaylistProvider;
87
import xyz.gianlu.librespot.player.tracks.TracksProvider;
98

@@ -12,7 +11,7 @@
1211
*/
1312
public final class ArtistContext extends AbsTrackContext {
1413
@Override
15-
public @NotNull TracksProvider initProvider(@NotNull Session session, Spirc.State.@NotNull Builder state, Player.@NotNull Configuration conf) {
16-
return new PlaylistProvider(session, state, conf);
14+
public @NotNull TracksProvider initProvider(@NotNull Session session, Spirc.State.@NotNull Builder state) {
15+
return new PlaylistProvider(session, state);
1716
}
1817
}

core/src/main/java/xyz/gianlu/librespot/player/contexts/CollectionContext.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import org.jetbrains.annotations.NotNull;
44
import xyz.gianlu.librespot.common.proto.Spirc;
55
import xyz.gianlu.librespot.core.Session;
6-
import xyz.gianlu.librespot.player.Player;
76
import xyz.gianlu.librespot.player.tracks.PlaylistProvider;
87
import xyz.gianlu.librespot.player.tracks.TracksProvider;
98

@@ -12,7 +11,7 @@
1211
*/
1312
public final class CollectionContext extends AbsTrackContext {
1413
@Override
15-
public @NotNull TracksProvider initProvider(@NotNull Session session, Spirc.State.@NotNull Builder state, Player.@NotNull Configuration conf) {
16-
return new PlaylistProvider(session, state, conf);
14+
public @NotNull TracksProvider initProvider(@NotNull Session session, Spirc.State.@NotNull Builder state) {
15+
return new PlaylistProvider(session, state);
1716
}
1817
}

core/src/main/java/xyz/gianlu/librespot/player/contexts/DailyMixContext.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import org.jetbrains.annotations.NotNull;
44
import xyz.gianlu.librespot.common.proto.Spirc;
55
import xyz.gianlu.librespot.core.Session;
6-
import xyz.gianlu.librespot.player.Player;
76
import xyz.gianlu.librespot.player.tracks.StationProvider;
87
import xyz.gianlu.librespot.player.tracks.TracksProvider;
98

@@ -12,7 +11,7 @@
1211
*/
1312
public final class DailyMixContext extends AbsTrackContext {
1413
@Override
15-
public @NotNull TracksProvider initProvider(@NotNull Session session, Spirc.State.@NotNull Builder state, Player.@NotNull Configuration conf) {
14+
public @NotNull TracksProvider initProvider(@NotNull Session session, Spirc.State.@NotNull Builder state) {
1615
return new StationProvider(session, state);
1716
}
1817
}

core/src/main/java/xyz/gianlu/librespot/player/contexts/EpisodeContext.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import org.jetbrains.annotations.NotNull;
44
import xyz.gianlu.librespot.common.proto.Spirc;
55
import xyz.gianlu.librespot.core.Session;
6-
import xyz.gianlu.librespot.player.Player;
76
import xyz.gianlu.librespot.player.tracks.ShowProvider;
87
import xyz.gianlu.librespot.player.tracks.TracksProvider;
98

@@ -12,7 +11,7 @@
1211
*/
1312
public final class EpisodeContext extends AbsEpisodeContext {
1413
@Override
15-
public @NotNull TracksProvider initProvider(@NotNull Session session, Spirc.State.@NotNull Builder state, Player.@NotNull Configuration conf) {
14+
public @NotNull TracksProvider initProvider(@NotNull Session session, Spirc.State.@NotNull Builder state) {
1615
return new ShowProvider(state);
1716
}
1817
}

core/src/main/java/xyz/gianlu/librespot/player/contexts/GenreContext.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import org.jetbrains.annotations.NotNull;
44
import xyz.gianlu.librespot.common.proto.Spirc;
55
import xyz.gianlu.librespot.core.Session;
6-
import xyz.gianlu.librespot.player.Player;
76
import xyz.gianlu.librespot.player.tracks.PlaylistProvider;
87
import xyz.gianlu.librespot.player.tracks.TracksProvider;
98

@@ -12,7 +11,7 @@
1211
*/
1312
public final class GenreContext extends AbsTrackContext {
1413
@Override
15-
public @NotNull TracksProvider initProvider(@NotNull Session session, Spirc.State.@NotNull Builder state, Player.@NotNull Configuration conf) {
16-
return new PlaylistProvider(session, state, conf);
14+
public @NotNull TracksProvider initProvider(@NotNull Session session, Spirc.State.@NotNull Builder state) {
15+
return new PlaylistProvider(session, state);
1716
}
1817
}

0 commit comments

Comments
 (0)