namespace Model.Stub;

public class StubPlaylist
{

    public List<Playlist> Playlists
    {
        get => playlists;
    }

    private readonly List<Playlist> playlists;

    public StubPlaylist()
    {
        Playlist Playlist1 = new Playlist("Playlist1", "desc1", "url1.png");
        Playlist Playlist2 = new Playlist("Playlist2", "desc2", "url2.png");
        playlists = new List<Playlist>()
        {
            Playlist1, Playlist2
        };
    }

    public List<Playlist> GetPlaylists()
    {
        return playlists;
    }
    public Playlist? GetPlaylistByUrl(string url)
    {
        foreach(var playlist in playlists)
        {
            if (playlist.ImageURL == url)
            {
                return playlist;
            }
        }
        return null;
    }
    public void AddPlaylist(Playlist playlist)
    {
        playlists.Add(playlist);
    }
    public void RemovePlaylist(Playlist playlist)
    {
        playlists.Remove(playlist);
    }
}
