|
@@ -144,12 +144,17 @@ public class RankService implements InitializingBean {
|
|
|
public static List<Content> contentSourceTypeFilter(String strategy, List<Content> pool, Integer index) {
|
|
|
Integer sourceType = getStrategyPoolSourceType(strategy, index);
|
|
|
Integer videoSourceType = PublishPlanInputSourceTypesEnum.longArticleVideoPoolSource.getVal();
|
|
|
+ List<Content> videoPool = pool.stream().filter(o -> Objects.equals(o.getSourceType(), videoSourceType)).collect(Collectors.toList());
|
|
|
+ List<Content> otherPool = pool.stream().filter(o ->!Objects.equals(o.getSourceType(), videoSourceType)).collect(Collectors.toList());
|
|
|
if (Objects.nonNull(sourceType) && sourceType.equals(videoSourceType)) {
|
|
|
- pool = pool.stream().filter(o -> Objects.equals(o.getSourceType(), videoSourceType)).collect(Collectors.toList());
|
|
|
+ if (CollectionUtils.isNotEmpty(videoPool)) {
|
|
|
+ return videoPool;
|
|
|
+ } else {
|
|
|
+ return otherPool;
|
|
|
+ }
|
|
|
} else {
|
|
|
- pool = pool.stream().filter(o -> !Objects.equals(o.getSourceType(), videoSourceType)).collect(Collectors.toList());
|
|
|
+ return otherPool;
|
|
|
}
|
|
|
- return pool;
|
|
|
}
|
|
|
|
|
|
public static void commonAdd38Content(RankParam param, List<Content> result, String[] contentPools,
|