mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-04 02:09:37 +02:00
Add channel collaborators feature
This commit is contained in:
parent
94e55dfc6c
commit
135d5c7363
185 changed files with 5457 additions and 2631 deletions
|
@ -21,8 +21,8 @@ class VideoCaptionsSimpleFileCache extends AbstractSimpleFileCache<string> {
|
|||
const videoCaption = await VideoCaptionModel.loadWithVideoByFilename(filename)
|
||||
if (!videoCaption) return undefined
|
||||
|
||||
if (videoCaption.isOwned()) {
|
||||
return { isOwned: true, path: videoCaption.getFSFilePath() }
|
||||
if (videoCaption.isLocal()) {
|
||||
return { isLocal: true, path: videoCaption.getFSFilePath() }
|
||||
}
|
||||
|
||||
return this.loadRemoteFile(filename)
|
||||
|
@ -33,7 +33,7 @@ class VideoCaptionsSimpleFileCache extends AbstractSimpleFileCache<string> {
|
|||
const videoCaption = await VideoCaptionModel.loadWithVideoByFilename(key)
|
||||
if (!videoCaption) return undefined
|
||||
|
||||
if (videoCaption.isOwned()) throw new Error('Cannot load remote caption of owned video.')
|
||||
if (videoCaption.isLocal()) throw new Error('Cannot load remote caption of owned video.')
|
||||
|
||||
// Used to fetch the path
|
||||
const video = await VideoModel.loadFull(videoCaption.videoId)
|
||||
|
@ -45,7 +45,7 @@ class VideoCaptionsSimpleFileCache extends AbstractSimpleFileCache<string> {
|
|||
try {
|
||||
await doRequestAndSaveToFile(remoteUrl, destPath)
|
||||
|
||||
return { isOwned: false, path: destPath }
|
||||
return { isLocal: false, path: destPath }
|
||||
} catch (err) {
|
||||
logger.info('Cannot fetch remote caption file %s.', remoteUrl, { err })
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue