release to live!

This commit is contained in:
Holly Stubbs 2025-01-26 16:40:40 +00:00
parent 30ff3dbdcd
commit 5e130ed57e
Signed by: tgpholly
GPG key ID: B8583C4B7D18119E
5 changed files with 6 additions and 6 deletions

View file

@ -71,7 +71,7 @@ fastify.addHook("preHandler", (req, res, done) => {
return done();
} else {
const urlParts = req.url.split("/");
if (urlParts.length === 2 && urlParts[1].length === 16) {
if (urlParts.length === 2 && urlParts[1].length <= 16) {
let media = hashLookupCache.get(urlParts[1]) ?? null;
if (!media) {
media = await MediaService.GetByTag(urlParts[1]);

View file

@ -14,7 +14,7 @@
"updateCheck": "check-outdated",
"dev:legacy_node": "nodemon --watch './**/*.ts' ts-node index.ts",
"dev": "bun --watch index.ts",
"build": "tsc --build"
"build": "ncc build index.ts -o build"
},
"devDependencies": {
"@types/bun": "^1.2.0",

View file

@ -38,7 +38,7 @@ export default abstract class MediaRepo {
}
public static async SelectByUserHash(currentUserId: number, hash: string) {
const dbMedia = await Database.Instance.query("SELECT * FROM Media WHERE Hash = ? LIMIT 1", [hash]);
const dbMedia = await Database.Instance.query("SELECT * FROM Media WHERE UserId = ? AND Hash = ? LIMIT 1", [currentUserId, hash]);
if (dbMedia == null || dbMedia.length === 0) {
return null;
} else {

View file

@ -10,7 +10,7 @@
// Bundler mode
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
"allowImportingTsExtensions": false,
"verbatimModuleSyntax": true,
"noEmit": true,

View file

@ -14,13 +14,13 @@
<div class="row row-cols-1">
<% for (const upload of recentUploads) { %>
<div class="col">
<div class="row">
<div class="row flex-nowrap">
<div class="col-auto">
<% if (upload.MediaType.startsWith("image/")) { %>
<img src="<%= domains[upload.DomainId].HasHttps ? "https" : "http" %>://<%= domains[upload.DomainId].Domain %>/<%= upload.MediaTag %>" height="30" width="50">
<% } %>
</div>
<div class="col"><%= upload.FileName %></div>
<div class="col"><a href="<%= domains[upload.DomainId].HasHttps ? "https" : "http" %>://<%= domains[upload.DomainId].Domain %>/<%= upload.MediaTag %>" target="_blank"><%= upload.FileName %></a></div>
</div>
</div>
<% } %>