Set published date from youtube data

its not clear how consistent the formatting is on these dates,
the one i tested seems like it was a UTC formatted dd M, yyyy string
This commit is contained in:
Jackson Harper
2024-03-20 13:10:35 +08:00
parent 1435ccee63
commit 014ccb1eae

View File

@ -388,6 +388,11 @@ export const processYouTubeVideo = async (
duration = video.duration
}
if (video.uploadDate && !Number.isNaN(Date.parse(video.uploadDate))) {
needsUpdate = true
libraryItem.publishedAt = new Date(video.uploadDate)
}
if (
await findFeatureByName(FeatureName.YouTubeTranscripts, jobData.userId)
) {