mirror of
https://github.com/kikootwo/ReadMeABook.git
synced 2026-06-02 20:30:10 +00:00
Implement file hash-based library matching and remove fuzzy ASIN matching
Adds file hash-based matching for Audiobookshelf library items to ensure 100% accurate ASIN assignment for RMAB-organized content. Removes fuzzy matching from library availability checks, making all matching ASIN-only to eliminate false positives and race conditions. Updates database schema, processors, and matcher utilities; adds new tests and documentation for the new matching strategy. Removes obsolete scripts, Dockerfile, and related tests; updates docker-compose for test environments.
This commit is contained in:
@@ -1,44 +0,0 @@
|
||||
/**
|
||||
* Quick script to check backend mode configuration
|
||||
*/
|
||||
|
||||
import { prisma } from '../src/lib/db';
|
||||
|
||||
async function checkBackendMode() {
|
||||
try {
|
||||
// Check for system.backend_mode configuration
|
||||
const config = await prisma.configuration.findUnique({
|
||||
where: { key: 'system.backend_mode' }
|
||||
});
|
||||
|
||||
console.log('Backend mode configuration:');
|
||||
if (config) {
|
||||
console.log(' Key:', config.key);
|
||||
console.log(' Value:', config.value);
|
||||
console.log(' Encrypted:', config.encrypted);
|
||||
} else {
|
||||
console.log(' NOT CONFIGURED (will default to "plex")');
|
||||
}
|
||||
|
||||
// Check all configuration keys that might be relevant
|
||||
console.log('\nAll configuration keys:');
|
||||
const allConfigs = await prisma.configuration.findMany({
|
||||
select: { key: true, value: true, encrypted: true },
|
||||
orderBy: { key: 'asc' }
|
||||
});
|
||||
|
||||
for (const cfg of allConfigs) {
|
||||
if (cfg.encrypted) {
|
||||
console.log(` ${cfg.key}: [ENCRYPTED]`);
|
||||
} else {
|
||||
console.log(` ${cfg.key}: ${cfg.value}`);
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Error checking configuration:', error);
|
||||
} finally {
|
||||
await prisma.$disconnect();
|
||||
}
|
||||
}
|
||||
|
||||
checkBackendMode();
|
||||
@@ -1,60 +0,0 @@
|
||||
/**
|
||||
* Quick script to configure Audiobookshelf settings
|
||||
*/
|
||||
|
||||
import { prisma } from '../src/lib/db';
|
||||
|
||||
async function setupABSConfig() {
|
||||
try {
|
||||
// Configure these values for your Audiobookshelf instance
|
||||
const config = {
|
||||
'audiobookshelf.server_url': 'http://localhost:13378', // Change to your ABS server URL
|
||||
'audiobookshelf.api_token': 'YOUR_ABS_API_TOKEN', // Generate from ABS Settings -> API Keys -> Add API Key
|
||||
'audiobookshelf.library_id': 'YOUR_LIBRARY_ID', // Get from ABS or use test-abs endpoint
|
||||
};
|
||||
|
||||
console.log('Setting up Audiobookshelf configuration...\n');
|
||||
|
||||
for (const [key, value] of Object.entries(config)) {
|
||||
const existing = await prisma.configuration.findUnique({
|
||||
where: { key }
|
||||
});
|
||||
|
||||
if (existing) {
|
||||
await prisma.configuration.update({
|
||||
where: { key },
|
||||
data: {
|
||||
value,
|
||||
encrypted: key === 'audiobookshelf.api_token',
|
||||
}
|
||||
});
|
||||
console.log(`✓ Updated: ${key}`);
|
||||
} else {
|
||||
await prisma.configuration.create({
|
||||
data: {
|
||||
key,
|
||||
value,
|
||||
encrypted: key === 'audiobookshelf.api_token',
|
||||
category: 'audiobookshelf',
|
||||
description: null,
|
||||
}
|
||||
});
|
||||
console.log(`✓ Created: ${key}`);
|
||||
}
|
||||
}
|
||||
|
||||
console.log('\n✓ Audiobookshelf configuration complete!');
|
||||
console.log('\nNext steps:');
|
||||
console.log('1. Update the values above with your actual ABS settings');
|
||||
console.log('2. Run this script again');
|
||||
console.log('3. Test with: POST /api/setup/test-abs');
|
||||
console.log('4. Run scan job: POST /api/admin/jobs/{jobId}/trigger');
|
||||
|
||||
} catch (error) {
|
||||
console.error('Error setting up configuration:', error);
|
||||
} finally {
|
||||
await prisma.$disconnect();
|
||||
}
|
||||
}
|
||||
|
||||
setupABSConfig();
|
||||
Reference in New Issue
Block a user