1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-03 09:49:20 +02:00

Migrate to pnpm

This commit is contained in:
Chocobozzz 2025-09-11 11:17:58 +02:00
parent bbc1afada5
commit 2cffe3d6ac
No known key found for this signature in database
GPG key ID: 583A612D890159BE
47 changed files with 23797 additions and 23122 deletions

View file

@ -1,18 +1,16 @@
import { mapToJSON } from '@server/helpers/core-utils.js'
import { logger, loggerTagsFactory } from '@server/helpers/logger.js'
import { MStreamingPlaylistVideo } from '@server/types/models/index.js'
import { writeJson } from 'fs-extra/esm'
import { rename } from 'fs/promises'
import PQueue from 'p-queue'
import { basename } from 'path'
import { mapToJSON } from '@server/helpers/core-utils.js'
import { logger, loggerTagsFactory } from '@server/helpers/logger.js'
import { MStreamingPlaylistVideo } from '@server/types/models/index.js'
import { buildSha256Segment } from '../hls.js'
import { storeHLSFileFromPath } from '../object-storage/index.js'
import { JFWriteOptions } from 'jsonfile'
const lTags = loggerTagsFactory('live')
class LiveSegmentShaStore {
private readonly segmentsSha256 = new Map<string, string>()
private readonly videoUUID: string
@ -62,7 +60,9 @@ class LiveSegmentShaStore {
if (!this.segmentsSha256.has(segmentName)) {
logger.warn(
'Unknown segment in live segment hash store for video %s and segment %s.',
this.videoUUID, segmentPath, lTags(this.videoUUID)
this.videoUUID,
segmentPath,
lTags(this.videoUUID)
)
return
}
@ -77,7 +77,8 @@ class LiveSegmentShaStore {
logger.debug(`Writing segment sha JSON ${this.sha256Path} of ${this.videoUUID} on disk.`, lTags(this.videoUUID))
// Atomic write: use rename instead of move that is not atomic
await writeJson(this.sha256PathTMP, mapToJSON(this.segmentsSha256), { flush: true } as JFWriteOptions) // FIXME: jsonfile typings
// FIXME: jsonfile typings
await (writeJson(this.sha256PathTMP, mapToJSON(this.segmentsSha256), { flush: true } as any) as unknown as Promise<void>)
await rename(this.sha256PathTMP, this.sha256Path)
if (this.sendToObjectStorage) {