Added File Download, abstracted JSON

This commit is contained in:
Mike Nolan 2022-07-06 18:02:17 -05:00
parent 08675d678b
commit 93c0f3d5ab
1 changed files with 3 additions and 3 deletions

View File

@ -98,7 +98,7 @@ namespace Tesses.YouTubeDownloader
LastSubscriptionTime=date;
}
public async IAsyncEnumerable<Subscription> GetSubscriptionsAsync()
public virtual async IAsyncEnumerable<Subscription> GetSubscriptionsAsync()
{
await foreach(var item in EnumerateFilesAsync("Subscriptions"))
@ -128,7 +128,7 @@ namespace Tesses.YouTubeDownloader
Subscriptions.Add(sub);
await SaveSubscription(sub);
}
public async Task SaveSubscription(Subscription sub)
public virtual async Task SaveSubscription(Subscription sub)
{
await WriteAllTextAsync($"Subscriptions/{sub.Id}.json",JsonConvert.SerializeObject(sub));
}
@ -142,7 +142,7 @@ namespace Tesses.YouTubeDownloader
{
return Subscriptions;
}
public void Unsubscribe(ChannelId id)
public virtual void Unsubscribe(ChannelId id)
{
Subscription sub= Subscriptions.FirstOrDefault(e=>e.Id==id.Value);
if(sub != null)