v3: consistent tabs url across app, maxy small fixes
All checks were successful
Build and Publish Docker Image / build-and-push (push) Successful in 42s
All checks were successful
Build and Publish Docker Image / build-and-push (push) Successful in 42s
This commit is contained in:
@@ -10,6 +10,7 @@ import {
|
||||
} from "../model/interfaces.ts";
|
||||
import {
|
||||
db,
|
||||
DUMP_COLUMNS_ALIASED,
|
||||
dumpRowToApi,
|
||||
isDumpRow,
|
||||
isPlaylistRow,
|
||||
@@ -28,9 +29,6 @@ import {
|
||||
import { makeSlug, UUID_RE } from "../lib/slugify.ts";
|
||||
import { linkAttachments } from "./attachment-service.ts";
|
||||
|
||||
const DUMP_SELECT_COLS =
|
||||
"id, kind, title, slug, comment, user_id, created_at, updated_at, url, rich_content, file_name, file_mime, file_size, vote_count, is_private, custom_thumbnail_mime";
|
||||
|
||||
const PLAYLIST_SELECT = `p.*, u.username as owner_username,
|
||||
(SELECT COUNT(*) FROM playlist_dumps pd WHERE pd.playlist_id = p.id) as dump_count
|
||||
FROM playlists p LEFT JOIN users u ON u.id = p.user_id`;
|
||||
@@ -91,12 +89,11 @@ export function getPlaylist(
|
||||
throw new APIException(APIErrorCode.NOT_FOUND, 404, "Playlist not found");
|
||||
}
|
||||
|
||||
const dumpCols = DUMP_SELECT_COLS.split(", ").map((c) => `d.${c}`).join(", ");
|
||||
const isOwner = requestingUserId === playlist.userId;
|
||||
|
||||
// For public playlists (or when viewed by non-owner), filter out private dumps
|
||||
const rows = db.prepare(
|
||||
`SELECT ${dumpCols},
|
||||
`SELECT ${DUMP_COLUMNS_ALIASED},
|
||||
(SELECT COUNT(*) FROM comments WHERE dump_id = d.id AND deleted = 0) as comment_count
|
||||
FROM dumps d
|
||||
INNER JOIN playlist_dumps pd ON d.id = pd.dump_id
|
||||
|
||||
Reference in New Issue
Block a user