Skip to content

Commit

Permalink
makeTags - Always use Tidal album name to avoid disambiguation issues -
Browse files Browse the repository at this point in the history
fixes #83
  • Loading branch information
Inrixia committed Sep 24, 2024
1 parent cdb5400 commit 87d795a
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions plugins/_lib/makeTags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ import { Album, TrackItem } from "neptune-types/tidal";
import type { MediaItem } from "./Caches/MediaItemCache";

export const fullTitle = (tidal?: { title?: string; version?: string }, musicBrainz?: { title?: string; disambiguation?: string }) => {
let title;
if (tidal?.title === undefined || musicBrainz?.title === undefined) title = musicBrainz?.title ?? tidal?.title;
else title = tidal?.title?.includes("feat. ") && !musicBrainz.title?.includes("feat. ") ? tidal?.title : musicBrainz.title;
let title = musicBrainz?.title ?? tidal?.title;

// If the musicBrainz title is missing "feat ." use the tidal title.
if (tidal?.title?.includes("feat. ") && !musicBrainz?.title?.includes("feat. ")) title = tidal?.title;

if (title === undefined) return undefined;

Expand Down Expand Up @@ -117,7 +118,7 @@ export const makeTags = async (extTrackItem: ExtendedMediaItem): Promise<MetaTag
const artistName = resolveArtist(mediaItem, album);
if (artistName) tags.artist = artistName;

tags.album = fullTitle(mediaItem.album, releaseAlbum);
tags.album = mediaItem.album?.title;

let cover = mediaItem.album?.cover;
if (album !== undefined) {
Expand Down

0 comments on commit 87d795a

Please sign in to comment.