[REWORK] Changes saving client and channel info
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
namespace Manager.YouTube.Models.Innertube;
|
||||
|
||||
public class Channel
|
||||
public class InnertubeChannel
|
||||
{
|
||||
public required string Id { get; set; }
|
||||
public bool NoIndex { get; set; }
|
@@ -6,7 +6,7 @@ namespace Manager.YouTube.Parsers.Json;
|
||||
|
||||
public static class ChannelJsonParser
|
||||
{
|
||||
public static Result<Channel> ParseJsonToChannelData(string json)
|
||||
public static Result<InnertubeChannel> ParseJsonToChannelData(string json)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -23,7 +23,7 @@ public static class ChannelJsonParser
|
||||
throw new InvalidOperationException("No channel id found.");
|
||||
}
|
||||
|
||||
var channel = new Channel
|
||||
var channel = new InnertubeChannel
|
||||
{
|
||||
Id = channelId,
|
||||
ChannelName = channelMetadata.GetProperty("title").ToString(),
|
||||
|
@@ -148,7 +148,7 @@ public sealed class YouTubeClient : IDisposable
|
||||
return Result.Success();
|
||||
}
|
||||
|
||||
public async Task<Result<Channel>> GetChannelByIdAsync(string channelId)
|
||||
public async Task<Result<InnertubeChannel>> GetChannelByIdAsync(string channelId)
|
||||
{
|
||||
if (State == null)
|
||||
{
|
||||
|
11
Manager.YouTube/YouTubeClientCollection.cs
Normal file
11
Manager.YouTube/YouTubeClientCollection.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
using System.Collections.ObjectModel;
|
||||
|
||||
namespace Manager.YouTube;
|
||||
|
||||
public class YouTubeClientCollection : KeyedCollection<string, YouTubeClient>
|
||||
{
|
||||
protected override string GetKeyForItem(YouTubeClient item)
|
||||
{
|
||||
return item.Id;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user