diff --git a/modules/RichSiteSummary/Data/Post.cs b/modules/RichSiteSummary/Data/Post.cs index 245a5a2..3c7edd0 100644 --- a/modules/RichSiteSummary/Data/Post.cs +++ b/modules/RichSiteSummary/Data/Post.cs @@ -5,6 +5,7 @@ using System; using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; using System.Text; using Kruzya.TelegramBot.RichSiteSummary.UrchinTrackingModule; using Telegram.Bot.Types.Enums; @@ -84,10 +85,10 @@ public class Post : RepresentableEntity public DateTime ReceivedAt { get; set; } /// - /// + /// SHA256 /// - [Required] [MaxLength(64)] + [DatabaseGenerated(DatabaseGeneratedOption.Computed)] public string UrlHash { get; set; } public Post() diff --git a/modules/RichSiteSummary/Service/RssFetch.cs b/modules/RichSiteSummary/Service/RssFetch.cs index d424462..64ddaeb 100644 --- a/modules/RichSiteSummary/Service/RssFetch.cs +++ b/modules/RichSiteSummary/Service/RssFetch.cs @@ -147,7 +147,7 @@ public class RssFetch : IHostedService, IDisposable feedPost.Title = post.Title; feedPost.Url = post.Link; feedPost.PostedAt = post.PublishingDate.GetValueOrDefault(DateTime.Now); - feedPost.UrlHash = _hash.GenerateHash(feedPost.Url); + // feedPost.UrlHash = _hash.GenerateHash(feedPost.Url); postsImages.Add(feedPost, await FetchImageUrl(post)); newPosts.Add(feedPost);