fix(users/Profpatsch/whatcd-resolver): fix torrent link

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>
This commit is contained in:
Profpatsch 2024-06-03 00:17:40 +02:00 committed by clbot
parent 8bb27c98b0
commit ea89572f98
2 changed files with 2 additions and 2 deletions

View file

@ -68,7 +68,7 @@ redactedGetTorrentFile dat = inSpan' "Redacted Get Torrent File" $ \span -> do
) )
httpTorrent span req httpTorrent span req
mkRedactedTorrentLink :: Arg "torrentId" Int -> Text mkRedactedTorrentLink :: Arg "torrentGroupId" Int -> Text
mkRedactedTorrentLink torrentId = [fmt|https://redacted.ch/torrents.php?id={torrentId.unArg}|] mkRedactedTorrentLink torrentId = [fmt|https://redacted.ch/torrents.php?id={torrentId.unArg}|]
exampleSearch :: (MonadThrow m, MonadLogger m, MonadPostgres m, MonadOtel m) => m (Transaction m ()) exampleSearch :: (MonadThrow m, MonadLogger m, MonadPostgres m, MonadOtel m) => m (Transaction m ())

View file

@ -541,7 +541,7 @@ getBestTorrentsTable artistFilter = do
{artists} {artists}
</td> </td>
<td> <td>
<a href={mkRedactedTorrentLink (Arg b.torrentId)}> <a href={mkRedactedTorrentLink (Arg b.groupId)} target="_blank">
{Html.toHtml @Text b.torrentGroupJson.groupName} {Html.toHtml @Text b.torrentGroupJson.groupName}
</a> </a>
</td> </td>