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