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