chore: fix genres & personalized content not loading

This commit is contained in:
Kingkor Roy Tirtho 2023-09-28 15:27:13 +06:00
parent 94c386638f
commit 5a758d8671
4 changed files with 6 additions and 3 deletions

View File

@ -142,6 +142,7 @@ class SpotubeAudioPlayer extends AudioPlayerInterface
String? get currentSource { String? get currentSource {
// if (mkSupportedPlatform) { // if (mkSupportedPlatform) {
if (_mkPlayer.playlist.index == -1) return null;
return _mkPlayer.playlist.medias return _mkPlayer.playlist.medias
.elementAtOrNull(_mkPlayer.playlist.index) .elementAtOrNull(_mkPlayer.playlist.index)
?.uri; ?.uri;

View File

@ -58,8 +58,8 @@ class CustomSpotifyEndpoints {
'include_external': includeExternal, 'include_external': includeExternal,
'timestamp': DateTime.now().toUtc().toIso8601String(), 'timestamp': DateTime.now().toUtc().toIso8601String(),
if (locale != null) 'locale': locale, if (locale != null) 'locale': locale,
if (market != null) 'market': market, if (market != null) 'market': market.name,
if (country != null) 'country': country, if (country != null) 'country': country.name,
}.entries.map((e) => '${e.key}=${e.value}').join('&'); }.entries.map((e) => '${e.key}=${e.value}').join('&');
final res = await _client.get( final res = await _client.get(

View File

@ -53,7 +53,7 @@ class CategoryQueries {
(pageParam, spotify) async { (pageParam, spotify) async {
final playlists = await Pages<PlaylistSimple?>( final playlists = await Pages<PlaylistSimple?>(
spotify, spotify,
"v1/browse/categories/$category/playlists?country=$market&locale=$locale", "v1/browse/categories/$category/playlists?country=${market.name}&locale=$locale",
(json) => json == null ? null : PlaylistSimple.fromJson(json), (json) => json == null ? null : PlaylistSimple.fromJson(json),
'playlists', 'playlists',
(json) => PlaylistsFeatured.fromJson(json), (json) => PlaylistsFeatured.fromJson(json),

View File

@ -68,6 +68,8 @@ set_target_properties(${BINARY_NAME}
# them to the application. # them to the application.
include(flutter/generated_plugins.cmake) include(flutter/generated_plugins.cmake)
target_link_libraries(${BINARY_NAME} PRIVATE ${MIMALLOC_LIB})
# === Installation === # === Installation ===
# By default, "installing" just makes a relocatable bundle in the build # By default, "installing" just makes a relocatable bundle in the build