From 4bb032f2f6c793aabff7d57e0147d6e5a1c0db60 Mon Sep 17 00:00:00 2001 From: Mattia Date: Mon, 26 Jul 2021 00:41:55 +0200 Subject: [PATCH] Version 1.10.4 - Fix infinite loop when getting channel uploads. --- CHANGELOG.md | 3 +++ lib/src/playlists/playlist_client.dart | 30 +------------------------- pubspec.yaml | 2 +- 3 files changed, 5 insertions(+), 30 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 82c9b3b..d2184fc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## 1.10.4 +- Fix infinite loop when getting channel uploads. + ## 1.10.3 - Implement Embedded client. Thanks to @89z diff --git a/lib/src/playlists/playlist_client.dart b/lib/src/playlists/playlist_client.dart index 1f0903a..72c1c22 100644 --- a/lib/src/playlists/playlist_client.dart +++ b/lib/src/playlists/playlist_client.dart @@ -36,35 +36,6 @@ class PlaylistClient { PlaylistPage? page = await PlaylistPage.get(_httpClient, id.value); - for (final video in page.videos) { - var videoId = video.id; - - // Already added - if (!encounteredVideoIds.add(videoId)) { - continue; - } - - if (video.channelId.isEmpty) { - continue; - } - - yield Video( - VideoId(videoId), - video.title, - video.author, - ChannelId(video.channelId), - null, - null, - video.description, - video.duration, - ThumbnailSet(videoId), - null, - Engagement(video.viewCount, null, null), - false); - } - - page = await page.nextPage(_httpClient); - while (page != null) { for (final video in page.videos) { var videoId = video.id; @@ -92,6 +63,7 @@ class PlaylistClient { Engagement(video.viewCount, null, null), false); } + page = await page.nextPage(_httpClient); } } } diff --git a/pubspec.yaml b/pubspec.yaml index bc45a89..c3d4e23 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: youtube_explode_dart description: A port in dart of the youtube explode library. Supports several API functions without the need of Youtube API Key. -version: 1.10.3 +version: 1.10.4 homepage: https://github.com/Hexer10/youtube_explode_dart