|
|
|
@ -3,7 +3,7 @@
|
|
|
|
|
public class StubManager : IDataManager
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
private List<Artist> artists = new List<Artist>();
|
|
|
|
|
private List<Artist> artists;
|
|
|
|
|
|
|
|
|
|
public IEnumerable<Artist> Artists
|
|
|
|
|
{
|
|
|
|
@ -13,7 +13,7 @@ public class StubManager : IDataManager
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private List<Album> albums = new List<Album>();
|
|
|
|
|
private List<Album> albums;
|
|
|
|
|
|
|
|
|
|
public IEnumerable<Album> Albums
|
|
|
|
|
{
|
|
|
|
@ -23,7 +23,7 @@ public class StubManager : IDataManager
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private List<Playlist> playlists = new List<Playlist>();
|
|
|
|
|
private List<Playlist> playlists;
|
|
|
|
|
|
|
|
|
|
public IEnumerable<Playlist> Playlists
|
|
|
|
|
{
|
|
|
|
@ -33,82 +33,124 @@ public class StubManager : IDataManager
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private List<Title> titles = new List<Title>();
|
|
|
|
|
private List<InfoTitle> infoTitles;
|
|
|
|
|
|
|
|
|
|
public IEnumerable<Title> Titles
|
|
|
|
|
public IEnumerable<InfoTitle> InfoTitles
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return titles.ToList();
|
|
|
|
|
return infoTitles.ToList();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private List<CustomTitle> customTitles;
|
|
|
|
|
|
|
|
|
|
public IEnumerable<CustomTitle> CustomTitles
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return customTitles.ToList();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public StubManager()
|
|
|
|
|
{
|
|
|
|
|
Artist Artiste1 = new Artist("Critien");
|
|
|
|
|
Artist Artiste2 = new Artist("Gouriet");
|
|
|
|
|
Artist Artiste3 = new Artist("Poulifer");
|
|
|
|
|
Artist Artiste4 = new Artist("Credian");
|
|
|
|
|
StubAlbum stubAlbum = new StubAlbum();
|
|
|
|
|
albums = stubAlbum.GetAlbums();
|
|
|
|
|
|
|
|
|
|
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");
|
|
|
|
|
StubPlaylist stubPlaylist = new StubPlaylist();
|
|
|
|
|
playlists = stubPlaylist.GetPlaylists();
|
|
|
|
|
|
|
|
|
|
Artiste1.AddAlbum(Album1);
|
|
|
|
|
Artiste1.AddAlbum(Album2);
|
|
|
|
|
Artiste2.AddAlbum(Album3);
|
|
|
|
|
Artiste2.AddAlbum(Album4);
|
|
|
|
|
StubArtist stubArtist = new StubArtist();
|
|
|
|
|
artists = stubArtist.GetArtists();
|
|
|
|
|
|
|
|
|
|
Playlist Playlist1 = new Playlist("Playlist1", "desc1", "url1.png");
|
|
|
|
|
Playlist Playlist2 = new Playlist("Playlist2", "desc2", "url2.png");
|
|
|
|
|
StubInfoTitle stubInfoTitle = new StubInfoTitle();
|
|
|
|
|
infoTitles = stubInfoTitle.GetInfoTitles();
|
|
|
|
|
|
|
|
|
|
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");
|
|
|
|
|
StubCustomTitle stubCustomTitle = new StubCustomTitle();
|
|
|
|
|
customTitles = stubCustomTitle.GetCustomTitles();
|
|
|
|
|
|
|
|
|
|
Playlist1.AddTitle(Custom1);
|
|
|
|
|
Playlist1.AddTitle(Custom2);
|
|
|
|
|
Playlist2.AddTitle(Custom2);
|
|
|
|
|
Playlist2.AddTitle(Custom3);
|
|
|
|
|
Artist? Artist1 = Artists.FirstOrDefault(a => a.Name == "Critien");
|
|
|
|
|
Artist? Artist2 = Artists.FirstOrDefault(a => a.Name == "Gouriet");
|
|
|
|
|
Artist? Artist3 = Artists.FirstOrDefault(a => a.Name == "Poulifer");
|
|
|
|
|
Artist? Artist4 = Artists.FirstOrDefault(a => a.Name == "Credian");
|
|
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
Album? Album1 = Albums.FirstOrDefault(a => a.Name == "la street");
|
|
|
|
|
Album? Album2 = Albums.FirstOrDefault(a => a.Name == "la jsp");
|
|
|
|
|
Album? Album3 = Albums.FirstOrDefault(a => a.Name == "la pas le temps");
|
|
|
|
|
Album? Album4 = Albums.FirstOrDefault(a => a.Name == "la pas le choix");
|
|
|
|
|
|
|
|
|
|
Album1.AddTitle(Info1);
|
|
|
|
|
Album1.AddTitle(Info2);
|
|
|
|
|
Album2.AddTitle(Info2);
|
|
|
|
|
Playlist? Playlist1 = Playlists.FirstOrDefault(a => a.Name == "Playlist1");
|
|
|
|
|
Playlist? Playlist2 = Playlists.FirstOrDefault(a => a.Name == "Playlist2");
|
|
|
|
|
|
|
|
|
|
artists = new List<Artist>()
|
|
|
|
|
{
|
|
|
|
|
Artiste1,
|
|
|
|
|
Artiste2,
|
|
|
|
|
Artiste3,
|
|
|
|
|
Artiste4
|
|
|
|
|
};
|
|
|
|
|
CustomTitle? CustomTitle1 = CustomTitles.FirstOrDefault(a => a.Name == "MaMusique");
|
|
|
|
|
CustomTitle? CustomTitle2 = CustomTitles.FirstOrDefault(a => a.Name == "MusiqueGeniale");
|
|
|
|
|
CustomTitle? CustomTitle3 = CustomTitles.FirstOrDefault(a => a.Name == "custom3");
|
|
|
|
|
|
|
|
|
|
InfoTitle? InfoTitle1 = InfoTitles.FirstOrDefault(a => a.Name == "info1");
|
|
|
|
|
InfoTitle? InfoTitle2 = InfoTitles.FirstOrDefault(a => a.Name == "info2");
|
|
|
|
|
|
|
|
|
|
albums = new List<Album>()
|
|
|
|
|
if (Artist1 != null)
|
|
|
|
|
{
|
|
|
|
|
Album1,
|
|
|
|
|
Album2,
|
|
|
|
|
Album3,
|
|
|
|
|
Album4
|
|
|
|
|
};
|
|
|
|
|
if (Album1 != null) {
|
|
|
|
|
Artist1.AddAlbum(Album1);
|
|
|
|
|
}
|
|
|
|
|
if(Album2 != null)
|
|
|
|
|
{
|
|
|
|
|
Artist1.AddAlbum(Album2);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (Artist2 != null)
|
|
|
|
|
{
|
|
|
|
|
if(Album3 != null)
|
|
|
|
|
{
|
|
|
|
|
Artist2.AddAlbum(Album3);
|
|
|
|
|
}
|
|
|
|
|
if(Album4 != null)
|
|
|
|
|
{
|
|
|
|
|
Artist2.AddAlbum(Album4);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
playlists = new List<Playlist>()
|
|
|
|
|
if (Playlist1 != null)
|
|
|
|
|
{
|
|
|
|
|
Playlist1,
|
|
|
|
|
Playlist2
|
|
|
|
|
};
|
|
|
|
|
if (CustomTitle1 != null)
|
|
|
|
|
{
|
|
|
|
|
Playlist1.AddTitle(CustomTitle1);
|
|
|
|
|
}
|
|
|
|
|
if (CustomTitle2 != null)
|
|
|
|
|
{
|
|
|
|
|
Playlist1.AddTitle(CustomTitle2);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (Playlist2 != null)
|
|
|
|
|
{
|
|
|
|
|
if(CustomTitle2 != null)
|
|
|
|
|
{
|
|
|
|
|
Playlist2.AddTitle(CustomTitle2);
|
|
|
|
|
}
|
|
|
|
|
if(CustomTitle3 != null)
|
|
|
|
|
{
|
|
|
|
|
Playlist2.AddTitle(CustomTitle3);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
titles = new List<Title>()
|
|
|
|
|
if (Album1 != null)
|
|
|
|
|
{
|
|
|
|
|
Custom1,
|
|
|
|
|
Custom2,
|
|
|
|
|
Custom3,
|
|
|
|
|
Info1,
|
|
|
|
|
Info2
|
|
|
|
|
};
|
|
|
|
|
if(InfoTitle1 != null)
|
|
|
|
|
{
|
|
|
|
|
Album1.AddTitle(InfoTitle1);
|
|
|
|
|
}
|
|
|
|
|
if(InfoTitle2 != null)
|
|
|
|
|
{
|
|
|
|
|
Album1.AddTitle(InfoTitle2);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (Album2 != null && InfoTitle2 != null)
|
|
|
|
|
{
|
|
|
|
|
Album2.AddTitle(InfoTitle2);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public List<Album> GetAlbums()
|
|
|
|
@ -126,9 +168,14 @@ public class StubManager : IDataManager
|
|
|
|
|
return playlists;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public List<Title> GetTitles()
|
|
|
|
|
public List<CustomTitle> GetCustomTitles()
|
|
|
|
|
{
|
|
|
|
|
return customTitles;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public List<InfoTitle> GetInfoTitles()
|
|
|
|
|
{
|
|
|
|
|
return titles;
|
|
|
|
|
return infoTitles;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void AddAlbum(Album album)
|
|
|
|
@ -136,10 +183,10 @@ public class StubManager : IDataManager
|
|
|
|
|
albums.Add(album);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void AddTitle(Title title)
|
|
|
|
|
/*public void AddTitle(Title title)
|
|
|
|
|
{
|
|
|
|
|
titles.Add(title);
|
|
|
|
|
}
|
|
|
|
|
}*/
|
|
|
|
|
public void AddPlaylist(Playlist playlist)
|
|
|
|
|
{
|
|
|
|
|
playlists.Add(playlist);
|
|
|
|
@ -157,10 +204,10 @@ public class StubManager : IDataManager
|
|
|
|
|
albums.Remove(album);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void RemoveTitle(Title title)
|
|
|
|
|
/*public void RemoveTitle(Title title)
|
|
|
|
|
{
|
|
|
|
|
titles.Remove(title);
|
|
|
|
|
}
|
|
|
|
|
}*/
|
|
|
|
|
|
|
|
|
|
public void RemovePlaylist(Playlist playlist)
|
|
|
|
|
{
|
|
|
|
|