Skip to content

Commit

Permalink
Fix app crash when fetching videos in VOD/Clip mass downloaders (#1193)
Browse files Browse the repository at this point in the history
* Fix app crash when fetching videos in vod/clip mass downloaders

* Do not fail silently when verbose errors are disabled

* Add custom translations
  • Loading branch information
ScrubN authored Aug 27, 2024
1 parent d54ae22 commit b2dc445
Show file tree
Hide file tree
Showing 13 changed files with 204 additions and 3 deletions.
37 changes: 36 additions & 1 deletion TwitchDownloaderWPF/Translations/Strings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions TwitchDownloaderWPF/Translations/Strings.es.resx
Original file line number Diff line number Diff line change
Expand Up @@ -937,4 +937,16 @@
<data name="TaskRetry" xml:space="preserve">
<value>Retry</value>
</data>
<data name="UnableToGetChannelVideos" xml:space="preserve">
<value>Unable to Get Videos</value>
</data>
<data name="UnableToGetChannelVideosMessage" xml:space="preserve">
<value>Unable to get channel videos: {0}</value>
</data>
<data name="UnableToGetChannelClips" xml:space="preserve">
<value>Unable to Get Clips</value>
</data>
<data name="UnableToGetChannelClipsMessage" xml:space="preserve">
<value>Unable to get channel clips: {0}</value>
</data>
</root>
12 changes: 12 additions & 0 deletions TwitchDownloaderWPF/Translations/Strings.fr.resx
Original file line number Diff line number Diff line change
Expand Up @@ -936,4 +936,16 @@
<data name="TaskRetry" xml:space="preserve">
<value>Retry</value>
</data>
<data name="UnableToGetChannelVideos" xml:space="preserve">
<value>Unable to Get Videos</value>
</data>
<data name="UnableToGetChannelVideosMessage" xml:space="preserve">
<value>Unable to get channel videos: {0}</value>
</data>
<data name="UnableToGetChannelClips" xml:space="preserve">
<value>Unable to Get Clips</value>
</data>
<data name="UnableToGetChannelClipsMessage" xml:space="preserve">
<value>Unable to get channel clips: {0}</value>
</data>
</root>
12 changes: 12 additions & 0 deletions TwitchDownloaderWPF/Translations/Strings.it.resx
Original file line number Diff line number Diff line change
Expand Up @@ -937,4 +937,16 @@
<data name="TaskRetry" xml:space="preserve">
<value>Retry</value>
</data>
<data name="UnableToGetChannelVideos" xml:space="preserve">
<value>Unable to Get Videos</value>
</data>
<data name="UnableToGetChannelVideosMessage" xml:space="preserve">
<value>Unable to get channel videos: {0}</value>
</data>
<data name="UnableToGetChannelClips" xml:space="preserve">
<value>Unable to Get Clips</value>
</data>
<data name="UnableToGetChannelClipsMessage" xml:space="preserve">
<value>Unable to get channel clips: {0}</value>
</data>
</root>
12 changes: 12 additions & 0 deletions TwitchDownloaderWPF/Translations/Strings.ja.resx
Original file line number Diff line number Diff line change
Expand Up @@ -935,4 +935,16 @@
<data name="TaskRetry" xml:space="preserve">
<value>Retry</value>
</data>
<data name="UnableToGetChannelVideos" xml:space="preserve">
<value>Unable to Get Videos</value>
</data>
<data name="UnableToGetChannelVideosMessage" xml:space="preserve">
<value>Unable to get channel videos: {0}</value>
</data>
<data name="UnableToGetChannelClips" xml:space="preserve">
<value>Unable to Get Clips</value>
</data>
<data name="UnableToGetChannelClipsMessage" xml:space="preserve">
<value>Unable to get channel clips: {0}</value>
</data>
</root>
12 changes: 12 additions & 0 deletions TwitchDownloaderWPF/Translations/Strings.pl.resx
Original file line number Diff line number Diff line change
Expand Up @@ -936,4 +936,16 @@
<data name="TaskRetry" xml:space="preserve">
<value>Retry</value>
</data>
<data name="UnableToGetChannelVideos" xml:space="preserve">
<value>Unable to Get Videos</value>
</data>
<data name="UnableToGetChannelVideosMessage" xml:space="preserve">
<value>Unable to get channel videos: {0}</value>
</data>
<data name="UnableToGetChannelClips" xml:space="preserve">
<value>Unable to Get Clips</value>
</data>
<data name="UnableToGetChannelClipsMessage" xml:space="preserve">
<value>Unable to get channel clips: {0}</value>
</data>
</root>
12 changes: 12 additions & 0 deletions TwitchDownloaderWPF/Translations/Strings.pt-br.resx
Original file line number Diff line number Diff line change
Expand Up @@ -935,4 +935,16 @@
<data name="TaskRetry" xml:space="preserve">
<value>Retry</value>
</data>
<data name="UnableToGetChannelVideos" xml:space="preserve">
<value>Unable to Get Videos</value>
</data>
<data name="UnableToGetChannelVideosMessage" xml:space="preserve">
<value>Unable to get channel videos: {0}</value>
</data>
<data name="UnableToGetChannelClips" xml:space="preserve">
<value>Unable to Get Clips</value>
</data>
<data name="UnableToGetChannelClipsMessage" xml:space="preserve">
<value>Unable to get channel clips: {0}</value>
</data>
</root>
12 changes: 12 additions & 0 deletions TwitchDownloaderWPF/Translations/Strings.resx
Original file line number Diff line number Diff line change
Expand Up @@ -935,4 +935,16 @@
<data name="TaskRetry" xml:space="preserve">
<value>Retry</value>
</data>
<data name="UnableToGetChannelVideos" xml:space="preserve">
<value>Unable to Get Videos</value>
</data>
<data name="UnableToGetChannelVideosMessage" xml:space="preserve">
<value>Unable to get channel videos: {0}</value>
</data>
<data name="UnableToGetChannelClips" xml:space="preserve">
<value>Unable to Get Clips</value>
</data>
<data name="UnableToGetChannelClipsMessage" xml:space="preserve">
<value>Unable to get channel clips: {0}</value>
</data>
</root>
12 changes: 12 additions & 0 deletions TwitchDownloaderWPF/Translations/Strings.ru.resx
Original file line number Diff line number Diff line change
Expand Up @@ -936,4 +936,16 @@
<data name="TaskRetry" xml:space="preserve">
<value>Retry</value>
</data>
<data name="UnableToGetChannelVideos" xml:space="preserve">
<value>Unable to Get Videos</value>
</data>
<data name="UnableToGetChannelVideosMessage" xml:space="preserve">
<value>Unable to get channel videos: {0}</value>
</data>
<data name="UnableToGetChannelClips" xml:space="preserve">
<value>Unable to Get Clips</value>
</data>
<data name="UnableToGetChannelClipsMessage" xml:space="preserve">
<value>Unable to get channel clips: {0}</value>
</data>
</root>
12 changes: 12 additions & 0 deletions TwitchDownloaderWPF/Translations/Strings.tr.resx
Original file line number Diff line number Diff line change
Expand Up @@ -937,4 +937,16 @@
<data name="TaskRetry" xml:space="preserve">
<value>Retry</value>
</data>
<data name="UnableToGetChannelVideos" xml:space="preserve">
<value>Unable to Get Videos</value>
</data>
<data name="UnableToGetChannelVideosMessage" xml:space="preserve">
<value>Unable to get channel videos: {0}</value>
</data>
<data name="UnableToGetChannelClips" xml:space="preserve">
<value>Unable to Get Clips</value>
</data>
<data name="UnableToGetChannelClipsMessage" xml:space="preserve">
<value>Unable to get channel clips: {0}</value>
</data>
</root>
12 changes: 12 additions & 0 deletions TwitchDownloaderWPF/Translations/Strings.uk.resx
Original file line number Diff line number Diff line change
Expand Up @@ -936,4 +936,16 @@
<data name="TaskRetry" xml:space="preserve">
<value>Retry</value>
</data>
<data name="UnableToGetChannelVideos" xml:space="preserve">
<value>Unable to Get Videos</value>
</data>
<data name="UnableToGetChannelVideosMessage" xml:space="preserve">
<value>Unable to get channel videos: {0}</value>
</data>
<data name="UnableToGetChannelClips" xml:space="preserve">
<value>Unable to Get Clips</value>
</data>
<data name="UnableToGetChannelClipsMessage" xml:space="preserve">
<value>Unable to get channel clips: {0}</value>
</data>
</root>
12 changes: 12 additions & 0 deletions TwitchDownloaderWPF/Translations/Strings.zh-cn.resx
Original file line number Diff line number Diff line change
Expand Up @@ -938,4 +938,16 @@
<data name="TaskRetry" xml:space="preserve">
<value>Retry</value>
</data>
<data name="UnableToGetChannelVideos" xml:space="preserve">
<value>Unable to Get Videos</value>
</data>
<data name="UnableToGetChannelVideosMessage" xml:space="preserve">
<value>Unable to get channel videos: {0}</value>
</data>
<data name="UnableToGetChannelClips" xml:space="preserve">
<value>Unable to Get Clips</value>
</data>
<data name="UnableToGetChannelClipsMessage" xml:space="preserve">
<value>Unable to get channel clips: {0}</value>
</data>
</root>
38 changes: 36 additions & 2 deletions TwitchDownloaderWPF/WindowMassDownload.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,24 @@ private async Task UpdateList()
{
currentCursor = cursorList[cursorIndex];
}
GqlVideoSearchResponse res = await TwitchHelper.GetGqlVideos(currentChannel, currentCursor, videoCount);

GqlVideoSearchResponse res;
try
{
res = await TwitchHelper.GetGqlVideos(currentChannel, currentCursor, videoCount);
}
catch (Exception ex)
{
MessageBox.Show(this, string.Format(Translations.Strings.UnableToGetChannelVideosMessage, ex.Message), Translations.Strings.UnableToGetChannelVideos, MessageBoxButton.OK, MessageBoxImage.Error);

if (Settings.Default.VerboseErrors)
{
MessageBox.Show(this, ex.ToString(), Translations.Strings.VerboseErrorOutput, MessageBoxButton.OK, MessageBoxImage.Error);
}

return;
}

videoList.Clear();
if (res.data.user != null)
{
Expand Down Expand Up @@ -125,7 +142,24 @@ private async Task UpdateList()
{
currentCursor = cursorList[cursorIndex];
}
GqlClipSearchResponse res = await TwitchHelper.GetGqlClips(currentChannel, period, currentCursor, videoCount);

GqlClipSearchResponse res;
try
{
res = await TwitchHelper.GetGqlClips(currentChannel, period, currentCursor, videoCount);
}
catch (Exception ex)
{
MessageBox.Show(this, string.Format(Translations.Strings.UnableToGetChannelClipsMessage, ex.Message), Translations.Strings.UnableToGetChannelClips, MessageBoxButton.OK, MessageBoxImage.Error);

if (Settings.Default.VerboseErrors)
{
MessageBox.Show(this, ex.ToString(), Translations.Strings.VerboseErrorOutput, MessageBoxButton.OK, MessageBoxImage.Error);
}

return;
}

videoList.Clear();
if (res.data.user != null)
{
Expand Down

0 comments on commit b2dc445

Please sign in to comment.