mirror of
https://github.com/antebudimir/tempus.git
synced 2026-01-01 01:53:31 +00:00
Finally fixed the music queue and swap logic
This commit is contained in:
parent
fc271e8b44
commit
60b741bc11
10 changed files with 134 additions and 140 deletions
|
|
@ -100,15 +100,15 @@ public class MappingUtil {
|
|||
return songs;
|
||||
}
|
||||
|
||||
public static Queue mapSongToQueue(Song song) {
|
||||
return new Queue(song.getId(), song.getTitle(), song.getAlbumId(), song.getAlbumName(), song.getArtistId(), song.getArtistName(), song.getPrimary(), song.getDuration(), 0);
|
||||
public static Queue mapSongToQueue(Song song, int trackOrder) {
|
||||
return new Queue(trackOrder, song.getId(), song.getTitle(), song.getAlbumId(), song.getAlbumName(), song.getArtistId(), song.getArtistName(), song.getPrimary(), song.getDuration(), 0);
|
||||
}
|
||||
|
||||
public static List<Queue> mapSongsToQueue(List<Song> songs) {
|
||||
List<Queue> queue = new ArrayList<>();
|
||||
|
||||
for (Song song : songs) {
|
||||
queue.add(mapSongToQueue(song));
|
||||
for (int counter = 0; counter < songs.size(); counter++) {
|
||||
queue.add(mapSongToQueue(songs.get(counter), counter));
|
||||
}
|
||||
|
||||
return queue;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue