Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

music play from artist details page added #10

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

imvikashdev
Copy link

I have implemented new feature.
User can now play music from artist details page (songs which are related to artists).

@Dev-Dannie
Copy link

I think that’s a cool feature you’ve added. Being able to play songs from any part of the app is good for great UX

@aniket-kes
Copy link

Is this working for you when i tried it i am getting error "Cannot read properties of undefined (reading 'length')" .
I have actually used shazam Api not shazam core hence i needed different endpoint to fetch artists songs and therefore i have created one file in components named ' ArtistRelated ' it is exactly same as Related song but i am mapping the data which i am getting from artist songs endpoint.

@shubhamrathod0015
Copy link

I have implemented new feature. User can now play music from artist details page (songs which are related to artists).

The original lyrics api has depreciated and new one is https://shazam-core.p.rapidapi.com/v2/tracks/details'

However it still does not work?

My shazamCore Code looks like this:

`import { createApi, fetchBaseQuery } from "@reduxjs/toolkit/query/react";

export const shazamCoreApi = createApi({
reducerPath: "shazamCoreApi",
baseQuery: fetchBaseQuery({
baseUrl: "https://shazam-core.p.rapidapi.com/",
prepareHeaders: (headers) => {
headers.set(
"X-RapidAPI-Key",
"e919fc6e47msh434a4c7817b528dp1d9dc2jsn46121b2f2e3d"
);
return headers;
},
}),
endpoints: (builder) => ({
getTopCharts: builder.query({ query: () => "v1/charts/world" }),
getSongsByGenre: builder.query({
query: (genre) => v1/charts/genre-world?genre_code=${genre},
}),
getSongsByCountry: builder.query({
query: (countryCode) => v1/charts/country?country_code=${countryCode},
}),
getSongsBySearch: builder.query({
query: (searchTerm) =>
v1/search/multi?search_type=SONGS_ARTISTS&query=${searchTerm},
}),
getArtistDetails: builder.query({
query: (artistId) => v2/artists/details?artist_id=${artistId},
}),
getSongDetails: builder.query({
query: ({ songid }) => v2/tracks/details?track_id=${songid},
}),
getSongRelated: builder.query({
query: ({ songid }) => v1/tracks/related?track_id=${songid},
}),
}),
});

export const {
useGetTopChartsQuery,
useGetSongsByGenreQuery,
useGetSongsByCountryQuery,
useGetSongsBySearchQuery,
useGetArtistDetailsQuery,
useGetSongDetailsQuery,
useGetSongRelatedQuery,
} = shazamCoreApi;
`

What am I doing wrong?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants