mirror of
https://github.com/CappielloAntonio/tempo.git
synced 2026-02-01 15:03:37 +00:00
Finally fixed the music queue and swap logic
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user