mirror of
https://github.com/antebudimir/tempus.git
synced 2025-12-31 17:43:32 +00:00
54 lines
1.4 KiB
Java
54 lines
1.4 KiB
Java
package com.cappielloantonio.play.util;
|
|
|
|
import com.cappielloantonio.play.model.Album;
|
|
import com.cappielloantonio.play.model.Artist;
|
|
import com.cappielloantonio.play.model.Queue;
|
|
import com.cappielloantonio.play.model.Song;
|
|
import com.cappielloantonio.play.subsonic.models.AlbumID3;
|
|
import com.cappielloantonio.play.subsonic.models.ArtistID3;
|
|
import com.cappielloantonio.play.subsonic.models.Child;
|
|
|
|
import java.util.ArrayList;
|
|
import java.util.List;
|
|
|
|
public class MappingUtil {
|
|
public static ArrayList<Song> mapSong(List<Child> children) {
|
|
ArrayList<Song> songs = new ArrayList();
|
|
|
|
for(Child child : children){
|
|
songs.add(new Song(child));
|
|
}
|
|
|
|
return songs;
|
|
}
|
|
|
|
public static ArrayList<Album> mapAlbum(List<AlbumID3> albumID3List) {
|
|
ArrayList<Album> albums = new ArrayList();
|
|
|
|
for(AlbumID3 albumID3 : albumID3List){
|
|
albums.add(new Album(albumID3));
|
|
}
|
|
|
|
return albums;
|
|
}
|
|
|
|
public static ArrayList<Artist> mapArtist(List<ArtistID3> albumID3List) {
|
|
ArrayList<Artist> artists = new ArrayList();
|
|
|
|
for(ArtistID3 artistID3 : albumID3List){
|
|
artists.add(new Artist(artistID3));
|
|
}
|
|
|
|
return artists;
|
|
}
|
|
|
|
public static ArrayList<Song> mapQueue(List<Queue> queueList) {
|
|
ArrayList<Song> songs = new ArrayList();
|
|
|
|
for(Queue item : queueList){
|
|
songs.add(new Song(item));
|
|
}
|
|
|
|
return songs;
|
|
}
|
|
}
|