Compare commits

..

No commits in common. "e7cba4703ccf2101dae8993a238faa1496baf478" and "12f8b8ffd09ae49afbfcf2e98dc9de469f9419f7" have entirely different histories.

8 changed files with 60 additions and 78 deletions

117
package-lock.json generated
View file

@ -9,13 +9,13 @@
"version": "1.0.0", "version": "1.0.0",
"license": "AGPL-3.0-only", "license": "AGPL-3.0-only",
"dependencies": { "dependencies": {
"@chriscdn/promise-semaphore": "^3.0.1", "@chriscdn/promise-semaphore": "^2.0.10",
"@cloudrac3r/pug": "^4.0.4", "@cloudrac3r/pug": "^4.0.4",
"@iconify-json/iconoir": "^1.2.7", "@iconify-json/iconoir": "^1.2.7",
"@iconify/utils": "^2.3.0", "@iconify/utils": "^2.3.0",
"@stackoverflow/stacks": "^2.7.3", "@stackoverflow/stacks": "^2.7.3",
"@types/node": "^20.17.27", "@types/node": "^20.17.27",
"better-sqlite3": "^12.2.0", "better-sqlite3": "^11.9.1",
"domino": "^2.1.6", "domino": "^2.1.6",
"h3": "^1.15.1", "h3": "^1.15.1",
"heatsync": "^2.8.1", "heatsync": "^2.8.1",
@ -87,9 +87,9 @@
} }
}, },
"node_modules/@chriscdn/promise-semaphore": { "node_modules/@chriscdn/promise-semaphore": {
"version": "3.0.1", "version": "2.0.10",
"resolved": "https://registry.npmjs.org/@chriscdn/promise-semaphore/-/promise-semaphore-3.0.1.tgz", "resolved": "https://registry.npmjs.org/@chriscdn/promise-semaphore/-/promise-semaphore-2.0.10.tgz",
"integrity": "sha512-fVlCnoYE4hDzpcYRPtmN7dmcpmd2zxyPWjyfjIKI9Y+gsI7rwZSkjtuwMi8HFtlkSmNh8L7Zr37hdqeL13sYrw==", "integrity": "sha512-NagoHAZEYISDYYprsHe+x2BEcD6GKhTpEreI8BM1qgtHOtCS3lbwRvvTQxzAxU8JVSmw7ep/ROLv3Ng/MPcMHg==",
"license": "MIT" "license": "MIT"
}, },
"node_modules/@cloudrac3r/pug": { "node_modules/@cloudrac3r/pug": {
@ -137,10 +137,9 @@
"integrity": "sha512-eGeIqNOQpXoPAIP7tC1+1Yc1yl1xnwYqg+3mzqxyrbE5pg5YFBZcA6YoTiByJB6DKAEsiWtl6tjTJS4IYtbB7A==" "integrity": "sha512-eGeIqNOQpXoPAIP7tC1+1Yc1yl1xnwYqg+3mzqxyrbE5pg5YFBZcA6YoTiByJB6DKAEsiWtl6tjTJS4IYtbB7A=="
}, },
"node_modules/@iconify-json/iconoir": { "node_modules/@iconify-json/iconoir": {
"version": "1.2.9", "version": "1.2.7",
"resolved": "https://registry.npmjs.org/@iconify-json/iconoir/-/iconoir-1.2.9.tgz", "resolved": "https://registry.npmjs.org/@iconify-json/iconoir/-/iconoir-1.2.7.tgz",
"integrity": "sha512-TXcx8mnxuZ0Weq104HwXZFPI0mlJzKjoy4nE20B803+Jrt7g2u4uc2iCGyHKpdqXVws3KaMTMDmY4yExy9Z+Qw==", "integrity": "sha512-UDlx2WeWHqopfKRsjOta6fn/KkOhF0MmI2AxoYfakqtMLlznkTnrtY9QVuXZzsbvk+Gyavq2L39VjhcxGbt+LA==",
"license": "MIT",
"dependencies": { "dependencies": {
"@iconify/types": "*" "@iconify/types": "*"
} }
@ -184,12 +183,11 @@
} }
}, },
"node_modules/@types/node": { "node_modules/@types/node": {
"version": "20.19.11", "version": "20.17.27",
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.19.11.tgz", "resolved": "https://registry.npmjs.org/@types/node/-/node-20.17.27.tgz",
"integrity": "sha512-uug3FEEGv0r+jrecvUUpbY8lLisvIjg6AAic6a2bSP5OEOLeJsDSnvhCDov7ipFFMXS3orMpzlmi0ZcuGkBbow==", "integrity": "sha512-U58sbKhDrthHlxHRJw7ZLiLDZGmAUOZUbpw0S6nL27sYUdhvgBLCRu/keSd6qcTsfArd1sRFCCBxzWATGr/0UA==",
"license": "MIT",
"dependencies": { "dependencies": {
"undici-types": "~6.21.0" "undici-types": "~6.19.2"
} }
}, },
"node_modules/acorn": { "node_modules/acorn": {
@ -244,17 +242,13 @@
] ]
}, },
"node_modules/better-sqlite3": { "node_modules/better-sqlite3": {
"version": "12.2.0", "version": "11.9.1",
"resolved": "https://registry.npmjs.org/better-sqlite3/-/better-sqlite3-12.2.0.tgz", "resolved": "https://registry.npmjs.org/better-sqlite3/-/better-sqlite3-11.9.1.tgz",
"integrity": "sha512-eGbYq2CT+tos1fBwLQ/tkBt9J5M3JEHjku4hbvQUePCckkvVf14xWj+1m7dGoK81M/fOjFT7yM9UMeKT/+vFLQ==", "integrity": "sha512-Ba0KR+Fzxh2jDRhdg6TSH0SJGzb8C0aBY4hR8w8madIdIzzC6Y1+kx5qR6eS1Z+Gy20h6ZU28aeyg0z1VIrShQ==",
"hasInstallScript": true, "hasInstallScript": true,
"license": "MIT",
"dependencies": { "dependencies": {
"bindings": "^1.5.0", "bindings": "^1.5.0",
"prebuild-install": "^7.1.1" "prebuild-install": "^7.1.1"
},
"engines": {
"node": "20.x || 22.x || 23.x || 24.x"
} }
}, },
"node_modules/bindings": { "node_modules/bindings": {
@ -328,10 +322,9 @@
"integrity": "sha512-+W7VmiVINB+ywl1HGXJXmrqkOhpKrIiVZV6tQuV54ZyQC7MMuBt81Vc336GMLoHBq5hV/F9eXgt5Mnx0Rha5Fg==" "integrity": "sha512-+W7VmiVINB+ywl1HGXJXmrqkOhpKrIiVZV6tQuV54ZyQC7MMuBt81Vc336GMLoHBq5hV/F9eXgt5Mnx0Rha5Fg=="
}, },
"node_modules/crossws": { "node_modules/crossws": {
"version": "0.3.5", "version": "0.3.4",
"resolved": "https://registry.npmjs.org/crossws/-/crossws-0.3.5.tgz", "resolved": "https://registry.npmjs.org/crossws/-/crossws-0.3.4.tgz",
"integrity": "sha512-ojKiDvcmByhwa8YYqbQI/hg7MEU0NC03+pSdEq4ZUnZR9xXpwk7E43SMNGkn+JxJGPFtNvQ48+vV2p+P1ml5PA==", "integrity": "sha512-uj0O1ETYX1Bh6uSgktfPvwDiPYGQ3aI4qVsaC/LWpkIzGj1nUYm5FK3K+t11oOlpN01lGbprFCH4wBlKdJjVgw==",
"license": "MIT",
"dependencies": { "dependencies": {
"uncrypto": "^0.1.3" "uncrypto": "^0.1.3"
} }
@ -380,10 +373,9 @@
"integrity": "sha512-mEQCMmwJu317oSz8CwdIOdwf3xMif1ttiM8LTufzc3g6kR+9Pe236twL8j3IYT1F7GfRgGcW6MWxzZjLIkuHIg==" "integrity": "sha512-mEQCMmwJu317oSz8CwdIOdwf3xMif1ttiM8LTufzc3g6kR+9Pe236twL8j3IYT1F7GfRgGcW6MWxzZjLIkuHIg=="
}, },
"node_modules/destr": { "node_modules/destr": {
"version": "2.0.5", "version": "2.0.3",
"resolved": "https://registry.npmjs.org/destr/-/destr-2.0.5.tgz", "resolved": "https://registry.npmjs.org/destr/-/destr-2.0.3.tgz",
"integrity": "sha512-ugFTXCtDZunbzasqBxrK93Ik/DRYsO6S/fedkWEMKqt04xZ4csmnmwGDBAb07QWNaGMAmnTIemsYZCksjATwsA==", "integrity": "sha512-2N3BOUU4gYMpTP24s5rF5iP7BDr7uNTCs4ozw3kf/eKfvWSIu93GEBi5m427YoyJoeOzQ5smuu4nNAPGb8idSQ=="
"license": "MIT"
}, },
"node_modules/detect-libc": { "node_modules/detect-libc": {
"version": "2.0.3", "version": "2.0.3",
@ -451,27 +443,25 @@
} }
}, },
"node_modules/h3": { "node_modules/h3": {
"version": "1.15.4", "version": "1.15.1",
"resolved": "https://registry.npmjs.org/h3/-/h3-1.15.4.tgz", "resolved": "https://registry.npmjs.org/h3/-/h3-1.15.1.tgz",
"integrity": "sha512-z5cFQWDffyOe4vQ9xIqNfCZdV4p//vy6fBnr8Q1AWnVZ0teurKMG66rLj++TKwKPUP3u7iMUvrvKaEUiQw2QWQ==", "integrity": "sha512-+ORaOBttdUm1E2Uu/obAyCguiI7MbBvsLTndc3gyK3zU+SYLoZXlyCP9Xgy0gikkGufFLTZXCXD6+4BsufnmHA==",
"license": "MIT",
"dependencies": { "dependencies": {
"cookie-es": "^1.2.2", "cookie-es": "^1.2.2",
"crossws": "^0.3.5", "crossws": "^0.3.3",
"defu": "^6.1.4", "defu": "^6.1.4",
"destr": "^2.0.5", "destr": "^2.0.3",
"iron-webcrypto": "^1.2.1", "iron-webcrypto": "^1.2.1",
"node-mock-http": "^1.0.2", "node-mock-http": "^1.0.0",
"radix3": "^1.1.2", "radix3": "^1.1.2",
"ufo": "^1.6.1", "ufo": "^1.5.4",
"uncrypto": "^0.1.3" "uncrypto": "^0.1.3"
} }
}, },
"node_modules/heatsync": { "node_modules/heatsync": {
"version": "2.8.2", "version": "2.8.1",
"resolved": "https://registry.npmjs.org/heatsync/-/heatsync-2.8.2.tgz", "resolved": "https://registry.npmjs.org/heatsync/-/heatsync-2.8.1.tgz",
"integrity": "sha512-zO5ivWP1NYoYmngdqVxzeQGX2Q68rfLkXKbO8Dhcguj5eS2eBDVpcWPh3+KCQagM7xYP5QVzvrUryWDu4mt6Eg==", "integrity": "sha512-BipRCTh6jqndV5FsebdJFQHRKb5J4ecVA7Kqv0gktb/MorrEwgTEoTNSITjEK59heGyP+QnTSj6LyJDFsnVqvQ==",
"license": "MIT",
"dependencies": { "dependencies": {
"backtracker": "^4.0.0" "backtracker": "^4.0.0"
}, },
@ -480,10 +470,9 @@
} }
}, },
"node_modules/htmx.org": { "node_modules/htmx.org": {
"version": "2.0.6", "version": "2.0.4",
"resolved": "https://registry.npmjs.org/htmx.org/-/htmx.org-2.0.6.tgz", "resolved": "https://registry.npmjs.org/htmx.org/-/htmx.org-2.0.4.tgz",
"integrity": "sha512-7ythjYneGSk3yCHgtCnQeaoF+D+o7U2LF37WU3O0JYv3gTZSicdEFiI/Ai/NJyC5ZpYJWMpUb11OC5Lr6AfAqA==", "integrity": "sha512-HLxMCdfXDOJirs3vBZl/ZLoY+c7PfM4Ahr2Ad4YXh6d22T5ltbTXFFkpx9Tgb2vvmWFMbIc3LqN2ToNkZJvyYQ=="
"license": "0BSD"
}, },
"node_modules/ieee754": { "node_modules/ieee754": {
"version": "1.2.1", "version": "1.2.1",
@ -640,10 +629,9 @@
} }
}, },
"node_modules/node-mock-http": { "node_modules/node-mock-http": {
"version": "1.0.2", "version": "1.0.0",
"resolved": "https://registry.npmjs.org/node-mock-http/-/node-mock-http-1.0.2.tgz", "resolved": "https://registry.npmjs.org/node-mock-http/-/node-mock-http-1.0.0.tgz",
"integrity": "sha512-zWaamgDUdo9SSLw47we78+zYw/bDr5gH8pH7oRRs8V3KmBtu8GLgGIbV2p/gRPd3LWpEOpjQj7X1FOU3VFMJ8g==", "integrity": "sha512-0uGYQ1WQL1M5kKvGRXWQ3uZCHtLTO8hln3oBjIusM75WoesZ909uQJs/Hb946i2SS+Gsrhkaa6iAO17jRIv6DQ=="
"license": "MIT"
}, },
"node_modules/object-assign": { "node_modules/object-assign": {
"version": "4.1.1", "version": "4.1.1",
@ -915,10 +903,9 @@
} }
}, },
"node_modules/tar-fs": { "node_modules/tar-fs": {
"version": "2.1.3", "version": "2.1.2",
"resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.3.tgz", "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.2.tgz",
"integrity": "sha512-090nwYJDmlhwFwEW3QQl+vaNnxsO2yVsd45eTKRBzSzu+hlb1w2K9inVq5b0ngXuLVqQ4ApvsUHHnu/zQNkWAg==", "integrity": "sha512-EsaAXwxmx8UB7FRKqeozqEPop69DXcmYwTQwXvyAPF352HJsPdkVhvTaDPYqfNgruveJIJy3TA2l+2zj8LJIJA==",
"license": "MIT",
"dependencies": { "dependencies": {
"chownr": "^1.1.1", "chownr": "^1.1.1",
"mkdirp-classic": "^0.5.2", "mkdirp-classic": "^0.5.2",
@ -963,22 +950,19 @@
} }
}, },
"node_modules/ufo": { "node_modules/ufo": {
"version": "1.6.1", "version": "1.5.4",
"resolved": "https://registry.npmjs.org/ufo/-/ufo-1.6.1.tgz", "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.5.4.tgz",
"integrity": "sha512-9a4/uxlTWJ4+a5i0ooc1rU7C7YOw3wT+UGqdeNNHWnOF9qcMBgLRS+4IYUqbczewFx4mLEig6gawh7X6mFlEkA==", "integrity": "sha512-UsUk3byDzKd04EyoZ7U4DOlxQaD14JUKQl6/P7wiX4FNvUfm3XL246n9W5AmqwW5RSFJ27NAuM0iLscAOYUiGQ=="
"license": "MIT"
}, },
"node_modules/uncrypto": { "node_modules/uncrypto": {
"version": "0.1.3", "version": "0.1.3",
"resolved": "https://registry.npmjs.org/uncrypto/-/uncrypto-0.1.3.tgz", "resolved": "https://registry.npmjs.org/uncrypto/-/uncrypto-0.1.3.tgz",
"integrity": "sha512-Ql87qFHB3s/De2ClA9e0gsnS6zXG27SkTiSJwjCc9MebbfapQfuPzumMIUMi38ezPZVNFcHI9sUIepeQfw8J8Q==", "integrity": "sha512-Ql87qFHB3s/De2ClA9e0gsnS6zXG27SkTiSJwjCc9MebbfapQfuPzumMIUMi38ezPZVNFcHI9sUIepeQfw8J8Q=="
"license": "MIT"
}, },
"node_modules/undici-types": { "node_modules/undici-types": {
"version": "6.21.0", "version": "6.19.8",
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz", "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz",
"integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==", "integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw=="
"license": "MIT"
}, },
"node_modules/util-deprecate": { "node_modules/util-deprecate": {
"version": "1.0.2", "version": "1.0.2",
@ -1019,10 +1003,9 @@
"integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ=="
}, },
"node_modules/zod": { "node_modules/zod": {
"version": "3.25.76", "version": "3.24.2",
"resolved": "https://registry.npmjs.org/zod/-/zod-3.25.76.tgz", "resolved": "https://registry.npmjs.org/zod/-/zod-3.24.2.tgz",
"integrity": "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==", "integrity": "sha512-lY7CDW43ECgW9u1TcT3IoXHflywfVqDYze4waEz812jR/bZ8FHDsl7pFQoSZTz5N+2NqRXs8GBwnAwo3ZNxqhQ==",
"license": "MIT",
"funding": { "funding": {
"url": "https://github.com/sponsors/colinhacks" "url": "https://github.com/sponsors/colinhacks"
} }

View file

@ -10,13 +10,13 @@
"author": "", "author": "",
"license": "AGPL-3.0-only", "license": "AGPL-3.0-only",
"dependencies": { "dependencies": {
"@chriscdn/promise-semaphore": "^3.0.1", "@chriscdn/promise-semaphore": "^2.0.10",
"@cloudrac3r/pug": "^4.0.4", "@cloudrac3r/pug": "^4.0.4",
"@iconify-json/iconoir": "^1.2.7", "@iconify-json/iconoir": "^1.2.7",
"@iconify/utils": "^2.3.0", "@iconify/utils": "^2.3.0",
"@stackoverflow/stacks": "^2.7.3", "@stackoverflow/stacks": "^2.7.3",
"@types/node": "^20.17.27", "@types/node": "^20.17.27",
"better-sqlite3": "^12.2.0", "better-sqlite3": "^11.9.1",
"domino": "^2.1.6", "domino": "^2.1.6",
"h3": "^1.15.1", "h3": "^1.15.1",
"heatsync": "^2.8.1", "heatsync": "^2.8.1",

View file

@ -1,4 +1,3 @@
title= `⯈ ${item_title} | ${band_name} | BC Explorer`
#player #player
.s-sidebarwidget(style="overflow: hidden") .s-sidebarwidget(style="overflow: hidden")
div(style="margin: -1px; margin-bottom: -11px").ps-relative div(style="margin: -1px; margin-bottom: -11px").ps-relative

View file

@ -75,6 +75,6 @@ router.get("/:account/collection-stats", defineEventHandler(async event => {
router.post("/api/settings/currency", defineEventHandler(async event => { router.post("/api/settings/currency", defineEventHandler(async event => {
const {currency, account} = await readValidatedBody(event, schema.schema.postCurrency.parse) const {currency, account} = await readValidatedBody(event, schema.schema.postCurrency.parse)
setCookie(event, "bcex-currency", currency, {secure: true, httpOnly: true, maxAge: 2147483647, sameSite: "lax"}) setCookie(event, "bcex-currency", currency)
return pugSync.render(event, "includes/collection-stats.pug", {account, currency}) return pugSync.render(event, "includes/collection-stats.pug", {account, currency})
})) }))

View file

@ -126,7 +126,7 @@ router.post("/api/load-collection", defineEventHandler(async event => {
const {account} = await readValidatedBody(event, schema.schema.account.parse) const {account} = await readValidatedBody(event, schema.schema.account.parse)
try { try {
const result = await loadCollection(account) const result = await loadCollection(account)
setCookie(event, "accounts", (getCookie(event, "accounts") || "").split("|").concat(account).join("|"), {secure: true, httpOnly: true, maxAge: 2147483647, sameSite: "lax"}) setCookie(event, "accounts", (getCookie(event, "accounts") || "").split("|").concat(account).join("|"))
return pugSync.render(event, "collection-loaded.pug", result) return pugSync.render(event, "collection-loaded.pug", result)
} catch (cause) { } catch (cause) {
const error = cause instanceof UserVisibleError ? cause const error = cause instanceof UserVisibleError ? cause

View file

@ -2,7 +2,8 @@
const domino = require("domino") const domino = require("domino")
const {getValidatedQuery, readValidatedBody, defineEventHandler} = require("h3") const {getValidatedQuery, readValidatedBody, defineEventHandler} = require("h3")
const {Semaphore} = require("@chriscdn/promise-semaphore") /** @type {import("@chriscdn/promise-semaphore")["default"]} */ // @ts-ignore
const Semaphore = require("@chriscdn/promise-semaphore")
const {sync, db, router} = require("../passthrough") const {sync, db, router} = require("../passthrough")

View file

@ -1,6 +1,6 @@
// @ts-check // @ts-check
const {sync, router, select} = require("../passthrough") const {sync, router} = require("../passthrough")
const {defineEventHandler} = require("h3") const {defineEventHandler} = require("h3")
const {getValidatedRouterParams} = require("h3") const {getValidatedRouterParams} = require("h3")
@ -11,8 +11,7 @@ const pugSync = sync.require("../pug-sync")
const schema = sync.require("./schema") const schema = sync.require("./schema")
const play = defineEventHandler(async event => { const play = defineEventHandler(async event => {
const params = await getValidatedRouterParams(event, schema.schema.play.parse) const locals = await getValidatedRouterParams(event, schema.schema.play.parse)
const locals = {...params, ...select("item", ["item_title", "band_name"], {item_id: params.item_id}).get()}
return pugSync.render(event, "player.pug", locals) return pugSync.render(event, "player.pug", locals)
}) })

View file

@ -11,14 +11,14 @@ const schema = sync.require("./schema")
router.post("/api/settings/inline-player", defineEventHandler(async event => { router.post("/api/settings/inline-player", defineEventHandler(async event => {
const {inline_player} = await readValidatedBody(event, schema.schema.inlinePlayer.parse) const {inline_player} = await readValidatedBody(event, schema.schema.inlinePlayer.parse)
setCookie(event, "bcex-inline-player-disabled", String(!inline_player), {secure: true, httpOnly: true, maxAge: 2147483647, sameSite: "lax"}) setCookie(event, "bcex-inline-player-disabled", String(!inline_player))
setResponseHeader(event, "HX-Refresh", "true") setResponseHeader(event, "HX-Refresh", "true")
return null return null
})) }))
router.post("/api/settings/location-tags", defineEventHandler(async event => { router.post("/api/settings/location-tags", defineEventHandler(async event => {
const {location_tags, account, filter, filter_field, filter_fuzzy} = await readValidatedBody(event, schema.schema.locationTags.parse) const {location_tags, account, filter, filter_field, filter_fuzzy} = await readValidatedBody(event, schema.schema.locationTags.parse)
setCookie(event, "bcex-location-tags", location_tags, {secure: true, httpOnly: true, maxAge: 2147483647, sameSite: "lax"}) setCookie(event, "bcex-location-tags", location_tags)
const params = new URLSearchParams({arrange: "tag", shape: "grid"}) const params = new URLSearchParams({arrange: "tag", shape: "grid"})
if (filter) params.set("filter", filter) if (filter) params.set("filter", filter)
if (filter_field) params.set("filter_field", filter_field) if (filter_field) params.set("filter_field", filter_field)