Compare commits

..

No commits in common. "ffaa2b2fa4d006ff10f79bd88a564ec188bcf251" and "9295c4a8489763cefae641ea964f7c91b816a719" have entirely different histories.

11 changed files with 22 additions and 69 deletions

View File

@ -22,9 +22,6 @@ internal sealed class BlogPost : IBlogPost
/// <inheritdoc />
public bool IsRedirect { get; internal set; }
/// <inheritdoc />
public string? Password { get; internal set; }
/// <inheritdoc />
public DateTimeOffset Published { get; internal set; }
@ -40,9 +37,6 @@ internal sealed class BlogPost : IBlogPost
/// <inheritdoc />
public DateTimeOffset? Updated { get; internal set; }
/// <inheritdoc />
public BlogPostVisibility Visibility { get; internal set; }
/// <inheritdoc />
public int? WordPressId { get; set; }

View File

@ -1,22 +0,0 @@
namespace OliverBooth.Data.Blog;
/// <summary>
/// An enumeration of the possible visibilities of a blog post.
/// </summary>
public enum BlogPostVisibility
{
/// <summary>
/// The post is private and only visible to the author, or those with the password.
/// </summary>
Private,
/// <summary>
/// The post is unlisted and only visible to those with the link.
/// </summary>
Unlisted,
/// <summary>
/// The post is published and visible to everyone.
/// </summary>
Published
}

View File

@ -26,7 +26,5 @@ internal sealed class BlogPostConfiguration : IEntityTypeConfiguration<BlogPost>
builder.Property(e => e.DisqusDomain).IsRequired(false);
builder.Property(e => e.DisqusIdentifier).IsRequired(false);
builder.Property(e => e.DisqusPath).IsRequired(false);
builder.Property(e => e.Visibility).HasConversion(new EnumToStringConverter<BlogPostVisibility>()).IsRequired();
builder.Property(e => e.Password).HasMaxLength(255).IsRequired(false);
}
}

View File

@ -39,12 +39,6 @@ public interface IBlogPost
/// </value>
bool IsRedirect { get; }
/// <summary>
/// Gets the password of the post.
/// </summary>
/// <value>The password of the post.</value>
string? Password { get; }
/// <summary>
/// Gets the date and time the post was published.
/// </summary>
@ -75,12 +69,6 @@ public interface IBlogPost
/// <value>The update date and time, or <see langword="null" /> if the post has not been updated.</value>
DateTimeOffset? Updated { get; }
/// <summary>
/// Gets the visibility of the post.
/// </summary>
/// <value>The visibility of the post.</value>
BlogPostVisibility Visibility { get; }
/// <summary>
/// Gets the WordPress ID of the post.
/// </summary>

View File

@ -12,16 +12,16 @@ public sealed class BlogItem
[XmlElement("comments")]
public string Comments { get; set; } = default!;
[XmlElement("creator", Namespace = "http://purl.org/dc/elements/1.1/")]
public string Creator { get; set; } = default!;
[XmlElement("pubDate")]
public string PubDate { get; set; } = default!;
[XmlElement("guid")]
public BlogItemGuid Guid { get; set; } = default!;
public string Guid { get; set; } = default!;
[XmlElement("description")]
public string Description { get; set; } = default!;
}

View File

@ -1,18 +0,0 @@
using System.Xml.Serialization;
namespace OliverBooth.Data.Blog.Rss;
public struct BlogItemGuid
{
public BlogItemGuid()
{
}
[XmlAttribute("isPermaLink")]
public bool IsPermaLink { get; set; } = false;
[XmlText]
public string Value { get; set; } = default!;
public static implicit operator BlogItemGuid(string value) => new() { Value = value };
}

View File

@ -1,4 +1,5 @@
@page "/privacy/google-play"
@model OliverBooth.Pages.Privacy.GooglePlay
@{
ViewData["Title"] = "Google Play Privacy Policy";
}

View File

@ -0,0 +1,7 @@
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace OliverBooth.Pages.Privacy;
public class GooglePlay : PageModel
{
}

View File

@ -1,4 +1,5 @@
@page
@model OliverBooth.Pages.Privacy.Index
@{
ViewData["Title"] = "Privacy Policy";
}

View File

@ -0,0 +1,7 @@
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace OliverBooth.Pages.Privacy;
public class Index : PageModel
{
}

View File

@ -43,9 +43,7 @@ internal sealed class BlogPostService : IBlogPostService
public IReadOnlyList<IBlogPost> GetAllBlogPosts(int limit = -1)
{
using BlogContext context = _dbContextFactory.CreateDbContext();
IQueryable<BlogPost> ordered = context.BlogPosts
.Where(p => p.Visibility == BlogPostVisibility.Published)
.OrderByDescending(post => post.Published);
IQueryable<BlogPost> ordered = context.BlogPosts.OrderByDescending(post => post.Published);
if (limit > -1)
{
ordered = ordered.Take(limit);
@ -59,7 +57,6 @@ internal sealed class BlogPostService : IBlogPostService
{
using BlogContext context = _dbContextFactory.CreateDbContext();
return context.BlogPosts
.Where(p => p.Visibility == BlogPostVisibility.Published)
.OrderByDescending(post => post.Published)
.Skip(page * pageSize)
.Take(pageSize)