mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-04 10:19:35 +02:00
Add channel collaborators feature
This commit is contained in:
parent
94e55dfc6c
commit
135d5c7363
185 changed files with 5457 additions and 2631 deletions
|
@ -2,10 +2,9 @@ import { remove } from 'fs-extra/esm'
|
|||
import { logger } from '../../../helpers/logger.js'
|
||||
import memoizee from 'memoizee'
|
||||
|
||||
type GetFilePathResult = { isOwned: boolean, path: string, downloadName?: string } | undefined
|
||||
|
||||
export abstract class AbstractSimpleFileCache <T> {
|
||||
type GetFilePathResult = { isLocal: boolean, path: string, downloadName?: string } | undefined
|
||||
|
||||
export abstract class AbstractSimpleFileCache<T> {
|
||||
getFilePath: (params: T) => Promise<GetFilePathResult>
|
||||
|
||||
abstract getFilePathImpl (params: T): Promise<GetFilePathResult>
|
||||
|
@ -19,7 +18,7 @@ export abstract class AbstractSimpleFileCache <T> {
|
|||
max,
|
||||
promise: true,
|
||||
dispose: (result?: GetFilePathResult) => {
|
||||
if (result && result.isOwned !== true) {
|
||||
if (result && result.isLocal !== true) {
|
||||
remove(result.path)
|
||||
.then(() => logger.debug('%s removed from %s', result.path, this.constructor.name))
|
||||
.catch(err => logger.error('Cannot remove %s from cache %s.', result.path, this.constructor.name, { err }))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue