|
@@ -97,24 +97,13 @@ public class VideoCityFilterService {
|
|
|
return videoIds;
|
|
|
}
|
|
|
|
|
|
- videoIds.removeIf(videoId -> {
|
|
|
- if (videoId == null || videoId <= 0L) {
|
|
|
- return true;
|
|
|
- }
|
|
|
- for (Long tagId : tagIdList) {
|
|
|
- if (tagId == null || tagId <= 0L) {
|
|
|
- continue;
|
|
|
- }
|
|
|
- Set<Long> videosByTag = videoTagCache.get(cityCode);
|
|
|
- if (videosByTag == null || videosByTag.isEmpty()) {
|
|
|
- continue;
|
|
|
- }
|
|
|
- if (videosByTag.contains(videoId)) {
|
|
|
- return false;
|
|
|
- }
|
|
|
- }
|
|
|
- return true;
|
|
|
- });
|
|
|
+ Set<Long> riskCityVideoIdSet = videoTagCache.get(cityCode);
|
|
|
+ if (riskCityVideoIdSet == null || riskCityVideoIdSet.isEmpty()) {
|
|
|
+ return videoIds;
|
|
|
+ }
|
|
|
+
|
|
|
+ videoIds.removeIf(riskCityVideoIdSet::contains);
|
|
|
+
|
|
|
return videoIds;
|
|
|
}
|
|
|
|