This commit is contained in:
Jeferson 'Shin' Leite Borges 2026-05-06 13:51:21 +02:00 committed by GitHub
commit 2ec3255676
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 188 additions and 4 deletions

View file

@ -5,6 +5,7 @@ const { LogLevel } = require('../utils/constants')
const { parseOverdriveMediaMarkersAsChapters } = require('../utils/parsers/parseOverdriveMediaMarkers')
const parseNameString = require('../utils/parsers/parseNameString')
const parseSeriesString = require('../utils/parsers/parseSeriesString')
const parseDate = require('../utils/parsers/parseDate')
const LibraryItem = require('../models/LibraryItem')
const AudioFile = require('../objects/files/AudioFile')
@ -431,6 +432,10 @@ class AudioFileScanner {
tag: 'tagDate',
key: 'pubDate'
},
{
tag: 'tagDate',
key: 'date'
},
{
tag: 'tagDisc',
key: 'season'
@ -462,9 +467,9 @@ class AudioFileScanner {
if (value && typeof value === 'string') {
value = value.trim() // Trim whitespace
if (mapping.key === 'pubDate') {
const pubJsDate = new Date(value)
if (pubJsDate && !isNaN(pubJsDate)) {
if ((mapping.key === 'pubDate' || mapping.key === 'date') && !podcastEpisode.pubDate) {
const pubJsDate = parseDate.parse(value)
if (pubJsDate) {
podcastEpisode.publishedAt = pubJsDate.valueOf()
podcastEpisode.pubDate = value
scanLogger.addLog(LogLevel.DEBUG, `Mapping metadata to key ${tagToUse} => ${mapping.key}: ${podcastEpisode[mapping.key]}`)