From 8dac21b4444b97910ea8eb67a799cfb92eb7f572 Mon Sep 17 00:00:00 2001 From: Profpatsch Date: Mon, 7 Aug 2023 15:58:06 +0200 Subject: [PATCH] feat(users/Profpatsch/whatcd-resolver): Prefer remasters MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Usually remasters just … sound better. Thus let’s give them a boost in the selection score. In case they are horrible they should have significantly less people seeding them and less snatches than their originals anyway (maybe the multiplier should be 1.5 or 2 instead?) Change-Id: I6817091f42b7bcb75eaf57a6aa635b5ba468f99e Reviewed-on: https://cl.tvl.fyi/c/depot/+/9014 Reviewed-by: Profpatsch Tested-by: BuildkiteCI Autosubmit: Profpatsch --- .../Profpatsch/whatcd-resolver/src/WhatcdResolver.hs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/users/Profpatsch/whatcd-resolver/src/WhatcdResolver.hs b/users/Profpatsch/whatcd-resolver/src/WhatcdResolver.hs index e37521b51..1c47f2501 100644 --- a/users/Profpatsch/whatcd-resolver/src/WhatcdResolver.hs +++ b/users/Profpatsch/whatcd-resolver/src/WhatcdResolver.hs @@ -825,8 +825,16 @@ migrate = do t.torrent_id, t.torrent_group, -- the seeding weight is used to find the best torrent in a group. - ( (full_json_result->'seeders')::integer*3 - + (full_json_result->'snatches')::integer) + ( ((full_json_result->'seeders')::integer*3 + + (full_json_result->'snatches')::integer + ) + -- prefer remasters by multiplying them with 3 + * (CASE + WHEN full_json_result->>'remasterTitle' ILIKE '%remaster%' + THEN 3 + ELSE 1 + END) + ) AS seeding_weight, t.full_json_result, t.torrent_file,