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 {
|
2021-04-19 11:20:01 +02:00
|
|
|
private static final String TAG = "QueueUtil";
|
2021-04-17 11:23:53 +02:00
|
|
|
|
2021-08-09 00:23:09 +02: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<>();
|
|
|
|
|
|
2021-04-27 11:01:02 +02:00
|
|
|
for (Song song : songs) {
|
2021-08-12 17:56:03 +02:00
|
|
|
queue.add(new Queue(counter, song.getId(), song.getTitle(), song.getAlbumId(), song.getAlbumName(), song.getArtistId(), song.getArtistName(), song.getPrimary(), song.getDuration(), 0));
|
2021-04-17 11:23:53 +02:00
|
|
|
counter++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return queue;
|
|
|
|
|
}
|
2020-12-05 21:31:12 +01:00
|
|
|
}
|