using System; using ToolQit; using ToolQit.Extensions; namespace SharpRss.Models { public class FeedModel { public CategoryModel? Category { get; set; } public string OriginalUrl { get; set; } = string.Empty; public string? Title { get; set; } = string.Empty; public string? GroupId { get; set; } = string.Empty; public string? FeedType { get; set; } = string.Empty; public string? FeedVersion { get; set; } = string.Empty; public string? Description { get; set; } = string.Empty; public string? Language { get; set; } = string.Empty; public string? Copyright { get; set; } = string.Empty; public DateTimeOffset? PublicationDate { get; set; } public DateTimeOffset? LastUpdated { get; set; } = DateTimeOffset.Now; public string[]? Categories { get; set; } private string _imageUrl = string.Empty; public string ImageUrl { get { if (_imageUrl.IsNullEmptyWhiteSpace()) _imageUrl = string.Format(Caretaker.Settings["Paths"].GetString("FaviconResolveUrl"), new Uri(OriginalUrl).Host); return _imageUrl; } set { if (!value.IsNullEmptyWhiteSpace()) _imageUrl = value; } } } }