mirror of
https://github.com/antebudimir/tempus.git
synced 2026-01-02 02:13:33 +00:00
First implementation of the panel dedicated to the download, divided by type of the downloaded resource
This commit is contained in:
parent
8789b44e26
commit
23568bae9b
16 changed files with 609 additions and 102 deletions
|
|
@ -105,16 +105,45 @@ public class MappingUtil {
|
|||
return playlist;
|
||||
}
|
||||
|
||||
public static ArrayList<Song> mapDownload(List<Download> downloads) {
|
||||
public static ArrayList<Song> mapDownloadToSong(List<Download> downloads) {
|
||||
ArrayList<Song> songs = new ArrayList();
|
||||
|
||||
for (Download download : downloads) {
|
||||
songs.add(new Song(download));
|
||||
Song song = new Song(download);
|
||||
if(!songs.contains(song)) {
|
||||
songs.add(song);
|
||||
}
|
||||
}
|
||||
|
||||
return songs;
|
||||
}
|
||||
|
||||
public static ArrayList<Album> mapDownloadToAlbum(List<Download> downloads) {
|
||||
ArrayList<Album> albums = new ArrayList();
|
||||
|
||||
for (Download download : downloads) {
|
||||
Album album = new Album(download);
|
||||
if(!albums.contains(album)) {
|
||||
albums.add(album);
|
||||
}
|
||||
}
|
||||
|
||||
return albums;
|
||||
}
|
||||
|
||||
public static ArrayList<Artist> mapDownloadToArtist(List<Download> downloads) {
|
||||
ArrayList<Artist> artists = new ArrayList();
|
||||
|
||||
for (Download download : downloads) {
|
||||
Artist artist = new Artist(download);
|
||||
if(!artists.contains(artist)) {
|
||||
artists.add(artist);
|
||||
}
|
||||
}
|
||||
|
||||
return artists;
|
||||
}
|
||||
|
||||
public static ArrayList<Download> mapToDownload(List<Song> songs) {
|
||||
ArrayList<Download> downloads = new ArrayList();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue