Skip to content

Commit 7df1f8a

Browse files
author
cedya77
committed
Merge PR #410: add raw {id} placeholder support for custom art URLs
# Conflicts: # configure/src/components/sections/ArtProviderSettings.tsx
2 parents e55523d + dab734d commit 7df1f8a

3 files changed

Lines changed: 4 additions & 2 deletions

File tree

addon/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ function extractIdsFromMeta(meta) {
117117
if (!meta) return ids;
118118

119119
const id = meta.id || '';
120+
if (id) ids.id = id;
120121
if (id.startsWith('tmdb:')) ids.tmdbId = id.slice(5);
121122
else if (id.startsWith('tvdb:')) ids.tvdbId = id.slice(5);
122123
else if (id.startsWith('kitsu:')) ids.kitsuId = id.slice(6);

addon/utils/parseProps.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ function isPosterRatingEnabled(config) {
6666
* imdb: 'tt1234567', tmdb/tvdb: 'movie-12345' or 'series-12345'
6767
*
6868
* @param {string} pattern - URL pattern with placeholders
69-
* @param {object} ids - Object with tmdbId, imdbId, tvdbId, malId, kitsuId, anilistId, anidbId properties
69+
* @param {object} ids - Object with id, tmdbId, imdbId, tvdbId, malId, kitsuId, anilistId, anidbId properties
7070
* @param {string} type - Content type (movie, series)
7171
* @param {object} [config] - User config (for API key and language placeholders)
7272
* @returns {string|null} Resolved URL or null
@@ -91,6 +91,7 @@ function resolvePattern(pattern, ids, type, config, extra) {
9191

9292
const lang = config?.language || 'en-US';
9393
const placeholders = {
94+
'{id}': ids?.id || '',
9495
'{tmdb_id}': ids?.tmdbId || '',
9596
'{imdb_id}': ids?.imdbId || '',
9697
'{tvdb_id}': ids?.tvdbId || '',

configure/src/components/sections/ArtProviderSettings.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,7 @@ export function ArtProviderSettings() {
521521
: 'Override art with custom URL patterns. If a placeholder references an unavailable value, normal art is used instead.'}
522522
</p>
523523
<p className="text-sm text-muted-foreground mt-1">
524-
ID placeholders: <code>{'{imdb_id}'}</code>, <code>{'{tmdb_id}'}</code>, <code>{'{tvdb_id}'}</code>, <code>{'{mal_id}'}</code>, <code>{'{kitsu_id}'}</code>, <code>{'{anilist_id}'}</code>, <code>{'{anidb_id}'}</code>, <code>{'{type}'}</code>.
524+
ID placeholders: <code>{'{id}'}</code>, <code>{'{imdb_id}'}</code>, <code>{'{tmdb_id}'}</code>, <code>{'{tvdb_id}'}</code>, <code>{'{mal_id}'}</code>, <code>{'{kitsu_id}'}</code>, <code>{'{anilist_id}'}</code>, <code>{'{anidb_id}'}</code>, <code>{'{type}'}</code>.
525525
API keys/Extra: <code>{'{rpdb_key}'}</code>, <code>{'{top_key}'}</code>, <code>{'{tmdb_key}'}</code>, <code>{'{mdblist_key}'}</code>, <code>{'{fanart_key}'}</code>, <code>{'{user_agent}'}</code>.
526526
Language: <code>{'{language}'}</code> (e.g. fr-FR), <code>{'{language_short}'}</code> (e.g. fr).
527527
RPDB/TOP patterns automatically fall back to alternative IDs when the primary one is unavailable.

0 commit comments

Comments
 (0)