From 6cac1ca8a156715b399697cd27069286713dda75 Mon Sep 17 00:00:00 2001 From: Bnyro Date: Fri, 15 Mar 2024 14:52:24 +0100 Subject: [PATCH] chore: remove unused imports --- src/main/java/me/kavin/piped/consts/Constants.java | 5 ----- .../java/me/kavin/piped/server/ServerLauncher.java | 13 ------------- .../piped/server/handlers/PlaylistHandlers.java | 3 ++- .../piped/server/handlers/auth/FeedHandlers.java | 3 ++- .../java/me/kavin/piped/utils/ChannelHelpers.java | 5 ++++- .../java/me/kavin/piped/utils/PlaylistHelpers.java | 3 +-- .../java/me/kavin/piped/utils/VideoHelpers.java | 1 - 7 files changed, 9 insertions(+), 24 deletions(-) diff --git a/src/main/java/me/kavin/piped/consts/Constants.java b/src/main/java/me/kavin/piped/consts/Constants.java index 176a3a4..2a2624d 100644 --- a/src/main/java/me/kavin/piped/consts/Constants.java +++ b/src/main/java/me/kavin/piped/consts/Constants.java @@ -8,7 +8,6 @@ import com.fasterxml.jackson.databind.node.ObjectNode; import io.minio.MinioClient; import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap; import me.kavin.piped.utils.PageMixin; -import me.kavin.piped.utils.RequestUtils; import me.kavin.piped.utils.resp.ListLinkHandlerMixin; import okhttp3.OkHttpClient; import okhttp3.brotli.BrotliInterceptor; @@ -19,17 +18,13 @@ import org.schabi.newpipe.extractor.Page; import org.schabi.newpipe.extractor.StreamingService; import org.schabi.newpipe.extractor.linkhandler.ListLinkHandler; import org.schabi.newpipe.extractor.localization.ContentCountry; -import rocks.kavin.reqwest4j.ReqwestUtils; import java.io.File; import java.io.FileReader; -import java.net.InetSocketAddress; -import java.net.ProxySelector; import java.nio.charset.StandardCharsets; import java.util.List; import java.util.Optional; import java.util.Properties; -import java.util.regex.Pattern; public class Constants { diff --git a/src/main/java/me/kavin/piped/server/ServerLauncher.java b/src/main/java/me/kavin/piped/server/ServerLauncher.java index 6207f7c..8c7fe63 100644 --- a/src/main/java/me/kavin/piped/server/ServerLauncher.java +++ b/src/main/java/me/kavin/piped/server/ServerLauncher.java @@ -2,15 +2,12 @@ package me.kavin.piped.server; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.JsonNode; -import com.rometools.rome.feed.synd.SyndFeed; -import com.rometools.rome.io.SyndFeedInput; import io.activej.config.Config; import io.activej.http.*; import io.activej.inject.annotation.Provides; import io.activej.inject.module.AbstractModule; import io.activej.inject.module.Module; import io.activej.launchers.http.MultithreadedHttpServerLauncher; -import io.sentry.Sentry; import it.unimi.dsi.fastutil.objects.ObjectArrayList; import me.kavin.piped.consts.Constants; import me.kavin.piped.server.handlers.*; @@ -19,30 +16,20 @@ import me.kavin.piped.server.handlers.auth.FeedHandlers; import me.kavin.piped.server.handlers.auth.StorageHandlers; import me.kavin.piped.server.handlers.auth.UserHandlers; import me.kavin.piped.utils.*; -import me.kavin.piped.utils.obj.MatrixHelper; -import me.kavin.piped.utils.obj.federation.FederatedVideoInfo; import me.kavin.piped.utils.resp.*; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.exception.ExceptionUtils; import org.hibernate.Session; -import org.hibernate.StatelessSession; import org.jetbrains.annotations.NotNull; -import org.schabi.newpipe.extractor.exceptions.ParsingException; -import org.schabi.newpipe.extractor.localization.DateWrapper; -import org.xml.sax.InputSource; -import java.io.ByteArrayInputStream; import java.net.InetSocketAddress; -import java.util.List; import java.util.Objects; import java.util.concurrent.Executor; -import java.util.concurrent.TimeUnit; import static io.activej.config.converter.ConfigConverters.ofInetSocketAddress; import static io.activej.http.HttpHeaders.*; import static io.activej.http.HttpMethod.*; import static java.nio.charset.StandardCharsets.UTF_8; -import static me.kavin.piped.consts.Constants.YOUTUBE_SERVICE; import static me.kavin.piped.consts.Constants.mapper; public class ServerLauncher extends MultithreadedHttpServerLauncher { diff --git a/src/main/java/me/kavin/piped/server/handlers/PlaylistHandlers.java b/src/main/java/me/kavin/piped/server/handlers/PlaylistHandlers.java index 6b358b1..1b35814 100644 --- a/src/main/java/me/kavin/piped/server/handlers/PlaylistHandlers.java +++ b/src/main/java/me/kavin/piped/server/handlers/PlaylistHandlers.java @@ -30,7 +30,8 @@ import static java.nio.charset.StandardCharsets.UTF_8; import static me.kavin.piped.consts.Constants.YOUTUBE_SERVICE; import static me.kavin.piped.consts.Constants.mapper; import static me.kavin.piped.utils.CollectionUtils.collectRelatedItems; -import static me.kavin.piped.utils.URLUtils.*; +import static me.kavin.piped.utils.URLUtils.getLastThumbnail; +import static me.kavin.piped.utils.URLUtils.substringYouTube; public class PlaylistHandlers { public static byte[] playlistResponse(String playlistId) throws Exception { diff --git a/src/main/java/me/kavin/piped/server/handlers/auth/FeedHandlers.java b/src/main/java/me/kavin/piped/server/handlers/auth/FeedHandlers.java index 34f1977..616c31a 100644 --- a/src/main/java/me/kavin/piped/server/handlers/auth/FeedHandlers.java +++ b/src/main/java/me/kavin/piped/server/handlers/auth/FeedHandlers.java @@ -1,6 +1,7 @@ package me.kavin.piped.server.handlers.auth; -import com.rometools.rome.feed.synd.*; +import com.rometools.rome.feed.synd.SyndEntry; +import com.rometools.rome.feed.synd.SyndFeed; import com.rometools.rome.io.FeedException; import com.rometools.rome.io.SyndFeedOutput; import jakarta.persistence.criteria.CriteriaBuilder; diff --git a/src/main/java/me/kavin/piped/utils/ChannelHelpers.java b/src/main/java/me/kavin/piped/utils/ChannelHelpers.java index b20f363..ae08a1e 100644 --- a/src/main/java/me/kavin/piped/utils/ChannelHelpers.java +++ b/src/main/java/me/kavin/piped/utils/ChannelHelpers.java @@ -1,7 +1,10 @@ package me.kavin.piped.utils; import com.rometools.modules.mediarss.MediaEntryModuleImpl; -import com.rometools.modules.mediarss.types.*; +import com.rometools.modules.mediarss.types.MediaContent; +import com.rometools.modules.mediarss.types.Metadata; +import com.rometools.modules.mediarss.types.PlayerReference; +import com.rometools.modules.mediarss.types.Thumbnail; import com.rometools.rome.feed.synd.*; import me.kavin.piped.consts.Constants; import me.kavin.piped.utils.obj.db.Channel; diff --git a/src/main/java/me/kavin/piped/utils/PlaylistHelpers.java b/src/main/java/me/kavin/piped/utils/PlaylistHelpers.java index f5ea3ea..e68be4f 100644 --- a/src/main/java/me/kavin/piped/utils/PlaylistHelpers.java +++ b/src/main/java/me/kavin/piped/utils/PlaylistHelpers.java @@ -1,9 +1,8 @@ package me.kavin.piped.utils; import me.kavin.piped.utils.obj.db.Playlist; -import org.hibernate.Session; - import me.kavin.piped.utils.obj.db.User; +import org.hibernate.Session; public class PlaylistHelpers { public static Playlist getUserPlaylist(Session s, User user, String playlistId) throws IllegalArgumentException { diff --git a/src/main/java/me/kavin/piped/utils/VideoHelpers.java b/src/main/java/me/kavin/piped/utils/VideoHelpers.java index a89c413..1ba540f 100644 --- a/src/main/java/me/kavin/piped/utils/VideoHelpers.java +++ b/src/main/java/me/kavin/piped/utils/VideoHelpers.java @@ -6,7 +6,6 @@ import me.kavin.piped.consts.Constants; import me.kavin.piped.utils.obj.db.Video; import org.apache.commons.lang3.StringUtils; import org.hibernate.StatelessSession; -import org.schabi.newpipe.extractor.services.youtube.extractors.YoutubeStreamExtractor; import org.schabi.newpipe.extractor.stream.StreamExtractor; import org.schabi.newpipe.extractor.stream.StreamInfo; import org.schabi.newpipe.extractor.stream.StreamInfoItem;