mirror of
https://github.com/antebudimir/feishin.git
synced 2025-12-31 18:13:31 +00:00
Feature: Add song and artist links to discord RPC (#1160)
* Add song and artist links to discord RPC * use first artist name for artist link, full artist name for song link * use first album artist for song link * add discord rpc links setting * simplify discord link settings * fix setting description * add musicbrainz links * fix callback missing dependency * use encodeURIComponent for lastfm links Co-authored-by: Kendall Garner <17521368+kgarner7@users.noreply.github.com> * split musicbrainz ids * combine link settings --------- Co-authored-by: Kendall Garner <17521368+kgarner7@users.noreply.github.com>
This commit is contained in:
parent
f1a75d8e81
commit
1b278cb33a
10 changed files with 108 additions and 6 deletions
|
|
@ -261,6 +261,8 @@ const normalizeSong = (
|
|||
itemType: LibraryItem.SONG,
|
||||
lastPlayedAt: null,
|
||||
lyrics: null,
|
||||
mbzRecordingId: null,
|
||||
mbzTrackId: item.ProviderIds?.MusicBrainzTrack || null,
|
||||
name: item.Name,
|
||||
participants: getPeople(item),
|
||||
path,
|
||||
|
|
|
|||
|
|
@ -393,6 +393,12 @@ const participant = z.object({
|
|||
Type: z.string().optional(),
|
||||
});
|
||||
|
||||
const providerIds = z.object({
|
||||
MusicBrainzAlbum: z.string().optional(),
|
||||
MusicBrainzArtist: z.string().optional(),
|
||||
MusicBrainzTrack: z.string().optional(),
|
||||
});
|
||||
|
||||
const songDetailParameters = baseParameters;
|
||||
|
||||
const song = z.object({
|
||||
|
|
@ -425,6 +431,7 @@ const song = z.object({
|
|||
PlaylistItemId: z.string().optional(),
|
||||
PremiereDate: z.string().optional(),
|
||||
ProductionYear: z.number(),
|
||||
ProviderIds: providerIds.optional(),
|
||||
RunTimeTicks: z.number(),
|
||||
ServerId: z.string(),
|
||||
SortName: z.string(),
|
||||
|
|
@ -433,11 +440,6 @@ const song = z.object({
|
|||
UserData: userData.optional(),
|
||||
});
|
||||
|
||||
const providerIds = z.object({
|
||||
MusicBrainzAlbum: z.string().optional(),
|
||||
MusicBrainzArtist: z.string().optional(),
|
||||
});
|
||||
|
||||
const albumArtist = z.object({
|
||||
AlbumCount: z.number().optional(),
|
||||
BackdropImageTags: z.array(z.string()),
|
||||
|
|
|
|||
|
|
@ -180,6 +180,8 @@ const normalizeSong = (
|
|||
itemType: LibraryItem.SONG,
|
||||
lastPlayedAt: normalizePlayDate(item),
|
||||
lyrics: item.lyrics ? item.lyrics : null,
|
||||
mbzRecordingId: item.mbzReleaseTrackId || null,
|
||||
mbzTrackId: item.mbzReleaseTrackId || null,
|
||||
name: item.title,
|
||||
// Thankfully, Windows is merciful and allows a mix of separators. So, we can use the
|
||||
// POSIX separator here instead
|
||||
|
|
|
|||
|
|
@ -214,7 +214,7 @@ const song = z.object({
|
|||
mbzAlbumArtistId: z.string().optional(),
|
||||
mbzAlbumId: z.string().optional(),
|
||||
mbzArtistId: z.string().optional(),
|
||||
mbzTrackId: z.string().optional(),
|
||||
mbzReleaseTrackId: z.string().optional(),
|
||||
mediumImageUrl: z.string().optional(),
|
||||
orderAlbumArtistName: z.string(),
|
||||
orderAlbumName: z.string(),
|
||||
|
|
|
|||
|
|
@ -160,6 +160,8 @@ const normalizeSong = (
|
|||
itemType: LibraryItem.SONG,
|
||||
lastPlayedAt: null,
|
||||
lyrics: null,
|
||||
mbzRecordingId: item.musicBrainzId || null,
|
||||
mbzTrackId: null,
|
||||
name: item.title,
|
||||
participants: getParticipants(item),
|
||||
path: item.path,
|
||||
|
|
|
|||
|
|
@ -340,6 +340,8 @@ export type Song = {
|
|||
itemType: LibraryItem.SONG;
|
||||
lastPlayedAt: null | string;
|
||||
lyrics: null | string;
|
||||
mbzRecordingId: null | string;
|
||||
mbzTrackId: null | string;
|
||||
name: string;
|
||||
participants: null | Record<string, RelatedArtist[]>;
|
||||
path: null | string;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue