about summary refs log tree commit diff
path: root/users/Profpatsch
diff options
context:
space:
mode:
authorProfpatsch <mail@profpatsch.de>2024-06-02T22·17+0200
committerclbot <clbot@tvl.fyi>2024-06-03T14·55+0000
commitea89572f98bf259f489d5f1c29f84ca6c31c25fa (patch)
tree42eb90386c4143f263783ea40a790e551a003bd6 /users/Profpatsch
parent8bb27c98b0a191d4cae76bdc79f0d5167e9968ba (diff)
fix(users/Profpatsch/whatcd-resolver): fix torrent link r/8208
The redacted URL needs the torrent group id to go to the album page,
not the torrent id.

Also open the external link in a separate tab.

Change-Id: Ie6d73cb02137855bb388859d2800968cd56ece49
Reviewed-on: https://cl.tvl.fyi/c/depot/+/11745
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/Redacted.hs2
-rw-r--r--users/Profpatsch/whatcd-resolver/src/WhatcdResolver.hs2
2 files changed, 2 insertions, 2 deletions
diff --git a/users/Profpatsch/whatcd-resolver/src/Redacted.hs b/users/Profpatsch/whatcd-resolver/src/Redacted.hs
index b2cef8bc21..c8182a8cab 100644
--- a/users/Profpatsch/whatcd-resolver/src/Redacted.hs
+++ b/users/Profpatsch/whatcd-resolver/src/Redacted.hs
@@ -68,7 +68,7 @@ redactedGetTorrentFile dat = inSpan' "Redacted Get Torrent File" $ \span -> do
       )
   httpTorrent span req
 
-mkRedactedTorrentLink :: Arg "torrentId" Int -> Text
+mkRedactedTorrentLink :: Arg "torrentGroupId" Int -> Text
 mkRedactedTorrentLink torrentId = [fmt|https://redacted.ch/torrents.php?id={torrentId.unArg}|]
 
 exampleSearch :: (MonadThrow m, MonadLogger m, MonadPostgres m, MonadOtel m) => m (Transaction m ())
diff --git a/users/Profpatsch/whatcd-resolver/src/WhatcdResolver.hs b/users/Profpatsch/whatcd-resolver/src/WhatcdResolver.hs
index 83956902b7..65d84b684c 100644
--- a/users/Profpatsch/whatcd-resolver/src/WhatcdResolver.hs
+++ b/users/Profpatsch/whatcd-resolver/src/WhatcdResolver.hs
@@ -541,7 +541,7 @@ getBestTorrentsTable artistFilter = do
                     {artists}
                   </td>
                   <td>
-                    <a href={mkRedactedTorrentLink (Arg b.torrentId)}>
+                    <a href={mkRedactedTorrentLink (Arg b.groupId)} target="_blank">
                       {Html.toHtml @Text b.torrentGroupJson.groupName}
                     </a>
                   </td>