2020-12-05 21:31:12 +01:00
|
|
|
package com.cappielloantonio.play.util;
|
|
|
|
|
|
|
|
|
|
import com.cappielloantonio.play.model.Queue;
|
|
|
|
|
import com.cappielloantonio.play.model.Song;
|
|
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
public class QueueUtil {
|
|
|
|
|
public static Queue getQueueElementFromSong(Song song) {
|
2020-12-08 11:12:44 +01:00
|
|
|
return new Queue(song.getId(), 0);
|
2020-12-05 21:31:12 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static List<Queue> getQueueElementsFromSongs(List<Song> songs) {
|
2021-04-16 18:00:19 +02:00
|
|
|
int counter = 0;
|
2020-12-05 21:31:12 +01:00
|
|
|
List<Queue> queue = new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
for(Song song: songs) {
|
2021-04-16 18:00:19 +02:00
|
|
|
queue.add(new Queue(song.getId(), counter));
|
|
|
|
|
counter++;
|
2020-12-05 21:31:12 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return queue;
|
|
|
|
|
}
|
|
|
|
|
}
|