From 07570554b6a6ecdfc395901a9c827a583a00d1d5 Mon Sep 17 00:00:00 2001 From: TobiGr Date: Fri, 15 Jan 2021 21:55:40 +0100 Subject: [PATCH] Fix build and optimize imports --- .../extractors/BandcampSearchExtractor.java | 10 ++++++++++ .../extractors/BandcampStreamExtractor.java | 13 +++++++++++++ .../bandcamp/BandcampChannelExtractorTest.java | 2 +- .../BandcampChannelLinkHandlerFactoryTest.java | 2 +- .../bandcamp/BandcampFeaturedExtractorTest.java | 3 +-- .../bandcamp/BandcampPlaylistExtractorTest.java | 3 +-- .../BandcampPlaylistLinkHandlerFactoryTest.java | 3 +-- .../bandcamp/BandcampRadioExtractorTest.java | 3 +-- .../bandcamp/BandcampRadioStreamExtractorTest.java | 2 +- .../bandcamp/BandcampSearchExtractorTest.java | 7 ++----- .../BandcampSearchQueryHandlerFactoryTest.java | 2 +- .../bandcamp/BandcampStreamExtractorTest.java | 4 +--- .../BandcampStreamLinkHandlerFactoryTest.java | 2 +- .../bandcamp/BandcampSuggestionExtractorTest.java | 2 +- 14 files changed, 36 insertions(+), 22 deletions(-) diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/services/bandcamp/extractors/BandcampSearchExtractor.java b/extractor/src/main/java/org/schabi/newpipe/extractor/services/bandcamp/extractors/BandcampSearchExtractor.java index 23097171e..6888d6932 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/services/bandcamp/extractors/BandcampSearchExtractor.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/services/bandcamp/extractors/BandcampSearchExtractor.java @@ -8,10 +8,12 @@ import org.jsoup.nodes.Document; import org.jsoup.nodes.Element; import org.jsoup.select.Elements; import org.schabi.newpipe.extractor.InfoItem; +import org.schabi.newpipe.extractor.MetaInfo; import org.schabi.newpipe.extractor.Page; import org.schabi.newpipe.extractor.StreamingService; import org.schabi.newpipe.extractor.downloader.Downloader; import org.schabi.newpipe.extractor.exceptions.ExtractionException; +import org.schabi.newpipe.extractor.exceptions.ParsingException; import org.schabi.newpipe.extractor.linkhandler.SearchQueryHandler; import org.schabi.newpipe.extractor.search.InfoItemsSearchCollector; import org.schabi.newpipe.extractor.search.SearchExtractor; @@ -19,6 +21,8 @@ import org.schabi.newpipe.extractor.services.bandcamp.extractors.streaminfoitem. import javax.annotation.Nonnull; import java.io.IOException; +import java.util.Collections; +import java.util.List; public class BandcampSearchExtractor extends SearchExtractor { @@ -37,6 +41,12 @@ public class BandcampSearchExtractor extends SearchExtractor { return false; } + @Nonnull + @Override + public List getMetaInfo() throws ParsingException { + return Collections.emptyList(); + } + public InfoItemsPage getPage(final Page page) throws IOException, ExtractionException { // okay apparently this is where we DOWNLOAD the page and then COMMIT its ENTRIES to an INFOITEMPAGE final String html = getDownloader().get(page.getUrl()).responseBody(); diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/services/bandcamp/extractors/BandcampStreamExtractor.java b/extractor/src/main/java/org/schabi/newpipe/extractor/services/bandcamp/extractors/BandcampStreamExtractor.java index 1f37176bf..3409a4cd2 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/services/bandcamp/extractors/BandcampStreamExtractor.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/services/bandcamp/extractors/BandcampStreamExtractor.java @@ -9,6 +9,7 @@ import org.jsoup.nodes.Document; import org.jsoup.nodes.Element; import org.jsoup.select.Elements; import org.schabi.newpipe.extractor.MediaFormat; +import org.schabi.newpipe.extractor.MetaInfo; import org.schabi.newpipe.extractor.StreamingService; import org.schabi.newpipe.extractor.downloader.Downloader; import org.schabi.newpipe.extractor.exceptions.ExtractionException; @@ -319,4 +320,16 @@ public class BandcampStreamExtractor extends StreamExtractor { public String getSupportInfo() { return ""; } + + @Nonnull + @Override + public List getStreamSegments() throws ParsingException { + return Collections.emptyList(); + } + + @Nonnull + @Override + public List getMetaInfo() throws ParsingException { + return Collections.emptyList(); + } } diff --git a/extractor/src/test/java/org/schabi/newpipe/extractor/services/bandcamp/BandcampChannelExtractorTest.java b/extractor/src/test/java/org/schabi/newpipe/extractor/services/bandcamp/BandcampChannelExtractorTest.java index 327dc6b9a..b67be1832 100644 --- a/extractor/src/test/java/org/schabi/newpipe/extractor/services/bandcamp/BandcampChannelExtractorTest.java +++ b/extractor/src/test/java/org/schabi/newpipe/extractor/services/bandcamp/BandcampChannelExtractorTest.java @@ -4,7 +4,7 @@ package org.schabi.newpipe.extractor.services.bandcamp; import org.junit.BeforeClass; import org.junit.Test; -import org.schabi.newpipe.DownloaderTestImpl; +import org.schabi.newpipe.downloader.DownloaderTestImpl; import org.schabi.newpipe.extractor.NewPipe; import org.schabi.newpipe.extractor.channel.ChannelExtractor; import org.schabi.newpipe.extractor.exceptions.ExtractionException; diff --git a/extractor/src/test/java/org/schabi/newpipe/extractor/services/bandcamp/BandcampChannelLinkHandlerFactoryTest.java b/extractor/src/test/java/org/schabi/newpipe/extractor/services/bandcamp/BandcampChannelLinkHandlerFactoryTest.java index 6052a2549..89c81fb9e 100644 --- a/extractor/src/test/java/org/schabi/newpipe/extractor/services/bandcamp/BandcampChannelLinkHandlerFactoryTest.java +++ b/extractor/src/test/java/org/schabi/newpipe/extractor/services/bandcamp/BandcampChannelLinkHandlerFactoryTest.java @@ -4,7 +4,7 @@ package org.schabi.newpipe.extractor.services.bandcamp; import org.junit.BeforeClass; import org.junit.Test; -import org.schabi.newpipe.DownloaderTestImpl; +import org.schabi.newpipe.downloader.DownloaderTestImpl; import org.schabi.newpipe.extractor.NewPipe; import org.schabi.newpipe.extractor.exceptions.ParsingException; import org.schabi.newpipe.extractor.services.bandcamp.linkHandler.BandcampChannelLinkHandlerFactory; diff --git a/extractor/src/test/java/org/schabi/newpipe/extractor/services/bandcamp/BandcampFeaturedExtractorTest.java b/extractor/src/test/java/org/schabi/newpipe/extractor/services/bandcamp/BandcampFeaturedExtractorTest.java index 50d992a16..8a9756f91 100644 --- a/extractor/src/test/java/org/schabi/newpipe/extractor/services/bandcamp/BandcampFeaturedExtractorTest.java +++ b/extractor/src/test/java/org/schabi/newpipe/extractor/services/bandcamp/BandcampFeaturedExtractorTest.java @@ -4,8 +4,7 @@ package org.schabi.newpipe.extractor.services.bandcamp; import org.junit.BeforeClass; import org.junit.Test; -import org.schabi.newpipe.DownloaderTestImpl; -import org.schabi.newpipe.extractor.InfoItem; +import org.schabi.newpipe.downloader.DownloaderTestImpl; import org.schabi.newpipe.extractor.NewPipe; import org.schabi.newpipe.extractor.exceptions.ExtractionException; import org.schabi.newpipe.extractor.playlist.PlaylistInfoItem; diff --git a/extractor/src/test/java/org/schabi/newpipe/extractor/services/bandcamp/BandcampPlaylistExtractorTest.java b/extractor/src/test/java/org/schabi/newpipe/extractor/services/bandcamp/BandcampPlaylistExtractorTest.java index b695236d9..ce6a54cf0 100644 --- a/extractor/src/test/java/org/schabi/newpipe/extractor/services/bandcamp/BandcampPlaylistExtractorTest.java +++ b/extractor/src/test/java/org/schabi/newpipe/extractor/services/bandcamp/BandcampPlaylistExtractorTest.java @@ -4,14 +4,13 @@ package org.schabi.newpipe.extractor.services.bandcamp; import org.junit.BeforeClass; import org.junit.Test; -import org.schabi.newpipe.DownloaderTestImpl; +import org.schabi.newpipe.downloader.DownloaderTestImpl; import org.schabi.newpipe.extractor.NewPipe; import org.schabi.newpipe.extractor.exceptions.ContentNotAvailableException; import org.schabi.newpipe.extractor.exceptions.ExtractionException; import org.schabi.newpipe.extractor.exceptions.ParsingException; import org.schabi.newpipe.extractor.playlist.PlaylistExtractor; import org.schabi.newpipe.extractor.services.BasePlaylistExtractorTest; -import org.schabi.newpipe.extractor.services.DefaultTests; import org.schabi.newpipe.extractor.services.bandcamp.extractors.BandcampPlaylistExtractor; import org.schabi.newpipe.extractor.stream.StreamInfoItem; diff --git a/extractor/src/test/java/org/schabi/newpipe/extractor/services/bandcamp/BandcampPlaylistLinkHandlerFactoryTest.java b/extractor/src/test/java/org/schabi/newpipe/extractor/services/bandcamp/BandcampPlaylistLinkHandlerFactoryTest.java index 561d8f7b6..e1b7949f8 100644 --- a/extractor/src/test/java/org/schabi/newpipe/extractor/services/bandcamp/BandcampPlaylistLinkHandlerFactoryTest.java +++ b/extractor/src/test/java/org/schabi/newpipe/extractor/services/bandcamp/BandcampPlaylistLinkHandlerFactoryTest.java @@ -4,11 +4,10 @@ package org.schabi.newpipe.extractor.services.bandcamp; import org.junit.BeforeClass; import org.junit.Test; -import org.schabi.newpipe.DownloaderTestImpl; +import org.schabi.newpipe.downloader.DownloaderTestImpl; import org.schabi.newpipe.extractor.NewPipe; import org.schabi.newpipe.extractor.exceptions.ParsingException; import org.schabi.newpipe.extractor.services.bandcamp.linkHandler.BandcampPlaylistLinkHandlerFactory; -import org.schabi.newpipe.extractor.services.bandcamp.linkHandler.BandcampStreamLinkHandlerFactory; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; diff --git a/extractor/src/test/java/org/schabi/newpipe/extractor/services/bandcamp/BandcampRadioExtractorTest.java b/extractor/src/test/java/org/schabi/newpipe/extractor/services/bandcamp/BandcampRadioExtractorTest.java index c7b4e3579..064521d9b 100644 --- a/extractor/src/test/java/org/schabi/newpipe/extractor/services/bandcamp/BandcampRadioExtractorTest.java +++ b/extractor/src/test/java/org/schabi/newpipe/extractor/services/bandcamp/BandcampRadioExtractorTest.java @@ -4,12 +4,11 @@ package org.schabi.newpipe.extractor.services.bandcamp; import org.junit.BeforeClass; import org.junit.Test; -import org.schabi.newpipe.DownloaderTestImpl; +import org.schabi.newpipe.downloader.DownloaderTestImpl; import org.schabi.newpipe.extractor.InfoItem; import org.schabi.newpipe.extractor.NewPipe; import org.schabi.newpipe.extractor.exceptions.ExtractionException; import org.schabi.newpipe.extractor.services.BaseListExtractorTest; -import org.schabi.newpipe.extractor.services.DefaultTests; import org.schabi.newpipe.extractor.services.bandcamp.extractors.BandcampRadioExtractor; import java.io.IOException; diff --git a/extractor/src/test/java/org/schabi/newpipe/extractor/services/bandcamp/BandcampRadioStreamExtractorTest.java b/extractor/src/test/java/org/schabi/newpipe/extractor/services/bandcamp/BandcampRadioStreamExtractorTest.java index e024fefa7..8773c5564 100644 --- a/extractor/src/test/java/org/schabi/newpipe/extractor/services/bandcamp/BandcampRadioStreamExtractorTest.java +++ b/extractor/src/test/java/org/schabi/newpipe/extractor/services/bandcamp/BandcampRadioStreamExtractorTest.java @@ -2,7 +2,7 @@ package org.schabi.newpipe.extractor.services.bandcamp; import org.junit.BeforeClass; import org.junit.Test; -import org.schabi.newpipe.DownloaderTestImpl; +import org.schabi.newpipe.downloader.DownloaderTestImpl; import org.schabi.newpipe.extractor.NewPipe; import org.schabi.newpipe.extractor.StreamingService; import org.schabi.newpipe.extractor.exceptions.ContentNotSupportedException; diff --git a/extractor/src/test/java/org/schabi/newpipe/extractor/services/bandcamp/BandcampSearchExtractorTest.java b/extractor/src/test/java/org/schabi/newpipe/extractor/services/bandcamp/BandcampSearchExtractorTest.java index f74fb9256..124265168 100644 --- a/extractor/src/test/java/org/schabi/newpipe/extractor/services/bandcamp/BandcampSearchExtractorTest.java +++ b/extractor/src/test/java/org/schabi/newpipe/extractor/services/bandcamp/BandcampSearchExtractorTest.java @@ -4,20 +4,17 @@ package org.schabi.newpipe.extractor.services.bandcamp; import org.junit.BeforeClass; import org.junit.Test; -import org.schabi.newpipe.DownloaderTestImpl; +import org.schabi.newpipe.downloader.DownloaderTestImpl; import org.schabi.newpipe.extractor.*; import org.schabi.newpipe.extractor.exceptions.ExtractionException; import org.schabi.newpipe.extractor.playlist.PlaylistInfoItem; import org.schabi.newpipe.extractor.search.SearchExtractor; import org.schabi.newpipe.extractor.services.DefaultSearchExtractorTest; -import org.schabi.newpipe.extractor.services.bandcamp.extractors.BandcampChannelInfoItemExtractor; -import org.schabi.newpipe.extractor.services.bandcamp.extractors.BandcampPlaylistInfoItemExtractor; import org.schabi.newpipe.extractor.services.bandcamp.extractors.BandcampSearchExtractor; import org.schabi.newpipe.extractor.stream.StreamInfoItem; -import java.io.IOException; - import javax.annotation.Nullable; +import java.io.IOException; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; diff --git a/extractor/src/test/java/org/schabi/newpipe/extractor/services/bandcamp/BandcampSearchQueryHandlerFactoryTest.java b/extractor/src/test/java/org/schabi/newpipe/extractor/services/bandcamp/BandcampSearchQueryHandlerFactoryTest.java index 4271bc97c..c39115247 100644 --- a/extractor/src/test/java/org/schabi/newpipe/extractor/services/bandcamp/BandcampSearchQueryHandlerFactoryTest.java +++ b/extractor/src/test/java/org/schabi/newpipe/extractor/services/bandcamp/BandcampSearchQueryHandlerFactoryTest.java @@ -4,7 +4,7 @@ package org.schabi.newpipe.extractor.services.bandcamp; import org.junit.BeforeClass; import org.junit.Test; -import org.schabi.newpipe.DownloaderTestImpl; +import org.schabi.newpipe.downloader.DownloaderTestImpl; import org.schabi.newpipe.extractor.NewPipe; import org.schabi.newpipe.extractor.exceptions.ParsingException; import org.schabi.newpipe.extractor.services.bandcamp.linkHandler.BandcampSearchQueryHandlerFactory; diff --git a/extractor/src/test/java/org/schabi/newpipe/extractor/services/bandcamp/BandcampStreamExtractorTest.java b/extractor/src/test/java/org/schabi/newpipe/extractor/services/bandcamp/BandcampStreamExtractorTest.java index dd979d554..a080de674 100644 --- a/extractor/src/test/java/org/schabi/newpipe/extractor/services/bandcamp/BandcampStreamExtractorTest.java +++ b/extractor/src/test/java/org/schabi/newpipe/extractor/services/bandcamp/BandcampStreamExtractorTest.java @@ -4,7 +4,7 @@ package org.schabi.newpipe.extractor.services.bandcamp; import org.junit.BeforeClass; import org.junit.Test; -import org.schabi.newpipe.DownloaderTestImpl; +import org.schabi.newpipe.downloader.DownloaderTestImpl; import org.schabi.newpipe.extractor.NewPipe; import org.schabi.newpipe.extractor.StreamingService; import org.schabi.newpipe.extractor.exceptions.ExtractionException; @@ -16,10 +16,8 @@ import org.schabi.newpipe.extractor.stream.StreamExtractor; import org.schabi.newpipe.extractor.stream.StreamType; import java.io.IOException; -import java.util.Calendar; import java.util.Collections; import java.util.List; -import java.util.TimeZone; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; diff --git a/extractor/src/test/java/org/schabi/newpipe/extractor/services/bandcamp/BandcampStreamLinkHandlerFactoryTest.java b/extractor/src/test/java/org/schabi/newpipe/extractor/services/bandcamp/BandcampStreamLinkHandlerFactoryTest.java index a65b09567..17d983cec 100644 --- a/extractor/src/test/java/org/schabi/newpipe/extractor/services/bandcamp/BandcampStreamLinkHandlerFactoryTest.java +++ b/extractor/src/test/java/org/schabi/newpipe/extractor/services/bandcamp/BandcampStreamLinkHandlerFactoryTest.java @@ -4,7 +4,7 @@ package org.schabi.newpipe.extractor.services.bandcamp; import org.junit.BeforeClass; import org.junit.Test; -import org.schabi.newpipe.DownloaderTestImpl; +import org.schabi.newpipe.downloader.DownloaderTestImpl; import org.schabi.newpipe.extractor.NewPipe; import org.schabi.newpipe.extractor.exceptions.ParsingException; import org.schabi.newpipe.extractor.services.bandcamp.linkHandler.BandcampStreamLinkHandlerFactory; diff --git a/extractor/src/test/java/org/schabi/newpipe/extractor/services/bandcamp/BandcampSuggestionExtractorTest.java b/extractor/src/test/java/org/schabi/newpipe/extractor/services/bandcamp/BandcampSuggestionExtractorTest.java index 9764d995a..95f7de3a9 100644 --- a/extractor/src/test/java/org/schabi/newpipe/extractor/services/bandcamp/BandcampSuggestionExtractorTest.java +++ b/extractor/src/test/java/org/schabi/newpipe/extractor/services/bandcamp/BandcampSuggestionExtractorTest.java @@ -4,7 +4,7 @@ package org.schabi.newpipe.extractor.services.bandcamp; import org.junit.BeforeClass; import org.junit.Test; -import org.schabi.newpipe.DownloaderTestImpl; +import org.schabi.newpipe.downloader.DownloaderTestImpl; import org.schabi.newpipe.extractor.NewPipe; import org.schabi.newpipe.extractor.exceptions.ExtractionException; import org.schabi.newpipe.extractor.services.bandcamp.extractors.BandcampSuggestionExtractor;