1.0-dev7 (Video adding panel added)

This commit is contained in:
2022-02-26 14:32:34 +01:00
Unverified
parent 96a7953500
commit f571a42995
95 changed files with 1436 additions and 227 deletions

View File

@@ -5,6 +5,7 @@ using System.Diagnostics;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using VDownload.Core.Exceptions;
using VDownload.Core.Interfaces;
@@ -37,8 +38,11 @@ namespace VDownload.Core.Services.Sources.Twitch
#region STANDARD METHODS
// GET CHANNEL METADATA
public async Task GetMetadataAsync()
public async Task GetMetadataAsync(CancellationToken cancellationToken = default)
{
// Set cancellation token
cancellationToken.ThrowIfCancellationRequested();
// Get access token
string accessToken = await Auth.ReadAccessTokenAsync();
if (accessToken == null) throw new TwitchAccessTokenNotFoundException();
@@ -62,8 +66,11 @@ namespace VDownload.Core.Services.Sources.Twitch
}
// GET CHANNEL VIDEOS
public async Task GetVideosAsync(int numberOfVideos)
public async Task GetVideosAsync(int numberOfVideos, CancellationToken cancellationToken = default)
{
// Set cancellation token
cancellationToken.ThrowIfCancellationRequested();
// Get access token
string accessToken = await Auth.ReadAccessTokenAsync();
if (accessToken == null) throw new TwitchAccessTokenNotFoundException();