chore: smaller docker image, simplification pass on environment variables, fix direct navigation without vite
All checks were successful
Build and Publish Docker Image / build-and-push (push) Successful in 46s
All checks were successful
Build and Publish Docker Image / build-and-push (push) Successful in 46s
This commit is contained in:
@@ -3,7 +3,7 @@ import type { RichContentProvider } from "../rich-content-service.ts";
|
||||
import { getDump } from "../dump-service.ts";
|
||||
import { getUserByUsername } from "../user-service.ts";
|
||||
import { getPlaylistById } from "../playlist-service.ts";
|
||||
import { BASE_URL } from "../../config.ts";
|
||||
import { PUBLIC_URL } from "../../config.ts";
|
||||
|
||||
const DUMP_RE = /^\/dumps\/([^/]+)$/;
|
||||
const USER_RE = /^\/users\/([^/]+)$/;
|
||||
@@ -31,7 +31,7 @@ export const selfProvider: RichContentProvider = {
|
||||
const dump = getDump(dumpMatch[1]);
|
||||
let thumbnailUrl: string | undefined;
|
||||
if (dump.kind === "file" && dump.fileMime?.startsWith("image/")) {
|
||||
thumbnailUrl = `${BASE_URL}/api/files/${dump.id}`;
|
||||
thumbnailUrl = `${PUBLIC_URL}/api/files/${dump.id}`;
|
||||
} else if (dump.richContent?.thumbnailUrl) {
|
||||
thumbnailUrl = dump.richContent.thumbnailUrl;
|
||||
}
|
||||
@@ -49,7 +49,7 @@ export const selfProvider: RichContentProvider = {
|
||||
if (userMatch) {
|
||||
const user = getUserByUsername(userMatch[1]);
|
||||
const thumbnailUrl = user.avatarMime
|
||||
? `${BASE_URL}/api/avatars/${user.id}`
|
||||
? `${PUBLIC_URL}/api/avatars/${user.id}`
|
||||
: undefined;
|
||||
return Promise.resolve({
|
||||
type: "generic",
|
||||
@@ -65,7 +65,7 @@ export const selfProvider: RichContentProvider = {
|
||||
if (playlistMatch) {
|
||||
const playlist = getPlaylistById(playlistMatch[1]);
|
||||
const thumbnailUrl = playlist.imageMime
|
||||
? `${BASE_URL}/api/playlists/${playlist.id}/image`
|
||||
? `${PUBLIC_URL}/api/playlists/${playlist.id}/image`
|
||||
: undefined;
|
||||
return Promise.resolve({
|
||||
type: "generic",
|
||||
|
||||
Reference in New Issue
Block a user