about summary refs log tree commit diff
path: root/users/Profpatsch
diff options
context:
space:
mode:
authorProfpatsch <mail@profpatsch.de>2023-08-07T13·58+0200
committerclbot <clbot@tvl.fyi>2023-08-07T14·03+0000
commit8dac21b4444b97910ea8eb67a799cfb92eb7f572 (patch)
tree5b7ee52178785214484f8386df430c9e5cd8cfe7 /users/Profpatsch
parent3e5a2ea57f9a25533b0a59c80a43014653cdddd1 (diff)
feat(users/Profpatsch/whatcd-resolver): Prefer remasters r/6467
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 <mail@profpatsch.de>
Tested-by: BuildkiteCI
Autosubmit: Profpatsch <mail@profpatsch.de>
Diffstat (limited to 'users/Profpatsch')
-rw-r--r--users/Profpatsch/whatcd-resolver/src/WhatcdResolver.hs12
1 files changed, 10 insertions, 2 deletions
diff --git a/users/Profpatsch/whatcd-resolver/src/WhatcdResolver.hs b/users/Profpatsch/whatcd-resolver/src/WhatcdResolver.hs
index e37521b51e..1c47f2501d 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,