Skip to content

Commit c1e8936

Browse files
authored
Fix typo in PlaylistManager.cs (extra =) and add missing return statement to GenerateNextSongId() switch
1 parent 6867e14 commit c1e8936

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Orchestrion/Audio/PlaylistManager.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ private static int GenerateNextSongId()
140140
return CurrentPlaylist.Songs[_currentSongIndex];
141141
case RepeatMode.Two:
142142
if (_currentSongIndex == -1) { // first repeat
143-
_currentSongIndex == -2;
143+
_currentSongIndex = -2;
144144
return CurrentPlaylist.Songs[0];
145145
} else if (_currentSongIndex == -2) { // second repeat
146146
_currentSongIndex = 0;
@@ -151,6 +151,7 @@ private static int GenerateNextSongId()
151151
} else { // ShuffleMode.On
152152
_currentSongIndex = Random.Shared.Next(CurrentPlaylist.Songs.Count);
153153
}
154+
return CurrentPlaylist.Songs[_currentSongIndex];
154155
}
155156
case RepeatMode.All when CurrentPlaylist.ShuffleMode == ShuffleMode.Off:
156157
_currentSongIndex = ++_currentSongIndex % CurrentPlaylist.Songs.Count;

0 commit comments

Comments
 (0)