TESTING - Queue changing (enqueue/play_next)

This commit is contained in:
CappielloAntonio 2021-04-17 11:23:53 +02:00
parent a2770daaa8
commit 4696474db5
11 changed files with 158 additions and 53 deletions

View file

@ -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++;
}