mirror of
https://github.com/CappielloAntonio/tempo.git
synced 2026-02-01 15:03:37 +00:00
TESTING - Queue changing (enqueue/play_next)
This commit is contained in:
@@ -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