twitch not found error added
This commit is contained in:
@@ -87,6 +87,11 @@ namespace VDownload.Sources.Twitch
|
||||
|
||||
GetVideosResponse info = await _apiService.HelixGetVideo(id, token);
|
||||
|
||||
if (info.Data is null)
|
||||
{
|
||||
throw CreateExceptionVodNotFound();
|
||||
}
|
||||
|
||||
Api.Helix.GetVideos.Response.Data vodResponse = info.Data[0];
|
||||
|
||||
TwitchVod vod = await ParseVod(vodResponse);
|
||||
@@ -100,6 +105,11 @@ namespace VDownload.Sources.Twitch
|
||||
|
||||
GetClipsResponse info = await _apiService.HelixGetClip(id, token);
|
||||
|
||||
if (info.Data.Count == 0)
|
||||
{
|
||||
throw CreateExceptionClipNotFound();
|
||||
}
|
||||
|
||||
Api.Helix.GetClips.Response.Data clipResponse = info.Data[0];
|
||||
|
||||
TwitchClip clip = await ParseClip(clipResponse);
|
||||
@@ -306,6 +316,8 @@ namespace VDownload.Sources.Twitch
|
||||
protected MediaSearchException CreateExceptionNotAuthenticated() => new MediaSearchException("TwitchNotAuthenticated");
|
||||
protected MediaSearchException CreateExceptionTokenValidationUnsuccessful() => new MediaSearchException("TwitchTokenValidationUnsuccessful");
|
||||
protected MediaSearchException CreateExceptionChannelNotFound() => new MediaSearchException("TwitchChannelNotFound");
|
||||
protected MediaSearchException CreateExceptionVodNotFound() => new MediaSearchException("TwitchVodNotFound");
|
||||
protected MediaSearchException CreateExceptionClipNotFound() => new MediaSearchException("TwitchClipNotFound");
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user