chore(users/Profpatsch/whatcd-resolver): remove onlyDownloaded
It was unused. Change-Id: Ib5fa9bf9b97fb5635161dfa2fbed3bf05cc5a585 Reviewed-on: https://cl.tvl.fyi/c/depot/+/13224 Reviewed-by: Profpatsch <mail@profpatsch.de> Tested-by: BuildkiteCI
This commit is contained in:
parent
cf80c75a69
commit
2d522a9321
2 changed files with 3 additions and 8 deletions
|
|
@ -620,8 +620,7 @@ getTorrentById dat = do
|
|||
>>= ensureSingleRow
|
||||
|
||||
data GetBestTorrentsFilter = GetBestTorrentsFilter
|
||||
{ onlyDownloaded :: Bool,
|
||||
onlyArtist :: Maybe (Label "artistRedactedId" Int),
|
||||
{ onlyArtist :: Maybe (Label "artistRedactedId" Int),
|
||||
onlyTheseTorrents :: Maybe ([Label "torrentId" Int]),
|
||||
limitResults :: Maybe Natural
|
||||
}
|
||||
|
|
@ -640,10 +639,7 @@ getBestTorrents opts = do
|
|||
FROM
|
||||
redacted.torrents
|
||||
WHERE
|
||||
-- onlyDownloaded
|
||||
((NOT ?::bool) OR torrent_file IS NOT NULL)
|
||||
-- filter by artist id
|
||||
AND
|
||||
(?::bool OR (to_jsonb(?::int) <@ (jsonb_path_query_array(full_json_result, '$.artists[*].id'))))
|
||||
-- filter by torrent ids
|
||||
AND
|
||||
|
|
@ -683,8 +679,7 @@ getBestTorrents opts = do
|
|||
let (onlyTheseTorrentsB, onlyTheseTorrents) = case opts.onlyTheseTorrents of
|
||||
Nothing -> (True, PGArray [])
|
||||
Just a -> (False, a <&> (.torrentId) & PGArray)
|
||||
( opts.onlyDownloaded :: Bool,
|
||||
onlyArtistB :: Bool,
|
||||
( onlyArtistB :: Bool,
|
||||
onlyArtistId :: Int,
|
||||
onlyTheseTorrentsB :: Bool,
|
||||
onlyTheseTorrents,
|
||||
|
|
|
|||
|
|
@ -846,7 +846,7 @@ getBestTorrentsData opts filters = inSpan' "get torrents table data" $ \span ->
|
|||
onlyTheseTorrents & doIfJust (\a -> addAttribute span "torrent-filter.ids" (a <&> (getLabel @"torrentId") & showToText & Otel.toAttribute))
|
||||
let limitResults = getField @"limitResults" opts
|
||||
|
||||
let getBest = getBestTorrents GetBestTorrentsFilter {onlyDownloaded = False, ..}
|
||||
let getBest = getBestTorrents GetBestTorrentsFilter {..}
|
||||
bestStale :: [TorrentData ()] <- getBest
|
||||
(statusInfo, transmissionStatus) <-
|
||||
getAndUpdateTransmissionTorrentsStatus
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue