mirror of
https://github.com/antebudimir/tempus.git
synced 2026-01-01 18:03:33 +00:00
Moved queue conversion logic to MappingUtil
This commit is contained in:
parent
9d61ac87bf
commit
c9010607fe
2 changed files with 14 additions and 23 deletions
|
|
@ -100,6 +100,20 @@ public class MappingUtil {
|
||||||
return songs;
|
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) {
|
public static ArrayList<Playlist> mapPlaylist(List<com.cappielloantonio.play.subsonic.models.Playlist> playlists) {
|
||||||
ArrayList<Playlist> playlist = new ArrayList();
|
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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue