mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-09-19 05:16:27 -07:00
Anime covers come from AniList, which has no live-action titles, so dramas and movies showed blank cards with no description and split across season folders. Library entries now carry a media kind plus a TMDB link, and the cover-art fetcher falls back to TMDB when AniList has no match, accepting only a Japanese non-animated title whose TMDB names match the parsed title exactly. Entries that resolve to the same TMDB title merge into one card regardless of season, and a Link to TMDB action in the detail view covers anything the automatic match missed. Release builds bundle a project-owned TMDB key injected from the SUBMINER_TMDB_API_KEY secret at build time; tmdb.apiKey/apiKeyCommand override it and are required when running from source. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
23 lines
977 B
TypeScript
23 lines
977 B
TypeScript
import assert from 'node:assert/strict';
|
|
import fs from 'node:fs';
|
|
import os from 'node:os';
|
|
import path from 'node:path';
|
|
import test from 'node:test';
|
|
import { BUNDLED_INTEGRATION_KEYS_FILENAME, readBundledTmdbApiKey } from './bundled-api-key.js';
|
|
|
|
test('readBundledTmdbApiKey reads the staged key and tolerates a missing or malformed file', () => {
|
|
const distDir = fs.mkdtempSync(path.join(os.tmpdir(), 'subminer-bundled-key-'));
|
|
const filePath = path.join(distDir, BUNDLED_INTEGRATION_KEYS_FILENAME);
|
|
try {
|
|
assert.equal(readBundledTmdbApiKey(distDir), null);
|
|
fs.writeFileSync(filePath, '{"tmdbApiKey":" abc "}');
|
|
assert.equal(readBundledTmdbApiKey(distDir), 'abc');
|
|
fs.writeFileSync(filePath, '{"tmdbApiKey":""}');
|
|
assert.equal(readBundledTmdbApiKey(distDir), null);
|
|
fs.writeFileSync(filePath, 'not json');
|
|
assert.equal(readBundledTmdbApiKey(distDir), null);
|
|
} finally {
|
|
fs.rmSync(distDir, { recursive: true, force: true });
|
|
}
|
|
});
|