mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-02-25 18:55:32 -06:00
More robust updateTorrentMetadata fn
This commit is contained in:
parent
5d62c3c1cb
commit
c5fa9fe70e
@ -142,6 +142,11 @@ async function createTorrentAndSetInfoHashFromPath (
|
||||
async function updateTorrentMetadata (videoOrPlaylist: MVideo | MStreamingPlaylistVideo, videoFile: MVideoFile) {
|
||||
const video = extractVideo(videoOrPlaylist)
|
||||
|
||||
if (!videoFile.torrentFilename) {
|
||||
logger.error(`Video file ${videoFile.filename} of video ${video.uuid} doesn't have a torrent file, skipping torrent metadata update`)
|
||||
return
|
||||
}
|
||||
|
||||
const oldTorrentPath = join(CONFIG.STORAGE.TORRENTS_DIR, videoFile.torrentFilename)
|
||||
|
||||
if (!await pathExists(oldTorrentPath)) {
|
||||
|
Loading…
Reference in New Issue
Block a user