mirror of
https://github.com/antebudimir/tempus.git
synced 2026-01-01 18:03:33 +00:00
TESTING - Queue changing (enqueue/play_next)
This commit is contained in:
parent
a2770daaa8
commit
4696474db5
11 changed files with 158 additions and 53 deletions
|
|
@ -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++;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue