From 38a3ccc7f8ad0ea94362b58c732af7c387ab46be Mon Sep 17 00:00:00 2001 From: kontrollanten <6680299+kontrollanten@users.noreply.github.com> Date: Mon, 24 Oct 2022 14:48:03 +0200 Subject: feat: show contained playlists under My videos (#5125) * feat: show contained playlists under My videos closes #4769 * refactor(server): remove unused types * fixes after code review * fix(client/video-miniature): add to playlist * fix(server/user/me): shortUUID response * Revert "fix(client/video-miniature): add to playlist" This reverts commit f1a0412391c7e2370b87df2594c9fe3f39a40ddc. * fix(client/PlaylistService): caching * Revert "fix(server/user/me): shortUUID response" This reverts commit e3f1ee4e335739b895bced938540c003df24af73. * Fix fetching playlists Co-authored-by: Chocobozzz --- server/controllers/api/users/my-video-playlists.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'server/controllers') diff --git a/server/controllers/api/users/my-video-playlists.ts b/server/controllers/api/users/my-video-playlists.ts index f55ea2ec4..715717610 100644 --- a/server/controllers/api/users/my-video-playlists.ts +++ b/server/controllers/api/users/my-video-playlists.ts @@ -1,3 +1,4 @@ +import { uuidToShort } from '@shared/extra-utils' import express from 'express' import { VideosExistInPlaylists } from '../../../../shared/models/videos/playlist/video-exist-in-playlist.model' import { asyncMiddleware, authenticate } from '../../../middlewares' @@ -24,7 +25,7 @@ async function doVideosInPlaylistExist (req: express.Request, res: express.Respo const videoIds = req.query.videoIds.map(i => parseInt(i + '', 10)) const user = res.locals.oauth.token.User - const results = await VideoPlaylistModel.listPlaylistIdsOf(user.Account.id, videoIds) + const results = await VideoPlaylistModel.listPlaylistSummariesOf(user.Account.id, videoIds) const existObject: VideosExistInPlaylists = {} @@ -37,6 +38,8 @@ async function doVideosInPlaylistExist (req: express.Request, res: express.Respo existObject[element.videoId].push({ playlistElementId: element.id, playlistId: result.id, + playlistDisplayName: result.name, + playlistShortUUID: uuidToShort(result.uuid), startTimestamp: element.startTimestamp, stopTimestamp: element.stopTimestamp }) -- cgit v1.2.3