|
|
|
@ -87,12 +87,6 @@ public class StubManager : IDataManager
|
|
|
|
|
stubCustomTitle = new StubCustomTitle();
|
|
|
|
|
stubInfoTitle = new StubInfoTitle();
|
|
|
|
|
stubPlaylist = new StubPlaylist();
|
|
|
|
|
|
|
|
|
|
dictAlbumInfo.Add(StubAlbum.GetAlbumByUrl("lastreet.png"), StubInfoTitle.GetInfoTitlesByUrl(new List<string>() { "url1.png", "url2.png" }));
|
|
|
|
|
dictAlbumInfo.Add(StubAlbum.GetAlbumByUrl("oui.png"), StubInfoTitle.GetInfoTitlesByUrl(new List<string>() { "url2.png" }));
|
|
|
|
|
|
|
|
|
|
dictPlaylistTitles.Add(StubPlaylist.GetPlaylistByUrl("url1.png"), StubCustomTitle.GetCustomTitlesByUrl(new List<string>() { "url1.png", "url2.png" }));
|
|
|
|
|
dictPlaylistTitles.Add(StubPlaylist.GetPlaylistByUrl("url2.png"), StubCustomTitle.GetCustomTitlesByUrl(new List<string>() { "url2.png", "url3.png" }));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public List<Album> GetAlbums()
|
|
|
|
@ -202,4 +196,271 @@ public class StubManager : IDataManager
|
|
|
|
|
}
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public InfoTitle? GetInfoTitleByUrl(string url)
|
|
|
|
|
{
|
|
|
|
|
throw new NotImplementedException();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public Album? GetAlbumByUrl(string url)
|
|
|
|
|
{
|
|
|
|
|
throw new NotImplementedException();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public Artist? GetArtistByName(string name)
|
|
|
|
|
{
|
|
|
|
|
throw new NotImplementedException();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void AddAlbums(List<Album> albumsList)
|
|
|
|
|
{
|
|
|
|
|
foreach (Album a in albumsList)
|
|
|
|
|
{
|
|
|
|
|
StubAlbum.AddAlbum(a);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void AddArtists(List<Artist> artistsList)
|
|
|
|
|
{
|
|
|
|
|
foreach (Artist a in artistsList)
|
|
|
|
|
{
|
|
|
|
|
StubArtist.AddArtist(a);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void AddPlaylists(List<Playlist> playlistsList)
|
|
|
|
|
{
|
|
|
|
|
foreach (Playlist p in playlistsList)
|
|
|
|
|
{
|
|
|
|
|
StubPlaylist.AddPlaylist(p);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void AddCustomTitles(List<CustomTitle> customTitlesList)
|
|
|
|
|
{
|
|
|
|
|
foreach (CustomTitle ct in customTitlesList)
|
|
|
|
|
{
|
|
|
|
|
StubCustomTitle.AddCustomTitle(ct);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void AddInfoTitles(List<InfoTitle> infoTitlesList)
|
|
|
|
|
{
|
|
|
|
|
foreach (InfoTitle it in infoTitlesList)
|
|
|
|
|
{
|
|
|
|
|
StubInfoTitle.AddInfoTitle(it);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public Playlist? GetPlaylistByUrl(string url)
|
|
|
|
|
{
|
|
|
|
|
foreach (Playlist p in StubPlaylist.Playlists)
|
|
|
|
|
{
|
|
|
|
|
if (p.ImageURL == url)
|
|
|
|
|
{
|
|
|
|
|
return p;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void UpdateCustomTitle(CustomTitle title, string name, string url, string info, string path)
|
|
|
|
|
{
|
|
|
|
|
title.Name = name;
|
|
|
|
|
title.ImageURL = url;
|
|
|
|
|
title.Information = info;
|
|
|
|
|
title.Path = path;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void UpdateCustomTitleByUrl(string url, string name, string newUrl, string info, string path)
|
|
|
|
|
{
|
|
|
|
|
CustomTitle? title = GetCustomTitleByUrl(url);
|
|
|
|
|
if (title != null)
|
|
|
|
|
{
|
|
|
|
|
title.Name = name;
|
|
|
|
|
title.ImageURL = newUrl;
|
|
|
|
|
title.Information = info;
|
|
|
|
|
title.Path = path;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void UpdateInfoTitle(InfoTitle title, string name, string url, string info, Artist artist, string description, Genre genre)
|
|
|
|
|
{
|
|
|
|
|
title.Name = name;
|
|
|
|
|
title.ImageURL = url;
|
|
|
|
|
title.Information = info;
|
|
|
|
|
title.Artist = artist;
|
|
|
|
|
title.Description = description;
|
|
|
|
|
title.Genre = genre;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void UpdateInfoTitleByName(string url, string name, string newUrl, string info, Artist artist, string description, Genre genre)
|
|
|
|
|
{
|
|
|
|
|
InfoTitle? title = GetInfoTitleByUrl(url);
|
|
|
|
|
if (title != null)
|
|
|
|
|
{
|
|
|
|
|
title.Name = name;
|
|
|
|
|
title.ImageURL = newUrl;
|
|
|
|
|
title.Information = info;
|
|
|
|
|
title.Artist = artist;
|
|
|
|
|
title.Description = description;
|
|
|
|
|
title.Genre = genre;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void UpdateInfoTitleByArtistName(InfoTitle title, string name, string url, string info, string artist, string description, Genre genre)
|
|
|
|
|
{
|
|
|
|
|
title.Name = name;
|
|
|
|
|
title.ImageURL = url;
|
|
|
|
|
title.Information = info;
|
|
|
|
|
Artist? artist2 = GetArtistByName(artist);
|
|
|
|
|
if (artist2 != null)
|
|
|
|
|
{
|
|
|
|
|
title.Artist = artist2;
|
|
|
|
|
}
|
|
|
|
|
title.Description = description;
|
|
|
|
|
title.Genre = genre;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void UpdateInfoTitleByNameByArtistName(string url, string name, string newUrl, string info, string artist, string description, Genre genre)
|
|
|
|
|
{
|
|
|
|
|
InfoTitle? title = GetInfoTitleByUrl(url);
|
|
|
|
|
if (title != null)
|
|
|
|
|
{
|
|
|
|
|
title.Name = name;
|
|
|
|
|
title.ImageURL = newUrl;
|
|
|
|
|
title.Information = info;
|
|
|
|
|
Artist? artist2 = GetArtistByName(artist);
|
|
|
|
|
if (artist2 != null)
|
|
|
|
|
{
|
|
|
|
|
title.Artist = artist2;
|
|
|
|
|
}
|
|
|
|
|
title.Description = description;
|
|
|
|
|
title.Genre = genre;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void UpdateAlbum(Album album, string name, string url, Artist artist, string description, string info)
|
|
|
|
|
{
|
|
|
|
|
album.Name = name;
|
|
|
|
|
album.ImageURL = url;
|
|
|
|
|
album.Artist = artist;
|
|
|
|
|
album.Description = description;
|
|
|
|
|
album.Information = info;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void UpdateAlbumByUrl(string url, string name, string newUrl, Artist artist, string description, string info)
|
|
|
|
|
{
|
|
|
|
|
Album? album = GetAlbumByUrl(url);
|
|
|
|
|
if (album != null)
|
|
|
|
|
{
|
|
|
|
|
album.Name = name;
|
|
|
|
|
album.ImageURL = newUrl;
|
|
|
|
|
album.Artist = artist;
|
|
|
|
|
album.Description = description;
|
|
|
|
|
album.Information = info;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void UpdateAlbumByArtistName(Album album, string name, string url, string artist, string description, string info)
|
|
|
|
|
{
|
|
|
|
|
album.Name = name;
|
|
|
|
|
album.ImageURL = url;
|
|
|
|
|
Artist? artist2 = GetArtistByName(artist);
|
|
|
|
|
if (artist2 != null)
|
|
|
|
|
{
|
|
|
|
|
album.Artist = artist2;
|
|
|
|
|
}
|
|
|
|
|
album.Description = description;
|
|
|
|
|
album.Information = info;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void UpdateAlbumByUrlByArtistName(string url, string name, string newUrl, string artist, string description, string info)
|
|
|
|
|
{
|
|
|
|
|
Album? album = GetAlbumByUrl(url);
|
|
|
|
|
if (album != null)
|
|
|
|
|
{
|
|
|
|
|
album.Name = name;
|
|
|
|
|
album.ImageURL = newUrl;
|
|
|
|
|
Artist? artist2 = GetArtistByName(artist);
|
|
|
|
|
if (artist2 != null)
|
|
|
|
|
{
|
|
|
|
|
album.Artist = artist2;
|
|
|
|
|
}
|
|
|
|
|
album.Description = description;
|
|
|
|
|
album.Information = info;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void UpdatePlaylist(Playlist playlist, string name, string description, string url)
|
|
|
|
|
{
|
|
|
|
|
playlist.Name = name;
|
|
|
|
|
playlist.Description = description;
|
|
|
|
|
playlist.ImageURL = url;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void UpdatePlaylistByUrl(string url, string name, string description, string newUrl)
|
|
|
|
|
{
|
|
|
|
|
Playlist? playlist = GetPlaylistByUrl(url);
|
|
|
|
|
if (playlist != null)
|
|
|
|
|
{
|
|
|
|
|
playlist.Name = name;
|
|
|
|
|
playlist.Description = description;
|
|
|
|
|
playlist.ImageURL = newUrl;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void UpdateArtist(Artist artist, string name)
|
|
|
|
|
{
|
|
|
|
|
artist.Name = name;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void UpdateArtistByName(string name, string newName)
|
|
|
|
|
{
|
|
|
|
|
Artist? artist = GetArtistByName(newName);
|
|
|
|
|
if (artist != null)
|
|
|
|
|
{
|
|
|
|
|
artist.Name = newName;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void RemoveAlbums(List<Album> albumsList)
|
|
|
|
|
{
|
|
|
|
|
foreach (Album album in albumsList)
|
|
|
|
|
{
|
|
|
|
|
StubAlbum.RemoveAlbum(album);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void RemoveArtists(List<Artist> artistsList)
|
|
|
|
|
{
|
|
|
|
|
foreach (Artist artist in artistsList)
|
|
|
|
|
{
|
|
|
|
|
StubArtist.RemoveArtist(artist);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void RemovePlaylists(List<Playlist> playlistsList)
|
|
|
|
|
{
|
|
|
|
|
foreach (Playlist playlist in playlistsList)
|
|
|
|
|
{
|
|
|
|
|
StubPlaylist.RemovePlaylist(playlist);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void RemoveCustomTitles(List<CustomTitle> customTitlesList)
|
|
|
|
|
{
|
|
|
|
|
foreach (CustomTitle customTitle in customTitlesList)
|
|
|
|
|
{
|
|
|
|
|
StubCustomTitle.RemoveCustomTitle(customTitle);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void RemoveInfoTitles(List<InfoTitle> infoTitlesList)
|
|
|
|
|
{
|
|
|
|
|
foreach (InfoTitle infoTitle in infoTitlesList)
|
|
|
|
|
{
|
|
|
|
|
StubInfoTitle.RemoveInfoTitle(infoTitle);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|