mirror of
https://github.com/TeamPiped/Piped-Backend.git
synced 2024-08-14 23:51:41 +00:00
Merge pull request #623 from TeamPiped/short-extraction
Fix short content type extraction.
This commit is contained in:
commit
5d316597e7
1 changed files with 4 additions and 2 deletions
|
@ -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)
|
if (channel == null)
|
||||||
channel = DatabaseHelper.getChannelFromId(
|
channel = DatabaseHelper.getChannelFromId(
|
||||||
|
@ -82,8 +82,10 @@ public class VideoHelpers {
|
||||||
try (StatelessSession s = DatabaseSessionFactory.createStatelessSession()) {
|
try (StatelessSession s = DatabaseSessionFactory.createStatelessSession()) {
|
||||||
if (!DatabaseHelper.doesVideoExist(s, extractor.getId())) {
|
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(),
|
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();
|
var tr = s.beginTransaction();
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Reference in a new issue