namespace Model.Stub;

public class StubCustomTitle
{

    public List<CustomTitle> CustomTitles
    {
        get => customTitles;
    }

    private readonly List<CustomTitle> customTitles;

    public StubCustomTitle()
    {
        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");
        customTitles = new List<CustomTitle>()
        {
            Custom1, Custom2, Custom3
        };
    }

    public List<CustomTitle> GetCustomTitles()
    {
        return customTitles;
    }
    public List<CustomTitle> GetCustomTitlesByUrl(List<string> urls)
    {
        List<CustomTitle> Customs = new List<CustomTitle>();
        foreach(var url in urls)
        {
            foreach (var title in customTitles)
            {
                if (url == title.ImageURL)
                {
                    Customs.Add(title);
                }
            }
        }
        return Customs;
    }
    public void AddCustomTitle(CustomTitle customTitle)
    {
        customTitles.Add(customTitle);
    }
    public void RemoveCustomTitle(CustomTitle customTitle)
    {
        customTitles.Remove(customTitle);
    }
}
