aboutsummaryrefslogtreecommitdiff
path: root/back-end/src/Model/PostManager.cs
diff options
context:
space:
mode:
authorLibravatar vnugent <public@vaughnnugent.com>2023-08-31 22:17:50 -0400
committerLibravatar vnugent <public@vaughnnugent.com>2023-08-31 22:17:50 -0400
commitd66290269d4709fe2d909284801f31669aa26f74 (patch)
treefcc7151652c880f60f5020c4069901439b6b6a8f /back-end/src/Model/PostManager.cs
parentafdeeb686f3aa022bec19084a337e233c622b4e3 (diff)
pre tag updates
Diffstat (limited to 'back-end/src/Model/PostManager.cs')
-rw-r--r--back-end/src/Model/PostManager.cs19
1 files changed, 18 insertions, 1 deletions
diff --git a/back-end/src/Model/PostManager.cs b/back-end/src/Model/PostManager.cs
index 22e3682..922fba4 100644
--- a/back-end/src/Model/PostManager.cs
+++ b/back-end/src/Model/PostManager.cs
@@ -42,7 +42,7 @@ namespace Content.Publishing.Blog.Admin.Model
internal sealed class PostManager : IBlogPostManager
{
- private readonly IStorageFacade Storage;
+ private readonly ISimpleFilesystem Storage;
private readonly IRssFeedGenerator FeedGenerator;
private readonly ContentManager ContentMan;
@@ -166,6 +166,23 @@ namespace Content.Publishing.Blog.Admin.Model
return true;
}
+ /// <summary>
+ /// Updates the index and feed for all posts for the given channel.
+ /// </summary>
+ /// <param name="context">The channel context to update the feed for</param>
+ /// <param name="cancellation">A token to cancel the operatio</param>
+ /// <returns>A task that completes when the channel feed has been updated</returns>
+ /// <exception cref="ArgumentNullException"></exception>
+ public async Task UpdateFeedForChannelAsync(IChannelContext context, CancellationToken cancellation)
+ {
+ _ = context ?? throw new ArgumentNullException(nameof(context));
+
+ //Get the index
+ IRecordDb<PostMeta> db = await GetPostIndexAsync(context, cancellation);
+
+ //Update the index and feed after post update
+ await UpdateIndexAndFeed(context, db, cancellation);
+ }
private async Task UpdateIndexAndFeed(IChannelContext context, IRecordDb<PostMeta> index, CancellationToken cancellation)
{