From 3be2d19f3a088c620a0b061c67863ed44a0a0e8a Mon Sep 17 00:00:00 2001 From: petlyh <88139840+petlyh@users.noreply.github.com> Date: Thu, 13 Apr 2023 12:32:00 +0200 Subject: [PATCH] [SoundCloud] Fix certain playlists showing as empty --- .../extractors/SoundcloudPlaylistExtractor.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/services/soundcloud/extractors/SoundcloudPlaylistExtractor.java b/extractor/src/main/java/org/schabi/newpipe/extractor/services/soundcloud/extractors/SoundcloudPlaylistExtractor.java index 13f1f1400..fd4a1364e 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/services/soundcloud/extractors/SoundcloudPlaylistExtractor.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/services/soundcloud/extractors/SoundcloudPlaylistExtractor.java @@ -141,6 +141,15 @@ public class SoundcloudPlaylistExtractor extends PlaylistExtractor { } }); + // extract using getPage if no tracks were collected and playlist is not empty + if (streamInfoItemsCollector.getItems().isEmpty() && !ids.isEmpty()) { + try { + return getPage(new Page(ids)); + } catch (final IOException | ExtractionException e) { + return new InfoItemsPage<>(streamInfoItemsCollector, null); + } + } + return new InfoItemsPage<>(streamInfoItemsCollector, new Page(ids)); }