Implemented download service

This commit is contained in:
CappielloAntonio 2021-07-29 17:12:55 +02:00
parent f09d3b774d
commit 0e41cc20bd
9 changed files with 332 additions and 10 deletions

View file

@ -2,6 +2,7 @@ package com.cappielloantonio.play.util;
import com.cappielloantonio.play.model.Album;
import com.cappielloantonio.play.model.Artist;
import com.cappielloantonio.play.model.Download;
import com.cappielloantonio.play.model.Playlist;
import com.cappielloantonio.play.model.Queue;
import com.cappielloantonio.play.model.Song;
@ -68,4 +69,28 @@ public class MappingUtil {
return playlist;
}
public static ArrayList<Song> mapDownload(List<Download> downloads) {
ArrayList<Song> songs = new ArrayList();
for(Download download : downloads){
songs.add(new Song(download));
}
return songs;
}
public static ArrayList<Download> mapToDownload(List<Song> songs) {
ArrayList<Download> downloads = new ArrayList();
for(Song song : songs){
downloads.add(new Download(song));
}
return downloads;
}
public static Download mapToDownload(Song song) {
return new Download(song);
}
}