|
|
|
@ -1,142 +1,174 @@
|
|
|
|
|
namespace Model.Stub;
|
|
|
|
|
|
|
|
|
|
public class Stub : IDataManager
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
public IEnumerable<Artist> Artists;
|
|
|
|
|
|
|
|
|
|
public IEnumerable<Album> Albums;
|
|
|
|
|
|
|
|
|
|
public IEnumerable<Playlist> Playlists;
|
|
|
|
|
|
|
|
|
|
public IEnumerable<Title> Titles;
|
|
|
|
|
|
|
|
|
|
public Stub()
|
|
|
|
|
{
|
|
|
|
|
Artist Artiste1 = new Artist("Critien");
|
|
|
|
|
Artist Artiste2 = new Artist("Gouriet");
|
|
|
|
|
Artist Artiste3 = new Artist("Poulifer");
|
|
|
|
|
Artist Artiste4 = new Artist("Credian");
|
|
|
|
|
|
|
|
|
|
Album Album1 = new Album("la street", "lastreet.png", Artiste1, "c'est la street", "plein d'infos1");
|
|
|
|
|
Album Album2 = new Album("la jsp", "oui.png", Artiste1, "c'est la couri", "plein d'infos2");
|
|
|
|
|
Album Album3 = new Album("la pas le temps", "non.png", Artiste3, "c'est pas la street", "plein d'infos3");
|
|
|
|
|
Album Album4 = new Album("la pas le choix", "peutetre.png", Artiste4, "c'est la parterre", "plein d'infos4");
|
|
|
|
|
|
|
|
|
|
Artiste1.AddAlbum(Album1);
|
|
|
|
|
Artiste1.AddAlbum(Album2);
|
|
|
|
|
Artiste2.AddAlbum(Album3);
|
|
|
|
|
Artiste2.AddAlbum(Album4);
|
|
|
|
|
|
|
|
|
|
Playlist Playlist1 = new Playlist("Playlist1", "desc1", "url1.png");
|
|
|
|
|
Playlist Playlist2 = new Playlist("Playlist2", "desc2", "url2.png");
|
|
|
|
|
|
|
|
|
|
CustomTitle Custom1 = new CustomTitle("custom1", "url1.png", "info1", "chemin1");
|
|
|
|
|
CustomTitle Custom2 = new CustomTitle("custom2", "url2.png", "info2", "chemin2");
|
|
|
|
|
CustomTitle Custom3 = new CustomTitle("custom3", "url3.png", "info3", "chemin3");
|
|
|
|
|
|
|
|
|
|
Playlist1.AddTitle(Custom1);
|
|
|
|
|
Playlist1.AddTitle(Custom2);
|
|
|
|
|
Playlist2.AddTitle(Custom2);
|
|
|
|
|
Playlist2.AddTitle(Custom3);
|
|
|
|
|
|
|
|
|
|
InfoTitle Info1 = new InfoTitle("info1", "url1.png", "info1", Artiste2, "desc1", Genre.K_POP);
|
|
|
|
|
InfoTitle Info2 = new InfoTitle("info2", "url2.png", "info2", Artiste3, "desc2", Genre.GOSPEL);
|
|
|
|
|
|
|
|
|
|
Album1.AddTitle(Info1);
|
|
|
|
|
Album1.AddTitle(Info2);
|
|
|
|
|
Album2.AddTitle(Info2);
|
|
|
|
|
|
|
|
|
|
Artists = new List<Artist>()
|
|
|
|
|
namespace Model.Stub;
|
|
|
|
|
|
|
|
|
|
public class Stub : IDataManager
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
private List<Artist> artists = new List<Artist>();
|
|
|
|
|
|
|
|
|
|
public IEnumerable<Artist> Artists
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return artists;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private List<Album> albums = new List<Album>();
|
|
|
|
|
|
|
|
|
|
public IEnumerable<Album> Albums
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return albums;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private List<Playlist> playlists = new List<Playlist>();
|
|
|
|
|
|
|
|
|
|
public IEnumerable<Playlist> Playlists
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return playlists;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private List<Title> titles = new List<Title>();
|
|
|
|
|
|
|
|
|
|
public IEnumerable<Title> Titles
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return titles;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public Stub()
|
|
|
|
|
{
|
|
|
|
|
Artist Artiste1 = new Artist("Critien");
|
|
|
|
|
Artist Artiste2 = new Artist("Gouriet");
|
|
|
|
|
Artist Artiste3 = new Artist("Poulifer");
|
|
|
|
|
Artist Artiste4 = new Artist("Credian");
|
|
|
|
|
|
|
|
|
|
Album Album1 = new Album("la street", "lastreet.png", Artiste1, "c'est la street", "plein d'infos1");
|
|
|
|
|
Album Album2 = new Album("la jsp", "oui.png", Artiste1, "c'est la couri", "plein d'infos2");
|
|
|
|
|
Album Album3 = new Album("la pas le temps", "non.png", Artiste3, "c'est pas la street", "plein d'infos3");
|
|
|
|
|
Album Album4 = new Album("la pas le choix", "peutetre.png", Artiste4, "c'est la parterre", "plein d'infos4");
|
|
|
|
|
|
|
|
|
|
Artiste1.AddAlbum(Album1);
|
|
|
|
|
Artiste1.AddAlbum(Album2);
|
|
|
|
|
Artiste2.AddAlbum(Album3);
|
|
|
|
|
Artiste2.AddAlbum(Album4);
|
|
|
|
|
|
|
|
|
|
Playlist Playlist1 = new Playlist("Playlist1", "desc1", "url1.png");
|
|
|
|
|
Playlist Playlist2 = new Playlist("Playlist2", "desc2", "url2.png");
|
|
|
|
|
|
|
|
|
|
CustomTitle Custom1 = new CustomTitle("MaMusique", "url1.png", "info1", "chemin1");
|
|
|
|
|
CustomTitle Custom2 = new CustomTitle("MusiqueGeniale", "url2.png", "info2", "chemin2");
|
|
|
|
|
CustomTitle Custom3 = new CustomTitle("custom3", "url3.png", "info3", "chemin3");
|
|
|
|
|
|
|
|
|
|
Playlist1.AddTitle(Custom1);
|
|
|
|
|
Playlist1.AddTitle(Custom2);
|
|
|
|
|
Playlist2.AddTitle(Custom2);
|
|
|
|
|
Playlist2.AddTitle(Custom3);
|
|
|
|
|
|
|
|
|
|
InfoTitle Info1 = new InfoTitle("info1", "url1.png", "info1", Artiste2, "desc1", Genre.K_POP);
|
|
|
|
|
InfoTitle Info2 = new InfoTitle("info2", "url2.png", "info2", Artiste3, "desc2", Genre.GOSPEL);
|
|
|
|
|
|
|
|
|
|
Album1.AddTitle(Info1);
|
|
|
|
|
Album1.AddTitle(Info2);
|
|
|
|
|
Album2.AddTitle(Info2);
|
|
|
|
|
|
|
|
|
|
artists = new List<Artist>()
|
|
|
|
|
{
|
|
|
|
|
Artiste1,
|
|
|
|
|
Artiste2,
|
|
|
|
|
Artiste3,
|
|
|
|
|
Artiste4
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
Albums = new List<Album>()
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
albums = new List<Album>()
|
|
|
|
|
{
|
|
|
|
|
Album1,
|
|
|
|
|
Album2,
|
|
|
|
|
Album3,
|
|
|
|
|
Album4
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
Playlists = new List<Playlist>()
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
playlists = new List<Playlist>()
|
|
|
|
|
{
|
|
|
|
|
Playlist1,
|
|
|
|
|
Playlist2
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
Titles = new List<Title>()
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
titles = new List<Title>()
|
|
|
|
|
{
|
|
|
|
|
Custom1,
|
|
|
|
|
Custom2,
|
|
|
|
|
Custom3,
|
|
|
|
|
Info1,
|
|
|
|
|
Info2
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public List<Album> GetAlbums()
|
|
|
|
|
{
|
|
|
|
|
return albums;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public List<Artist> GetArtists()
|
|
|
|
|
{
|
|
|
|
|
return artists;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public IEnumerable<Album> GetAlbums()
|
|
|
|
|
public List<Playlist> GetPlaylists()
|
|
|
|
|
{
|
|
|
|
|
return Albums;
|
|
|
|
|
return playlists;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public IEnumerable<Artist> GetArtists()
|
|
|
|
|
public List<Title> GetTitles()
|
|
|
|
|
{
|
|
|
|
|
return Artists;
|
|
|
|
|
return titles;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public IEnumerable<Playlist> GetPlaylists()
|
|
|
|
|
public void AddAlbum(Album album)
|
|
|
|
|
{
|
|
|
|
|
return Playlists;
|
|
|
|
|
albums.Add(album);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public IEnumerable<Title> GetTitles()
|
|
|
|
|
public void AddTitle(Title title)
|
|
|
|
|
{
|
|
|
|
|
return Titles;
|
|
|
|
|
titles.Add(title);
|
|
|
|
|
}
|
|
|
|
|
public void AddPlaylist(Playlist playlist)
|
|
|
|
|
{
|
|
|
|
|
playlists.Add(playlist);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void AddAlbum(Album album)
|
|
|
|
|
{
|
|
|
|
|
Albums = Albums.Prepend(album);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void AddTitle(Title title)
|
|
|
|
|
{
|
|
|
|
|
Titles = Titles.Prepend(title);
|
|
|
|
|
}
|
|
|
|
|
public void AddPlaylist(Playlist playlist)
|
|
|
|
|
{
|
|
|
|
|
Playlists = Playlists.Prepend(playlist);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void AddArtist(Artist artist)
|
|
|
|
|
{
|
|
|
|
|
Artists = Artists.Prepend(artist);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void RemoveAlbum(Album album)
|
|
|
|
|
{
|
|
|
|
|
Albums.ToList().Remove(album);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void RemoveTitle(Title title)
|
|
|
|
|
{
|
|
|
|
|
Titles.ToList().Remove(title);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void RemovePlaylist(Playlist playlist)
|
|
|
|
|
{
|
|
|
|
|
Playlists.ToList().Remove(playlist);
|
|
|
|
|
artists.Add(artist);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void RemoveAlbum(Album album)
|
|
|
|
|
{
|
|
|
|
|
albums.Remove(album);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void RemoveTitle(Title title)
|
|
|
|
|
{
|
|
|
|
|
titles.Remove(title);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void RemovePlaylist(Playlist playlist)
|
|
|
|
|
{
|
|
|
|
|
playlists.Remove(playlist);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void RemoveArtist(Artist artist)
|
|
|
|
|
{
|
|
|
|
|
Artists.ToList().Remove(artist);
|
|
|
|
|
artists.Remove(artist);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|