aboutsummaryrefslogtreecommitdiff
path: root/back-end/src/Model
diff options
context:
space:
mode:
Diffstat (limited to 'back-end/src/Model')
-rw-r--r--back-end/src/Model/ChannelManager.cs4
-rw-r--r--back-end/src/Model/ContentManager.cs4
-rw-r--r--back-end/src/Model/PostManager.cs19
3 files changed, 23 insertions, 4 deletions
diff --git a/back-end/src/Model/ChannelManager.cs b/back-end/src/Model/ChannelManager.cs
index adcc3b2..22dbab9 100644
--- a/back-end/src/Model/ChannelManager.cs
+++ b/back-end/src/Model/ChannelManager.cs
@@ -26,19 +26,21 @@ using System.Threading;
using System.Threading.Tasks;
using System.Collections.Generic;
+using VNLib.Utils.IO;
using VNLib.Hashing;
using VNLib.Plugins;
using VNLib.Plugins.Extensions.Loading;
using Content.Publishing.Blog.Admin.Storage;
+
namespace Content.Publishing.Blog.Admin.Model
{
[ConfigurationName("blog_channels")]
internal sealed class ChannelManager : IChannelContextManager
{
- private readonly IStorageFacade Storage;
+ private readonly ISimpleFilesystem Storage;
private readonly string _indexPath;
diff --git a/back-end/src/Model/ContentManager.cs b/back-end/src/Model/ContentManager.cs
index a0ed94f..b5fc385 100644
--- a/back-end/src/Model/ContentManager.cs
+++ b/back-end/src/Model/ContentManager.cs
@@ -28,18 +28,18 @@ using System.Threading.Tasks;
using Content.Publishing.Blog.Admin.Storage;
using VNLib.Hashing;
+using VNLib.Utils.IO;
using VNLib.Net.Http;
using VNLib.Plugins;
using VNLib.Plugins.Extensions.Loading;
-
namespace Content.Publishing.Blog.Admin.Model
{
internal sealed class ContentManager
{
private const string ContentIndex = "content.json";
- private readonly IStorageFacade Storage;
+ private readonly ISimpleFilesystem Storage;
public ContentManager(PluginBase plugin)
{
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)
{