namespace Model.Stub;

public class StubInfoTitle
{

    public StubArtist StubArtist
    {
        get
        {
            return stubArtist;
        }
    }

    private readonly StubArtist stubArtist;

    public List<InfoTitle> InfoTitles
    {
        get => infoTitles;
    }

    private readonly List<InfoTitle> infoTitles;

    public StubInfoTitle()
    {
        stubArtist = new StubArtist();

        InfoTitle InfoTitle1 = new InfoTitle("info1", "url1.png", "info1", StubArtist.GetArtistByName("Gouriet") ?? new Artist("Gouriet"), "desc1", Genre.K_POP);
        InfoTitle InfoTitle2 = new InfoTitle("info2", "url2.png", "info2", StubArtist.GetArtistByName("Poulifer") ?? new Artist("Poulifer"), "desc2", Genre.GOSPEL);

        infoTitles = new List<InfoTitle>()
        {
            InfoTitle1, InfoTitle2
        };
    }

    public List<InfoTitle> GetInfoTitles()
    {
        return infoTitles;
    }
    public List<InfoTitle> GetInfoTitlesByUrl(List<string> urls)
    {
        List<InfoTitle> infos = new List<InfoTitle>();
        foreach(var url in urls)
        {
            foreach(var titles in infoTitles)
            {
                if (url == titles.ImageURL)
                {
                    infos.Add(titles);
                }
            }
        }
        return infos;
    }
    public void AddInfoTitle(InfoTitle title)
    {
        infoTitles.Add(title);
    }
    public void RemoveInfoTitle(InfoTitle title)
    {
        infoTitles.Remove(title);
    }
    public static void AddFeat(InfoTitle infoTitle, Artist artist)
    {
        infoTitle.AddFeat(artist);
    }
    public static void RemoveFeat(InfoTitle infoTitle, Artist artist)
    {
        infoTitle.RemoveFeat(artist);
    }
}
