Spaces:
Running
Running
Update proxy/verification.js
Browse files- proxy/verification.js +9 -3
proxy/verification.js
CHANGED
|
@@ -87,7 +87,7 @@ function evaluateHealth(stream) {
|
|
| 87 |
else if (seeders > 0) seederScore = 30;
|
| 88 |
else seederScore = 10;
|
| 89 |
|
| 90 |
-
const score = Math.round((seederScore * 0.
|
| 91 |
return { score, seeders, resolutionScore };
|
| 92 |
}
|
| 93 |
|
|
@@ -153,13 +153,19 @@ export function runVerificationPipeline(streams) {
|
|
| 153 |
|
| 154 |
stream._verification = {
|
| 155 |
score: finalScore,
|
|
|
|
| 156 |
provider: extractProvider(stream)
|
| 157 |
};
|
| 158 |
return stream;
|
| 159 |
});
|
| 160 |
|
| 161 |
-
// Sort strictly by score
|
| 162 |
-
verifiedStreams.sort((a, b) =>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 163 |
|
| 164 |
// Deduplicate InfoHashes
|
| 165 |
const deduplicated = [];
|
|
|
|
| 87 |
else if (seeders > 0) seederScore = 30;
|
| 88 |
else seederScore = 10;
|
| 89 |
|
| 90 |
+
const score = Math.round((seederScore * 0.3) + (resolutionScore * 0.7));
|
| 91 |
return { score, seeders, resolutionScore };
|
| 92 |
}
|
| 93 |
|
|
|
|
| 153 |
|
| 154 |
stream._verification = {
|
| 155 |
score: finalScore,
|
| 156 |
+
resolutionScore: health.resolutionScore,
|
| 157 |
provider: extractProvider(stream)
|
| 158 |
};
|
| 159 |
return stream;
|
| 160 |
});
|
| 161 |
|
| 162 |
+
// Sort strictly by score, then by resolution as a tiebreaker
|
| 163 |
+
verifiedStreams.sort((a, b) => {
|
| 164 |
+
if (b._verification.score !== a._verification.score) {
|
| 165 |
+
return b._verification.score - a._verification.score;
|
| 166 |
+
}
|
| 167 |
+
return b._verification.resolutionScore - a._verification.resolutionScore;
|
| 168 |
+
});
|
| 169 |
|
| 170 |
// Deduplicate InfoHashes
|
| 171 |
const deduplicated = [];
|