From 5c4864dba7e8baea2de19131bf8d674fd2b008f6 Mon Sep 17 00:00:00 2001 From: Kavin <20838718+FireMasterK@users.noreply.github.com> Date: Sat, 10 Jun 2023 22:07:21 +0100 Subject: [PATCH] Fix short content type extraction. --- src/main/java/me/kavin/piped/utils/VideoHelpers.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/me/kavin/piped/utils/VideoHelpers.java b/src/main/java/me/kavin/piped/utils/VideoHelpers.java index 175f8ab..a305aa0 100644 --- a/src/main/java/me/kavin/piped/utils/VideoHelpers.java +++ b/src/main/java/me/kavin/piped/utils/VideoHelpers.java @@ -66,7 +66,7 @@ public class VideoHelpers { } } - public static void handleNewVideo(StreamExtractor extractor, long time, me.kavin.piped.utils.obj.db.Channel channel) throws ParsingException { + public static void handleNewVideo(StreamExtractor extractor, long time, me.kavin.piped.utils.obj.db.Channel channel) throws Exception { if (channel == null) channel = DatabaseHelper.getChannelFromId( @@ -82,8 +82,10 @@ public class VideoHelpers { try (StatelessSession s = DatabaseSessionFactory.createStatelessSession()) { if (!DatabaseHelper.doesVideoExist(s, extractor.getId())) { + boolean isShort = extractor.isShortFormContent() || isShort(extractor.getId()); + Video video = new Video(extractor.getId(), extractor.getName(), extractor.getViewCount(), extractor.getLength(), - Math.max(infoTime, time), extractor.getThumbnailUrl(), extractor.isShortFormContent(), channel); + Math.max(infoTime, time), extractor.getThumbnailUrl(), isShort, channel); var tr = s.beginTransaction(); try {