mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-06 03:50:26 +02:00
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 commitf1a0412391
. * fix(client/PlaylistService): caching * Revert "fix(server/user/me): shortUUID response" This reverts commite3f1ee4e33
. * Fix fetching playlists Co-authored-by: Chocobozzz <me@florianbigard.com>
This commit is contained in:
parent
01a3c07a79
commit
38a3ccc7f8
14 changed files with 79 additions and 28 deletions
|
@ -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
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue