Skip to content

Commit 3bc75fe

Browse files
committed
fix(dicover music): fixed music not showing in discover music
Music was being blacklisted, and the API call to listenbrainz was wrong
1 parent 5d3c195 commit 3bc75fe

File tree

3 files changed

+14
-8
lines changed

3 files changed

+14
-8
lines changed

server/routes/discover.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -883,8 +883,6 @@ discoverRoutes.get('/music', async (req, res, next) => {
883883
}
884884

885885
const freshReleasesData = await listenbrainz.getFreshReleases({
886-
offset: 0,
887-
count: 20,
888886
days,
889887
sort: apiSortField,
890888
});

src/components/Discover/DiscoverMusic/index.tsx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import PageTitle from '@app/components/Common/PageTitle';
55
import {
66
countActiveFilters,
77
prepareFilterValues,
8+
type FilterOptions,
89
} from '@app/components/Discover/constants';
910
import FilterSlideover from '@app/components/Discover/FilterSlideover';
1011
import useDiscover from '@app/hooks/useDiscover';
@@ -55,10 +56,13 @@ const DiscoverMusic = () => {
5556
titles,
5657
fetchMore,
5758
error,
58-
} = useDiscover<AlbumResult>('/api/v1/discover/music', {
59-
...preparedFilters,
60-
days: preparedFilters.days ?? '7',
61-
});
59+
} = useDiscover<AlbumResult, unknown, FilterOptions>(
60+
'/api/v1/discover/music',
61+
{
62+
...preparedFilters,
63+
days: preparedFilters.days ?? '7',
64+
}
65+
);
6266

6367
if (error) {
6468
return <Error statusCode={500} />;

src/hooks/useDiscover.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,8 @@ const useDiscover = <
118118
(i) =>
119119
(i.mediaType === 'movie' ||
120120
i.mediaType === 'tv' ||
121-
i.mediaType === 'music') &&
121+
i.mediaType === 'album' ||
122+
i.mediaType === 'artist') &&
122123
i.mediaInfo?.status !== MediaStatus.AVAILABLE &&
123124
i.mediaInfo?.status !== MediaStatus.PARTIALLY_AVAILABLE
124125
);
@@ -131,7 +132,10 @@ const useDiscover = <
131132
) {
132133
titles = titles.filter(
133134
(i) =>
134-
(i.mediaType === 'movie' || i.mediaType === 'tv') &&
135+
(i.mediaType === 'movie' ||
136+
i.mediaType === 'tv' ||
137+
i.mediaType === 'album' ||
138+
i.mediaType === 'artist') &&
135139
i.mediaInfo?.status !== MediaStatus.BLACKLISTED
136140
);
137141
}

0 commit comments

Comments
 (0)