using OF_DL.Models.Entities.Common;
using OF_DL.Utils;

namespace OF_DL.Models.Entities.Streams;

public class ListItem
{
    private string _rawText = "";

    public long Id { get; set; }

    public DateTime PostedAt { get; set; }

    public Author? Author { get; set; }

    public string Text { get; set; } = "";

    public string RawText
    {
        get
        {
            if (string.IsNullOrEmpty(_rawText))
            {
                _rawText = XmlUtils.EvaluateInnerText(Text);
            }

            return _rawText;
        }
        set => _rawText = value;
    }

    public bool IsOpened { get; set; }

    public string? Price { get; set; }

    public bool IsArchived { get; set; }

    public List<Medium>? Media { get; set; }

    public List<object>? Preview { get; set; }
}
