feat(users/Profpatsch/whatcd-resolver): trivial artist page
Change-Id: I2c0dd1a3f300b46fec8b38c310dc08ea2f5f2492 Reviewed-on: https://cl.tvl.fyi/c/depot/+/11648 Autosubmit: Profpatsch <mail@profpatsch.de> Reviewed-by: Profpatsch <mail@profpatsch.de> Tested-by: BuildkiteCI
This commit is contained in:
parent
bad074465a
commit
87d7c6198d
1 changed files with 16 additions and 1 deletions
|
@ -208,6 +208,16 @@ htmlUi = do
|
||||||
jsonld <- httpGetJsonLd (qry.target)
|
jsonld <- httpGetJsonLd (qry.target)
|
||||||
pure $ renderJsonld jsonld
|
pure $ renderJsonld jsonld
|
||||||
),
|
),
|
||||||
|
( "artist",
|
||||||
|
respond.html $ \span -> do
|
||||||
|
qry <-
|
||||||
|
parseQueryArgs
|
||||||
|
span
|
||||||
|
( label @"dbId"
|
||||||
|
<$> (singleQueryArgument "db_id" Field.utf8)
|
||||||
|
)
|
||||||
|
pure $ [fmt|Artist ID: {qry.dbId}|]
|
||||||
|
),
|
||||||
( "autorefresh",
|
( "autorefresh",
|
||||||
respond.plain $ do
|
respond.plain $ do
|
||||||
qry <-
|
qry <-
|
||||||
|
@ -455,11 +465,16 @@ getBestTorrentsTable = do
|
||||||
fresh
|
fresh
|
||||||
& foldMap
|
& foldMap
|
||||||
( \b -> do
|
( \b -> do
|
||||||
|
let artistLink :: Text = [fmt|/artist?db_id={b.groupId}|]
|
||||||
[hsx|
|
[hsx|
|
||||||
<tr>
|
<tr>
|
||||||
<td>{localTorrent b}</td>
|
<td>{localTorrent b}</td>
|
||||||
<td>{Html.toHtml @Int b.groupId}</td>
|
<td>{Html.toHtml @Int b.groupId}</td>
|
||||||
<td>{Html.toHtml @Text b.torrentGroupJson.artist}</td>
|
<td>
|
||||||
|
<a href={artistLink}>
|
||||||
|
{Html.toHtml @Text b.torrentGroupJson.artist}
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
<td>{Html.toHtml @Text b.torrentGroupJson.groupName}</td>
|
<td>{Html.toHtml @Text b.torrentGroupJson.groupName}</td>
|
||||||
<td>{Html.toHtml @Int b.seedingWeight}</td>
|
<td>{Html.toHtml @Int b.seedingWeight}</td>
|
||||||
<td><details hx-trigger="toggle once" hx-post="snips/redacted/torrentDataJson" hx-vals={Enc.encToBytesUtf8 $ Enc.object [("torrent-id", Enc.int b.torrentId)]}></details></td>
|
<td><details hx-trigger="toggle once" hx-post="snips/redacted/torrentDataJson" hx-vals={Enc.encToBytesUtf8 $ Enc.object [("torrent-id", Enc.int b.torrentId)]}></details></td>
|
||||||
|
|
Loading…
Add table
Reference in a new issue