From cc798523cd5e0d8483f4c5f31f9280278ada77ec Mon Sep 17 00:00:00 2001 From: TiA4f8R <74829229+TiA4f8R@users.noreply.github.com> Date: Sun, 6 Jun 2021 15:40:45 +0200 Subject: [PATCH] Adress requested changes in other classes --- .../youtube/extractors/YoutubeChannelExtractor.java | 8 ++++---- .../linkHandler/YoutubeSearchQueryHandlerFactory.java | 7 ++----- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeChannelExtractor.java b/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeChannelExtractor.java index 3df12892..96f7cac7 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeChannelExtractor.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeChannelExtractor.java @@ -98,11 +98,11 @@ public class YoutubeChannelExtractor extends ChannelExtractor { if (jsonResponse.has("error")) { if (jsonResponse.getInt("code") == 404) { - throw new ContentNotAvailableException("No channel associated with this user" - + "exists"); + throw new ContentNotAvailableException( + "No channel associated with this user exists"); } else { throw new ContentNotAvailableException("Got error:\"" - + jsonResponse.getString("status") + "\"" + + jsonResponse.getString("status") + "\": " + jsonResponse.getString("message")); } } @@ -149,7 +149,7 @@ public class YoutubeChannelExtractor extends ChannelExtractor { throw new ContentNotAvailableException("This channel doesn't exist."); } else { throw new ContentNotAvailableException("Got error:\"" - + jsonResponse.getString("status") + "\"" + + jsonResponse.getString("status") + "\": " + jsonResponse.getString("message")); } } diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/linkHandler/YoutubeSearchQueryHandlerFactory.java b/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/linkHandler/YoutubeSearchQueryHandlerFactory.java index 92dfcf64..c87c856d 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/linkHandler/YoutubeSearchQueryHandlerFactory.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/linkHandler/YoutubeSearchQueryHandlerFactory.java @@ -75,8 +75,8 @@ public class YoutubeSearchQueryHandlerFactory extends SearchQueryHandlerFactory } public static String getSearchParameter(final String contentFilter) { - if (!isNullOrEmpty(contentFilter)) { - switch (contentFilter) { + if (isNullOrEmpty(contentFilter)) return ""; + switch (contentFilter) { case VIDEOS: return "EgIQAQ%3D%3D"; case CHANNELS: @@ -91,9 +91,6 @@ public class YoutubeSearchQueryHandlerFactory extends SearchQueryHandlerFactory case MUSIC_ARTISTS: default: return ""; - } - } else { - return ""; } } }