TESTING - Queue changing (enqueue/play_next)
This commit is contained in:
1 parent
a2770daaa8
commit
4696474db5
11 files changed
+158
-53
No files matched your search
@@ -8,7 +8,11 @@ import java.util.List;
|
||||
|
||||
public class QueueUtil {
|
||||
public static Queue getQueueElementFromSong(Song song) {
|
||||
return new Queue(song.getId(), 0);
|
||||
return new Queue(0, song.getId());
|
||||
}
|
||||
|
||||
public static Queue getQueueElementFromSong(Song song, int startingPosition) {
|
||||
return new Queue(startingPosition, song.getId());
|
||||
}
|
||||
|
||||
public static List<Queue> getQueueElementsFromSongs(List<Song> songs) {
|
||||
@@ -16,7 +20,19 @@ public class QueueUtil {
|
||||
List<Queue> queue = new ArrayList<>();
|
||||
|
||||
for(Song song: songs) {
|
||||
queue.add(new Queue(song.getId(), counter));
|
||||
queue.add(new Queue(counter, song.getId()));
|
||||
counter++;
|
||||
}
|
||||
|
||||
return queue;
|
||||
}
|
||||
|
||||
public static List<Queue> getQueueElementsFromSongs(List<Song> songs, int startingPosition) {
|
||||
int counter = startingPosition;
|
||||
List<Queue> queue = new ArrayList<>();
|
||||
|
||||
for(Song song: songs) {
|
||||
queue.add(new Queue(counter, song.getId()));
|
||||
counter++;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user