mirror of
https://github.com/CappielloAntonio/tempo.git
synced 2026-02-01 15:03:37 +00:00
Moved queue conversion logic to MappingUtil
This commit is contained in:
@@ -100,6 +100,20 @@ 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 List<Queue> mapSongsToQueue(List<Song> songs) {
|
||||
List<Queue> queue = new ArrayList<>();
|
||||
|
||||
for (Song song : songs) {
|
||||
queue.add(mapSongToQueue(song));
|
||||
}
|
||||
|
||||
return queue;
|
||||
}
|
||||
|
||||
public static ArrayList<Playlist> mapPlaylist(List<com.cappielloantonio.play.subsonic.models.Playlist> playlists) {
|
||||
ArrayList<Playlist> playlist = new ArrayList();
|
||||
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
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 {
|
||||
private static final String TAG = "QueueUtil";
|
||||
|
||||
public static List<Queue> getQueueElementsFromSongs(List<Song> songs) {
|
||||
int counter = 0;
|
||||
List<Queue> queue = new ArrayList<>();
|
||||
|
||||
for (Song song : songs) {
|
||||
queue.add(new Queue(counter, song.getId(), song.getTitle(), song.getAlbumId(), song.getAlbumName(), song.getArtistId(), song.getArtistName(), song.getPrimary(), song.getDuration(), 0));
|
||||
counter++;
|
||||
}
|
||||
|
||||
return queue;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user