2023-05-18 01:27:11 +02:00
|
|
|
|
using System;
|
2023-06-04 02:16:47 +02:00
|
|
|
|
using ToolQit;
|
|
|
|
|
using ToolQit.Extensions;
|
2023-05-12 15:48:14 +02:00
|
|
|
|
|
|
|
|
|
namespace SharpRss.Models
|
|
|
|
|
{
|
2023-06-16 22:53:26 +02:00
|
|
|
|
public class SyndicationModel
|
2023-05-12 15:48:14 +02:00
|
|
|
|
{
|
2023-06-16 22:53:26 +02:00
|
|
|
|
public CategoryModel? Category { get; set; }
|
|
|
|
|
// DB props
|
2023-06-11 02:28:16 +02:00
|
|
|
|
public string EncodedUrl { get; set; } = string.Empty;
|
2023-05-24 19:27:22 +02:00
|
|
|
|
public string? Title { get; set; } = string.Empty;
|
2023-06-04 19:00:46 +02:00
|
|
|
|
public string? CategoryId { get; set; } = string.Empty;
|
2023-06-16 22:53:26 +02:00
|
|
|
|
public string? SyndicationType { get; set; } = string.Empty;
|
2023-06-17 14:04:26 +02:00
|
|
|
|
public string? Version { get; set; } = string.Empty;
|
2023-05-24 19:27:22 +02:00
|
|
|
|
public string? Description { get; set; } = string.Empty;
|
|
|
|
|
public string? Language { get; set; } = string.Empty;
|
|
|
|
|
public string? Copyright { get; set; } = string.Empty;
|
2023-06-16 22:53:26 +02:00
|
|
|
|
public DateTimeOffset LastUpdated { get; set; } = DateTimeOffset.Now;
|
2023-06-04 02:16:47 +02:00
|
|
|
|
public DateTimeOffset? PublicationDate { get; set; }
|
2023-06-16 22:53:26 +02:00
|
|
|
|
public DateTimeOffset? SynUpdatedDate { get; set; }
|
2023-06-04 02:16:47 +02:00
|
|
|
|
public string[]? Categories { get; set; }
|
2023-06-11 02:28:16 +02:00
|
|
|
|
public int ItemCount { get; set; }
|
2023-06-04 02:16:47 +02:00
|
|
|
|
private string _imageUrl = string.Empty;
|
|
|
|
|
public string ImageUrl
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
if (_imageUrl.IsNullEmptyWhiteSpace())
|
2023-06-16 22:53:26 +02:00
|
|
|
|
_imageUrl = string.Format(Caretaker.Settings["Paths"].GetString("FaviconResolveUrl"), new Uri(SyndicationManager.DecodeUrlFromBase64(EncodedUrl)).Host);
|
2023-06-04 02:16:47 +02:00
|
|
|
|
return _imageUrl;
|
|
|
|
|
}
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
if (!value.IsNullEmptyWhiteSpace())
|
|
|
|
|
_imageUrl = value;
|
|
|
|
|
}
|
|
|
|
|
}
|
2023-06-15 20:04:15 +02:00
|
|
|
|
|
|
|
|
|
public override bool Equals(object obj)
|
|
|
|
|
{
|
2023-06-16 22:53:26 +02:00
|
|
|
|
if (obj is SyndicationModel objModel)
|
2023-06-15 20:04:15 +02:00
|
|
|
|
return EncodedUrl.Equals(objModel.EncodedUrl);
|
|
|
|
|
return false;
|
|
|
|
|
}
|
2023-05-12 15:48:14 +02:00
|
|
|
|
}
|
|
|
|
|
}
|