mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-04-20 11:08:03 +08:00
mod: hot: filter like ratio
Closes #108 Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -43,12 +43,7 @@ class RecommendFilter {
|
||||
if (videoItem.duration > 0 && videoItem.duration < minDurationForRcmd) {
|
||||
return true;
|
||||
}
|
||||
if (videoItem.stat.view is int &&
|
||||
videoItem.stat.view > -1 &&
|
||||
videoItem.stat.like is int &&
|
||||
videoItem.stat.like > -1 &&
|
||||
videoItem.stat.like * 100 <
|
||||
minLikeRatioForRecommend * videoItem.stat.view) {
|
||||
if (filterLikeRatio(videoItem.stat.like, videoItem.stat.view)) {
|
||||
return true;
|
||||
}
|
||||
if (filterTitle(videoItem.title)) {
|
||||
@@ -57,6 +52,17 @@ class RecommendFilter {
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool filterLikeRatio(like, view) {
|
||||
if (view is int &&
|
||||
view > -1 &&
|
||||
like is int &&
|
||||
like > -1 &&
|
||||
like * 100 < minLikeRatioForRecommend * view) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool filterTitle(String title, {bool? isFollowed}) {
|
||||
if (exemptFilterForFollowed && isFollowed == true) {
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user