aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-11-15 15:00:19 +0100
committerChocobozzz <me@florianbigard.com>2022-11-15 15:00:23 +0100
commit99b757488c077cee7d0ab89eeec181a7ee6290eb (patch)
tree307a3f39285f899e3ed616d92aae1bdd181178e0 /server/controllers/api
parent4638cd713dcdd007cd7f49b9a95fa62ac7823e7c (diff)
downloadPeerTube-99b757488c077cee7d0ab89eeec181a7ee6290eb.tar.gz
PeerTube-99b757488c077cee7d0ab89eeec181a7ee6290eb.tar.zst
PeerTube-99b757488c077cee7d0ab89eeec181a7ee6290eb.zip
Fix server lint
Diffstat (limited to 'server/controllers/api')
-rw-r--r--server/controllers/api/video-playlist.ts10
1 files changed, 8 insertions, 2 deletions
diff --git a/server/controllers/api/video-playlist.ts b/server/controllers/api/video-playlist.ts
index 67fac3751..f8a607170 100644
--- a/server/controllers/api/video-playlist.ts
+++ b/server/controllers/api/video-playlist.ts
@@ -4,6 +4,7 @@ import { scheduleRefreshIfNeeded } from '@server/lib/activitypub/playlists'
4import { Hooks } from '@server/lib/plugins/hooks' 4import { Hooks } from '@server/lib/plugins/hooks'
5import { getServerActor } from '@server/models/application/application' 5import { getServerActor } from '@server/models/application/application'
6import { MVideoPlaylistFull, MVideoPlaylistThumbnail, MVideoThumbnail } from '@server/types/models' 6import { MVideoPlaylistFull, MVideoPlaylistThumbnail, MVideoThumbnail } from '@server/types/models'
7import { forceNumber } from '@shared/core-utils'
7import { uuidToShort } from '@shared/extra-utils' 8import { uuidToShort } from '@shared/extra-utils'
8import { VideoPlaylistCreateResult, VideoPlaylistElementCreateResult } from '@shared/models' 9import { VideoPlaylistCreateResult, VideoPlaylistElementCreateResult } from '@shared/models'
9import { HttpStatusCode } from '../../../shared/models/http/http-error-codes' 10import { HttpStatusCode } from '../../../shared/models/http/http-error-codes'
@@ -46,7 +47,6 @@ import {
46import { AccountModel } from '../../models/account/account' 47import { AccountModel } from '../../models/account/account'
47import { VideoPlaylistModel } from '../../models/video/video-playlist' 48import { VideoPlaylistModel } from '../../models/video/video-playlist'
48import { VideoPlaylistElementModel } from '../../models/video/video-playlist-element' 49import { VideoPlaylistElementModel } from '../../models/video/video-playlist-element'
49import { forceNumber } from '@shared/core-utils'
50 50
51const reqThumbnailFile = createReqFiles([ 'thumbnailfile' ], MIMETYPES.IMAGE.MIMETYPE_EXT) 51const reqThumbnailFile = createReqFiles([ 'thumbnailfile' ], MIMETYPES.IMAGE.MIMETYPE_EXT)
52 52
@@ -425,7 +425,13 @@ async function reorderVideosPlaylist (req: express.Request, res: express.Respons
425 425
426 const endOldPosition = oldPosition + reorderLength - 1 426 const endOldPosition = oldPosition + reorderLength - 1
427 // Insert our reordered elements in their place (update) 427 // Insert our reordered elements in their place (update)
428 await VideoPlaylistElementModel.reassignPositionOf({ videoPlaylistId: videoPlaylist.id, firstPosition: oldPosition, endPosition: endOldPosition, newPosition, transaction: t }) 428 await VideoPlaylistElementModel.reassignPositionOf({
429 videoPlaylistId: videoPlaylist.id,
430 firstPosition: oldPosition,
431 endPosition: endOldPosition,
432 newPosition,
433 transaction: t
434 })
429 435
430 // Decrease positions of elements after the old position of our ordered elements (decrease) 436 // Decrease positions of elements after the old position of our ordered elements (decrease)
431 await VideoPlaylistElementModel.increasePositionOf(videoPlaylist.id, oldPosition, -reorderLength, t) 437 await VideoPlaylistElementModel.increasePositionOf(videoPlaylist.id, oldPosition, -reorderLength, t)