mirror of
https://github.com/hmaxnl/SharpRSS.git
synced 2025-01-18 12:54:20 +01:00
Renamed service.
This commit is contained in:
parent
1785833132
commit
9e6d2183fb
|
@ -9,11 +9,11 @@ using SharpRss.Models;
|
|||
namespace SharpRss.Services
|
||||
{
|
||||
/// <summary>
|
||||
/// Managing RSS feeds and categories.
|
||||
/// Managing feeds and categories.
|
||||
/// </summary>
|
||||
public class RssService
|
||||
public class SyndicationService
|
||||
{
|
||||
public RssService()
|
||||
public SyndicationService()
|
||||
{
|
||||
SetupTestCategoriesAndFeedsAsync();
|
||||
}
|
|
@ -3,7 +3,7 @@
|
|||
@using SharpRss.Services
|
||||
|
||||
@inject IDialogService _dialogService;
|
||||
@inject RssService _rssService;
|
||||
@inject SyndicationService _syndicationService;
|
||||
|
||||
<div>
|
||||
@if (_isLoading)
|
||||
|
@ -51,14 +51,14 @@
|
|||
_isLoading = true;
|
||||
if (Fid != null)
|
||||
{
|
||||
var fItems = await _rssService.GetFeedItemsAsync(Fid);
|
||||
var fItems = await _syndicationService.GetFeedItemsAsync(Fid);
|
||||
items = fItems.Select(x => FeedItemData.FromModel(x)).OrderBy(x => x.PublishingDate).Reverse().ToHashSet();
|
||||
}
|
||||
else if (Cid != null)
|
||||
{
|
||||
var feeds = await _rssService.GetFeedsAsync(Cid == string.Empty ? null : Cid);
|
||||
var feeds = await _syndicationService.GetFeedsAsync(Cid == string.Empty ? null : Cid);
|
||||
var feedIds = feeds.Select(x => x.EncodedUrl);
|
||||
var feedItems = await _rssService.GetFeedItemsFromFeedsAsync(feedIds.ToArray());
|
||||
var feedItems = await _syndicationService.GetFeedItemsFromFeedsAsync(feedIds.ToArray());
|
||||
items = feedItems.Select(x => FeedItemData.FromModel(x)).OrderBy(x => x.PublishingDate).Reverse().ToHashSet();
|
||||
}
|
||||
_isLoading = false;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
@page "/read"
|
||||
@using SharpRss.Services
|
||||
|
||||
@inject RssService _rssService;
|
||||
@inject SyndicationService _syndicationService;
|
||||
<MudText Typo="Typo.h1">Nothing here yet!</MudText>
|
||||
|
||||
@code {
|
||||
|
|
|
@ -14,7 +14,7 @@ var builder = WebApplication.CreateBuilder(args);
|
|||
builder.Logging.AddSerilog();
|
||||
builder.Services.AddRazorPages();
|
||||
builder.Services.AddServerSideBlazor();
|
||||
builder.Services.AddSingleton<RssService>();
|
||||
builder.Services.AddSingleton<SyndicationService>();
|
||||
builder.Services.AddSingleton<FeedStateContainer>();
|
||||
builder.Services.AddMudServices(config =>
|
||||
{
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
@using WebSharpRSS.Models;
|
||||
@using ToolQit.Extensions;
|
||||
|
||||
@inject RssService _rssService
|
||||
@inject SyndicationService _syndicationService
|
||||
@inject NavigationManager _navigation
|
||||
|
||||
<MudStack Spacing="2">
|
||||
|
@ -61,7 +61,7 @@
|
|||
private async void ExpandedChanged(TreeItemData treeItemData)
|
||||
{
|
||||
treeItemData.Loading = true;
|
||||
var groupedItems = await _rssService.GetFeedsAsync(treeItemData.CategoryModel?.Id);
|
||||
var groupedItems = await _syndicationService.GetFeedsAsync(treeItemData.CategoryModel?.Id);
|
||||
treeItemData.Children = ModelToTreeItem(groupedItems);
|
||||
treeItemData.IsExpanded = !treeItemData.IsExpanded;
|
||||
treeItemData.Loading = false;
|
||||
|
@ -71,7 +71,7 @@
|
|||
{
|
||||
Log.Verbose("Loading guide data...");
|
||||
_guideItems.Add(new TreeItemData(new CategoryModel() { Name = "All", Icon = Icons.Material.Filled.Home, HexColor = Colors.Blue.Accent1, Id = string.Empty }));
|
||||
HashSet<object> items = await _rssService.GetCategoriesAndFeedsAsync();
|
||||
HashSet<object> items = await _syndicationService.GetCategoriesAndFeedsAsync();
|
||||
_guideItems.UnionWith(ModelToTreeItem(items));
|
||||
|
||||
StateHasChanged();
|
||||
|
|
Loading…
Reference in New Issue
Block a user