diff --git a/src/main/java/com/hlab/yanalyst/domain/channel/ChannelVideoRepository.java b/src/main/java/com/hlab/yanalyst/domain/channel/ChannelVideoRepository.java index 70fbf35..90dc484 100644 --- a/src/main/java/com/hlab/yanalyst/domain/channel/ChannelVideoRepository.java +++ b/src/main/java/com/hlab/yanalyst/domain/channel/ChannelVideoRepository.java @@ -50,13 +50,14 @@ public interface ChannelVideoRepository extends JpaRepository 'EXCLUDED' " - + "and (v.durationSec is null or v.durationSec > 65) " + + "and (v.durationSec is null or v.durationSec > 180) " + "and (cast(:publishedAfter as timestamp) is null or v.publishedAt >= :publishedAfter) " + "and (:person is null or v.matchedPerson = :person) " + "and (:hideWorked = false or v.interestStatus = 'NEW') " diff --git a/src/main/java/com/hlab/yanalyst/domain/channel/PersonPicks.java b/src/main/java/com/hlab/yanalyst/domain/channel/PersonPicks.java index d27a651..7e3d2d6 100644 --- a/src/main/java/com/hlab/yanalyst/domain/channel/PersonPicks.java +++ b/src/main/java/com/hlab/yanalyst/domain/channel/PersonPicks.java @@ -24,6 +24,13 @@ public final class PersonPicks { "performance video", "mv", "m/v", "lyric video", "cover", "커버" ); + /** + * 이 길이 이하는 쇼츠로 보고 버린다. 유튜브 쇼츠가 최대 3분(180초)까지 허용되어 + * {@link VideoMetrics#isShorts}의 65초 컷으로는 1~3분짜리 쇼츠가 통과한다. + * 어차피 3분 이하는 자를 원본으로도 부족하다. + */ + public static final int SHORTS_MAX_SEC = 180; + private PersonPicks() {} /** 음악방송 무대·직캠·커버 영상인가(제목 기준). */ @@ -63,7 +70,7 @@ public final class PersonPicks { for (Found f : found) { if (f == null || f.videoId() == null || f.videoId().isBlank()) continue; // 쇼츠 제외 — 인물 추적의 목적은 자를 원본(롱폼)을 찾는 것 - if (f.durationSec() == null || VideoMetrics.isShorts(f.durationSec())) continue; + if (f.durationSec() == null || f.durationSec() <= SHORTS_MAX_SEC) continue; if (f.ytChannelId() != null && excludeChannels != null && excludeChannels.contains(f.ytChannelId())) continue; if (publishedAfter != null && f.publishedAt() != null