Add blog series feature#525
Conversation
…n editing blog posts, and series display for readers.
|
Will fix and add tests through this week |
|
Hey @digitaldirk thanks very much. Here a few high-level things I noticed:
|
| foreach (var record in records) | ||
| { | ||
| await blogDbContext.Set<TEntity>().AddAsync(record); | ||
| if (string.IsNullOrEmpty(record.Id)) |
There was a problem hiding this comment.
I am not sure if that breaks now the way in SimilarBlogPostJob - we deleted first and then insert. With the same Ids. Might lead to an exception in SQLServer. Have to check
| builder.Property(x => x.Tags).HasMaxLength(2048); | ||
| builder.Property(x => x.AuthorName).HasMaxLength(256).IsRequired(false); | ||
| builder.Property(x => x.SeriesId).IsUnicode(false).IsRequired(false); | ||
|
|
There was a problem hiding this comment.
We might wanna have a db constraint that order has to be unique
|
Hey @digitaldirk I am not sure if it makes sense to tackle the series feature beforewe come to a conclusion whether or not the current generic repository pattern is good. I will open a follow up discussion - if we tackle it or not let's see. |
|
One way forward in the current architecture and still make it work without all the weird quirks is to inject That would resolve at least all the bigger issues - no need of Would that work for you @digitaldirk ? SimilarBlogPosts does a similar thing here (not the same, but comparable) |
Yes that is fine by me - reflecting on what was said in the discussion - a full rework would be nice but how many more features like this can a blog have that could benefit from all that work? Can't think of too much because a blog engine should be pretty simple. I think working with what we have now and adjusting this PR is probably the better option. Should have time this weekend to work more on this |
|
It is fair for me if you wanna postpone work on that - I am not sure if I can find the time in the close future. So we might have to put this on ice for quite a bit. On the flip-side, I don't think the migration to a newer system becomes much more complicated with the series feature (but it is also not 0 effort - so maybe I regret what I am saying right now later :D). |
|
No worries at all, in the meantime I will improve the user experience and fix bugs of this PR. TODO:
|
Closes #523 (potential future improvements still in 523)
The changes for the files in the Persistence folder I am unsure about due to my lack of experience, disclaimer used AI to generate those changes. I am also curious if how I cache busted is the right way to go (if a series was renamed or deleted - then the blog posts would still have the old name or still be referencing a deleted series)
Added series display for readers on blog posts (if blog is assigned to a series)



Admin can assigned blogs to series when creating or editing a blog post, and can reorder posts as well
New admin page /series to manage series (add/delete/assign/order)