mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-05-17 00:41:30 +00:00
Merge 6f19bb1e0c into 47ea6b5092
This commit is contained in:
commit
2ec3255676
4 changed files with 188 additions and 4 deletions
|
|
@ -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]}`)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue