Update absId to id

This commit is contained in:
Cutch 2025-11-25 09:21:26 -05:00
parent d5cd4f7944
commit 94e13014ed
4 changed files with 6 additions and 6 deletions

View file

@ -574,7 +574,7 @@ class LibraryItem extends Model {
let jsonObject = {}
if (this.mediaType === 'book') {
jsonObject = {
absId: this.id,
id: this.id,
tags: mediaExpanded.tags || [],
chapters: mediaExpanded.chapters?.map((c) => ({ ...c })) || [],
title: mediaExpanded.title,
@ -599,7 +599,7 @@ class LibraryItem extends Model {
}
} else {
jsonObject = {
absId: this.id,
id: this.id,
tags: mediaExpanded.tags || [],
title: mediaExpanded.title,
author: mediaExpanded.author,

View file

@ -821,7 +821,7 @@ class BookScanner {
const metadataFilePath = Path.join(metadataPath, `metadata.${global.ServerSettings.metadataFileFormat}`)
const jsonObject = {
absId: libraryItem.id,
id: libraryItem.id,
tags: libraryItem.media.tags || [],
chapters: libraryItem.media.chapters?.map((c) => ({ ...c })) || [],
title: libraryItem.media.title,

View file

@ -717,10 +717,10 @@ async function findLibraryItemByItemToMetadata(fullPath, isSingleMedia) {
if (!metadataText) return null
const abMetadata = abmetadataGenerator.parseJson(metadataText) || {}
// check if metadata id exists in the database
const existingLibraryItem = await Database.libraryItemModel.getExpandedById(abMetadata.absId)
const existingLibraryItem = await Database.libraryItemModel.getExpandedById(abMetadata.id)
if (existingLibraryItem) {
Logger.debug(`[LibraryScanner] Found library item with metadata id matching one of "${abMetadata.absId}" at path "${existingLibraryItem.path}"`)
Logger.debug(`[LibraryScanner] Found library item with metadata id matching one of "${abMetadata.id}" at path "${existingLibraryItem.path}"`)
for (const { metadata } of existingLibraryItem.getLibraryFiles())
if (await fs.pathExists(metadata.path)) {

View file

@ -421,7 +421,7 @@ class PodcastScanner {
const metadataFilePath = Path.join(metadataPath, `metadata.${global.ServerSettings.metadataFileFormat}`)
const jsonObject = {
absId: libraryItem.id,
id: libraryItem.id,
tags: libraryItem.media.tags || [],
title: libraryItem.media.title,
author: libraryItem.media.author,