diff options
Diffstat (limited to 'server/models/video/video.ts')
-rw-r--r-- | server/models/video/video.ts | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/server/models/video/video.ts b/server/models/video/video.ts index 924f12a5e..7e9bb4db4 100644 --- a/server/models/video/video.ts +++ b/server/models/video/video.ts | |||
@@ -27,6 +27,7 @@ import { | |||
27 | import { getPrivaciesForFederation, isPrivacyForFederation, isStateForFederation } from '@server/helpers/video' | 27 | import { getPrivaciesForFederation, isPrivacyForFederation, isStateForFederation } from '@server/helpers/video' |
28 | import { LiveManager } from '@server/lib/live/live-manager' | 28 | import { LiveManager } from '@server/lib/live/live-manager' |
29 | import { removeHLSFileObjectStorage, removeHLSObjectStorage, removeWebTorrentObjectStorage } from '@server/lib/object-storage' | 29 | import { removeHLSFileObjectStorage, removeHLSObjectStorage, removeWebTorrentObjectStorage } from '@server/lib/object-storage' |
30 | import { tracer } from '@server/lib/opentelemetry/tracing' | ||
30 | import { getHLSDirectory, getHLSRedundancyDirectory } from '@server/lib/paths' | 31 | import { getHLSDirectory, getHLSRedundancyDirectory } from '@server/lib/paths' |
31 | import { VideoPathManager } from '@server/lib/video-path-manager' | 32 | import { VideoPathManager } from '@server/lib/video-path-manager' |
32 | import { getServerActor } from '@server/models/application/application' | 33 | import { getServerActor } from '@server/models/application/application' |
@@ -1535,6 +1536,8 @@ export class VideoModel extends Model<Partial<AttributesOnly<VideoModel>>> { | |||
1535 | options: BuildVideosListQueryOptions, | 1536 | options: BuildVideosListQueryOptions, |
1536 | countVideos = true | 1537 | countVideos = true |
1537 | ): Promise<ResultList<VideoModel>> { | 1538 | ): Promise<ResultList<VideoModel>> { |
1539 | const span = tracer.startSpan('peertube.VideoModel.getAvailableForApi') | ||
1540 | |||
1538 | function getCount () { | 1541 | function getCount () { |
1539 | if (countVideos !== true) return Promise.resolve(undefined) | 1542 | if (countVideos !== true) return Promise.resolve(undefined) |
1540 | 1543 | ||
@@ -1554,6 +1557,8 @@ export class VideoModel extends Model<Partial<AttributesOnly<VideoModel>>> { | |||
1554 | 1557 | ||
1555 | const [ count, rows ] = await Promise.all([ getCount(), getModels() ]) | 1558 | const [ count, rows ] = await Promise.all([ getCount(), getModels() ]) |
1556 | 1559 | ||
1560 | span.end() | ||
1561 | |||
1557 | return { | 1562 | return { |
1558 | data: rows, | 1563 | data: rows, |
1559 | total: count | 1564 | total: count |