diff options
author | kontrollanten <6680299+kontrollanten@users.noreply.github.com> | 2022-10-24 14:48:03 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-24 14:48:03 +0200 |
commit | 38a3ccc7f8ad0ea94362b58c732af7c387ab46be (patch) | |
tree | ccbd200c4b95d0fcfa56b7d5fc3c9490887187b1 /server/controllers/api | |
parent | 01a3c07a7913891d4830797403b3865d53f0af61 (diff) | |
download | PeerTube-38a3ccc7f8ad0ea94362b58c732af7c387ab46be.tar.gz PeerTube-38a3ccc7f8ad0ea94362b58c732af7c387ab46be.tar.zst PeerTube-38a3ccc7f8ad0ea94362b58c732af7c387ab46be.zip |
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 <me@florianbigard.com>
Diffstat (limited to 'server/controllers/api')
-rw-r--r-- | server/controllers/api/users/my-video-playlists.ts | 5 |
1 files changed, 4 insertions, 1 deletions
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 @@ | |||
1 | import { uuidToShort } from '@shared/extra-utils' | ||
1 | import express from 'express' | 2 | import express from 'express' |
2 | import { VideosExistInPlaylists } from '../../../../shared/models/videos/playlist/video-exist-in-playlist.model' | 3 | import { VideosExistInPlaylists } from '../../../../shared/models/videos/playlist/video-exist-in-playlist.model' |
3 | import { asyncMiddleware, authenticate } from '../../../middlewares' | 4 | import { asyncMiddleware, authenticate } from '../../../middlewares' |
@@ -24,7 +25,7 @@ async function doVideosInPlaylistExist (req: express.Request, res: express.Respo | |||
24 | const videoIds = req.query.videoIds.map(i => parseInt(i + '', 10)) | 25 | const videoIds = req.query.videoIds.map(i => parseInt(i + '', 10)) |
25 | const user = res.locals.oauth.token.User | 26 | const user = res.locals.oauth.token.User |
26 | 27 | ||
27 | const results = await VideoPlaylistModel.listPlaylistIdsOf(user.Account.id, videoIds) | 28 | const results = await VideoPlaylistModel.listPlaylistSummariesOf(user.Account.id, videoIds) |
28 | 29 | ||
29 | const existObject: VideosExistInPlaylists = {} | 30 | const existObject: VideosExistInPlaylists = {} |
30 | 31 | ||
@@ -37,6 +38,8 @@ async function doVideosInPlaylistExist (req: express.Request, res: express.Respo | |||
37 | existObject[element.videoId].push({ | 38 | existObject[element.videoId].push({ |
38 | playlistElementId: element.id, | 39 | playlistElementId: element.id, |
39 | playlistId: result.id, | 40 | playlistId: result.id, |
41 | playlistDisplayName: result.name, | ||
42 | playlistShortUUID: uuidToShort(result.uuid), | ||
40 | startTimestamp: element.startTimestamp, | 43 | startTimestamp: element.startTimestamp, |
41 | stopTimestamp: element.stopTimestamp | 44 | stopTimestamp: element.stopTimestamp |
42 | }) | 45 | }) |