adding playlist id when playlist downloading
This commit is contained in:
parent
ce7ce93c9c
commit
2949b33286
|
@ -160,7 +160,7 @@ exports.playlist = async (ws, req) => {
|
|||
ws.send(`DATA - Uploaded ${video.title}`)
|
||||
fs.unlinkSync(`./videos/${id}.webm`)
|
||||
|
||||
await websocket.createDatabaseVideo(id, videoUrl)
|
||||
await websocket.createDatabaseVideo(id, videoUrl, playlistId)
|
||||
ws.send(`DATA - Created video page for ${video.title}`)
|
||||
} else {
|
||||
ws.send(`DATA - Failed to find file for ${video.title}. Going to next video in the playlist`)
|
||||
|
|
|
@ -12,7 +12,7 @@ datasource db {
|
|||
|
||||
model videos {
|
||||
uuid String @id @default(uuid())
|
||||
id String
|
||||
id String @unique
|
||||
title String
|
||||
description String
|
||||
thumbnail String
|
||||
|
|
|
@ -4,7 +4,7 @@ const prisma = new PrismaClient()
|
|||
const metadata = require('./metadata.js')
|
||||
const upload = require('./upload.js')
|
||||
|
||||
async function createDatabaseVideo(id, videoUrl) {
|
||||
async function createDatabaseVideo(id, videoUrl, playlistId) {
|
||||
const instance = await metadata.getInstance()
|
||||
const data = await metadata.getVideoMetadata(instance, id)
|
||||
const uploaderAvatar = await upload.uploadImage((data.uploaderUrl).replace('/channel/', ''), data.uploaderAvatar)
|
||||
|
@ -22,7 +22,8 @@ async function createDatabaseVideo(id, videoUrl) {
|
|||
channel: data.uploader,
|
||||
channelId: (data.uploaderUrl).replace('/channel/', ''),
|
||||
channelAvatar: uploaderAvatar,
|
||||
channelVerified: data.uploaderVerified
|
||||
channelVerified: data.uploaderVerified,
|
||||
playlist: playlistId
|
||||
}
|
||||
})
|
||||
|
||||
|
|
Loading…
Reference in New Issue