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:
parent
bbc1afada5
commit
2cffe3d6ac
47 changed files with 23797 additions and 23122 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue