Skip to content

Commit

Permalink
fix: jellyfin is picky about uniqueid casing
Browse files Browse the repository at this point in the history
  • Loading branch information
sjorge committed May 11, 2024
1 parent bb8cfcc commit 55ea50d
Showing 1 changed file with 26 additions and 2 deletions.
28 changes: 26 additions & 2 deletions src/nfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,20 @@ export class AnimeNfo {

this.anime.uniqueId.forEach((id: UniqueId) => {
const nfoUniqueId = show.ele('uniqueid');
let jellyfinCompatibleType = id.type;
switch (jellyfinCompatibleType) {
case "anidb":
jellyfinCompatibleType = "AniDB";
break;
case "anilist":
jellyfinCompatibleType = "AniList";
break;
case "tmdb":
jellyfinCompatibleType = "Tmdb";
break;
}
nfoUniqueId.txt(`${id.id}`);
nfoUniqueId.att('type', id.type);
nfoUniqueId.att('type', jellyfinCompatibleType);
nfoUniqueId.att('default', `${id.default === true}`)
});

Expand Down Expand Up @@ -243,8 +255,20 @@ export class EpisodeNfo {

episode.uniqueId.forEach((id: UniqueId) => {
const nfoUniqueId = episodedetails.ele('uniqueid');
let jellyfinCompatibleType = id.type;
switch (jellyfinCompatibleType) {
case "anidb":
jellyfinCompatibleType = "AniDB";
break;
case "anilist":
jellyfinCompatibleType = "AniList";
break;
case "tmdb":
jellyfinCompatibleType = "Tmdb";
break;
}
nfoUniqueId.txt(`${id.id}`);
nfoUniqueId.att('type', id.type);
nfoUniqueId.att('type', jellyfinCompatibleType);
nfoUniqueId.att('default', `${id.default === true}`)
});

Expand Down

0 comments on commit 55ea50d

Please sign in to comment.