add review functionality

This commit is contained in:
endigma 2023-08-31 13:21:04 -03:00
parent 4478941bfd
commit 48656dd915
Signed by: endigma
GPG Key ID: 915867AD1D297D9F
2 changed files with 1142 additions and 598 deletions

File diff suppressed because one or more lines are too long

View File

@ -40,6 +40,7 @@ export def "updateMods" [] {
upsert link {|row| upsert link {|row|
$"https://modrinth.com/mod/($row.slug)" $"https://modrinth.com/mod/($row.slug)"
} | } |
where review |
group-by kind | group-by kind |
items {| k, v | items {| k, v |
$v | save $"out/($k).json" -f $v | save $"out/($k).json" -f
@ -69,7 +70,13 @@ export def review [...review: string] {
open all.json | open all.json |
upsert review { upsert review {
if $in.slug in $review { if $in.slug in $review {
true if ("review" in $in) {
($in.review | into bool) or true
} else {
true
}
} else {
$in.review
} }
} | } |
save all.json -f save all.json -f
@ -82,13 +89,19 @@ export def conflicts [mod: string, ...conflicts: string] {
open all.json | open all.json |
upsert conflicts { upsert conflicts {
if $in.slug == $mod { if $in.slug == $mod {
$conflicts if ("conflicts" in $in) {
$in.conflicts | append $conflicts | uniq
} else {
$conflicts
}
} else if $in.slug in $conflicts { } else if $in.slug in $conflicts {
if ("conflicts" in $in) { if ("conflicts" in $in) {
$in.conflicts | append $mod | uniq $in.conflicts | append $mod | uniq
} else { } else {
[$mod] [$mod]
} }
} else {
$in.conflicts
} }
} | } |
save all.json -f save all.json -f