Skip to content

Commit a845b4b

Browse files
committed
Fix: getApi params
1 parent 22e29b8 commit a845b4b

7 files changed

Lines changed: 7 additions & 7 deletions

File tree

app/components/options/OptionsAlbum.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const OptionsAlbum = ({ album, isOpen, onClose }) => {
2121
const song = useSong()
2222

2323
const playSimilarSongs = () => {
24-
getApiNetworkFirst(config, 'getSimilarSongs', `id=${album.id}&count=50`)
24+
getApiNetworkFirst(config, 'getSimilarSongs', { id: album.id, count: 50 })
2525
.then((json) => {
2626
if (json.similarSongs?.song) playSong(config, songDispatch, json.similarSongs.song, 0)
2727
})

app/components/options/OptionsAlbums.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const OptionsAlbums = ({ albums, indexOptions, setIndexOptions }) => {
1919
const songDispatch = useSongDispatch()
2020

2121
const playSimilarSongs = () => {
22-
getApiNetworkFirst(config, 'getSimilarSongs', `id=${albums[indexOptions].id}&count=50`)
22+
getApiNetworkFirst(config, 'getSimilarSongs', { id: albums[indexOptions].id, count: 50 })
2323
.then((json) => {
2424
if (json.similarSongs?.song) playSong(config, songDispatch, json.similarSongs.song, 0)
2525
})

app/components/options/OptionsArtist.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const OptionsArtist = ({ artist, artistInfo = {}, isOption, setIsOption }) => {
1515
const refOption = React.useRef()
1616

1717
const playSimilarSongs = () => {
18-
getApiCacheFirst(config, 'getSimilarSongs', `id=${artist.id}&count=50`)
18+
getApiCacheFirst(config, 'getSimilarSongs', { id: artist.id, count: 50 })
1919
.then((json) => {
2020
if (json.similarSongs?.song) {
2121
playSong(config, songDispatch, json.similarSongs.song, 0)

app/components/options/OptionsArtists.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const OptionsArtists = ({ artists, indexOptions, setIndexOptions }) => {
1414
const refOption = React.useRef()
1515

1616
const playSimilarSongs = () => {
17-
getApiNetworkFirst(config, 'getSimilarSongs', `id=${artists[indexOptions].id}&count=50`)
17+
getApiNetworkFirst(config, 'getSimilarSongs', { id: artists[indexOptions].id, count: 50 })
1818
.then((json) => {
1919
if (json.similarSongs?.song) {
2020
playSong(config, songDispatch, json.similarSongs.song, 0)

app/components/options/OptionsSongsList.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ const OptionsSongsList = ({ songs, indexOptions, setIndexOptions, onUpdate = ()
3333
}, [indexOptions])
3434

3535
const playSimilarSongs = () => {
36-
getApiNetworkFirst(config, 'getSimilarSongs', `id=${songs[indexOptions].id}&count=50`)
36+
getApiNetworkFirst(config, 'getSimilarSongs', { id: songs[indexOptions].id, count: 50 })
3737
.then((json) => {
3838
if (!json.similarSongs?.song) {
3939
playSong(config, songDispatch, [songs[indexOptions]], 0)

app/screens/Pres/Artist.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ const Artist = ({ navigation, route: { params } }) => {
5353
if (!artist.album) return
5454
if (!allSongs.current.length) {
5555
const songsPending = artist.album.map(async album => {
56-
return await getApiNetworkFirst(config, 'getAlbum', `id=${album.id}`)
56+
return await getApiNetworkFirst(config, 'getAlbum', { id: album.id })
5757
.then((json) => {
5858
return json.album.song
5959
})

app/screens/tabs/Home.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const Home = () => {
2828
const [refresh, setRefresh] = React.useState(0)
2929

3030
const clickRandomSong = () => {
31-
getApiNetworkFirst(config, 'getRandomSongs', `size=50`)
31+
getApiNetworkFirst(config, 'getRandomSongs', 'size=50')
3232
.then((json) => {
3333
playSong(config, songDispatch, json.randomSongs.song, 0)
3434
})

0 commit comments

Comments
 (0)