mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-12-19 18:29:37 +00:00
Add podcast support to metadata embedding tools
This commit is contained in:
parent
fd4932cdbb
commit
69b6c0c79a
6 changed files with 176 additions and 39 deletions
|
|
@ -426,6 +426,38 @@ function getFFMetadataObject(libraryItem, audioFilesLength) {
|
|||
|
||||
module.exports.getFFMetadataObject = getFFMetadataObject
|
||||
|
||||
/**
|
||||
* Build ffmetadata key-value pairs for a single podcast episode based on the library item and episode.
|
||||
*
|
||||
* @param {import('../models/LibraryItem')} libraryItem
|
||||
* @param {import('../models/PodcastEpisode')} podcastEpisode
|
||||
* @returns {Object}
|
||||
*/
|
||||
function getPodcastEpisodeFFMetadataObject(libraryItem, podcastEpisode) {
|
||||
const podcast = libraryItem.media
|
||||
const ffmetadata = {
|
||||
title: podcastEpisode.title || podcast.title,
|
||||
artist: podcast.author || podcast.title,
|
||||
album_artist: podcast.author || podcast.title,
|
||||
album: podcast.title,
|
||||
genre: Array.isArray(podcast.genres) && podcast.genres.length ? podcast.genres.join('; ') : undefined,
|
||||
date: podcast.releasedate,
|
||||
comment: podcastEpisode.description,
|
||||
description: podcastEpisode.description,
|
||||
language: podcast.language,
|
||||
'itunes-id': podcast.itunesId,
|
||||
track: podcastEpisode.episode || undefined,
|
||||
disc: podcastEpisode.season || undefined,
|
||||
}
|
||||
|
||||
Object.keys(ffmetadata).forEach((key) => {
|
||||
if (ffmetadata[key] === undefined || ffmetadata[key] === null || ffmetadata[key] === '') delete ffmetadata[key]
|
||||
})
|
||||
return ffmetadata
|
||||
}
|
||||
|
||||
module.exports.getPodcastEpisodeFFMetadataObject = getPodcastEpisodeFFMetadataObject
|
||||
|
||||
/**
|
||||
* Merges audio files into a single output file using FFmpeg.
|
||||
*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue