mirror of
https://github.com/kikootwo/ReadMeABook.git
synced 2026-06-05 05:40:10 +00:00
Add ASIN support to file organization and metadata
This update enhances audiobook file organization by including the ASIN in folder names and embedding it as a custom metadata tag in audio files (M4B/M4A/MP3). Documentation is updated to reflect the new folder naming convention and metadata tagging. Additionally, local login and registration can now be disabled via an environment variable, and the interactive torrent search modal allows custom search titles for all modes.
This commit is contained in:
@@ -16,6 +16,7 @@ export interface AudiobookMetadata {
|
||||
narrator?: string;
|
||||
year?: number;
|
||||
coverArtUrl?: string;
|
||||
asin?: string;
|
||||
}
|
||||
|
||||
export interface OrganizationResult {
|
||||
@@ -110,6 +111,7 @@ export class FileOrganizer {
|
||||
author: audiobook.author,
|
||||
narrator: audiobook.narrator,
|
||||
year: audiobook.year,
|
||||
asin: audiobook.asin,
|
||||
});
|
||||
|
||||
const successCount = taggingResults.filter((r) => r.success).length;
|
||||
@@ -153,7 +155,8 @@ export class FileOrganizer {
|
||||
this.mediaDir,
|
||||
audiobook.author,
|
||||
audiobook.title,
|
||||
audiobook.year
|
||||
audiobook.year,
|
||||
audiobook.asin
|
||||
);
|
||||
|
||||
await logger?.info(`Target path: ${targetPath}`);
|
||||
@@ -359,16 +362,28 @@ export class FileOrganizer {
|
||||
|
||||
/**
|
||||
* Build target path with sanitized names
|
||||
* Format: Author/Title (Year) ASIN or Author/Title ASIN or Author/Title (Year)
|
||||
*/
|
||||
private buildTargetPath(
|
||||
baseDir: string,
|
||||
author: string,
|
||||
title: string,
|
||||
year?: number
|
||||
year?: number,
|
||||
asin?: string
|
||||
): string {
|
||||
const authorClean = this.sanitizePath(author);
|
||||
const titleClean = this.sanitizePath(title);
|
||||
const folderName = year ? `${titleClean} (${year})` : titleClean;
|
||||
|
||||
// Build folder name with optional year and ASIN
|
||||
let folderName = titleClean;
|
||||
|
||||
if (year) {
|
||||
folderName = `${folderName} (${year})`;
|
||||
}
|
||||
|
||||
if (asin) {
|
||||
folderName = `${folderName} ${asin}`;
|
||||
}
|
||||
|
||||
return path.join(baseDir, authorClean, folderName);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user