Skip to content

Commit 32a98d1

Browse files
committed
Minor bug fixes
1 parent d6bb768 commit 32a98d1

File tree

5 files changed

+19
-14
lines changed

5 files changed

+19
-14
lines changed

src/components/Audio/Audio.reducer.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import _ from 'lodash'
44

55
const audio = new Audio()
66

7-
audio.volume = 0.4
7+
audio.volume = 0.3
88

99
export const initialState = {
1010
visualizerLoaded: false,

src/components/Player/Controls.component.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ const iconContainer = {
5252
'&:hover': {
5353
background: localColors.ICON_HOVER_BACKGROUND,
5454
},
55-
boxSizing: 'content-box'
55+
boxSizing: 'content-box',
56+
color: localColors.ICON,
5657
}
5758

5859
export const styles = {

src/components/SoundCloud/SoundCloud.reducer.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,12 @@ export const reducer = {
4444
}
4545
},
4646
[types.SC__GET_SONGS_SUCCESS]: (state, action) => {
47-
const { nextHref } = action
47+
const { nextHref, paginationIndex } = action
4848

4949
return {
5050
...state,
5151
nextHref,
52+
paginationIndex,
5253
error: false,
5354
}
5455
},

src/components/SoundCloud/SoundCloud.sagas.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ function* onGetSoundCloudSongs() {
4747
const limit = yield select(_limit)
4848
const url = yield select(songUrl)
4949

50-
5150
const opts = {
5251
tags: currentGenreFormatted,
5352
//bug in SC sdk causes it to only return a few unless limit is set
@@ -63,9 +62,10 @@ function* onGetSoundCloudSongs() {
6362

6463
yield put({
6564
type: types.SC__GET_SONGS_SUCCESS,
65+
...rest,
6666
...{
67-
...rest,
6867
nextHref: next_href,
68+
paginationIndex: nextPaginationIndex,
6969
}
7070
})
7171
} catch (e) {
@@ -136,6 +136,7 @@ function* onSetAudioSrc() {
136136
const { streamUrl } = currentSongFormatted
137137

138138
audio.pause()
139+
//bug with audio src settings and then playing a new song
139140
audio.src = streamUrl
140141
audio.crossOrigin = 'anonymous'
141142

src/components/SoundCloud/SoundCloud.units.js

+11-9
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ export const songsNotListenedTo = (collection, listenedToIds) => {
2020
})
2121
}
2222

23-
export const songsNotListenedToLength = (songsNotListenedTo) => songsNotListenedTo.length
23+
export const songsNotListenedToLength = (songsNotListenedTo) => {
24+
return songsNotListenedTo.length
25+
}
2426

2527
export const hasNextSong = (songsNotListenedToLength) => songsNotListenedToLength > 0
2628
export const nextSongIndex = (songsNotListenedToLength) => Math.floor(songsNotListenedToLength * Math.random())
@@ -57,7 +59,7 @@ export const currentSongFormatted = (
5759
titleName: title,
5860
titleUrl: permalink_url,
5961
artistName: user.username,
60-
albumSrc: artwork_url.replace('large.jpg', 'crop.jpg'),
62+
albumSrc: artwork_url && artwork_url.replace('large.jpg', 'crop.jpg'),
6163
}
6264
}
6365

@@ -79,13 +81,13 @@ export const limit = (nextPaginationIndex) => {
7981
}
8082

8183
export const getAPIUrl = (nextHref) => {
82-
83-
if (nextHref) {
84-
85-
const { pathname, search } = new URL(nextHref)
86-
87-
return `${pathname}${search}`
88-
}
84+
//
85+
// if (nextHref) {
86+
//
87+
// const { pathname, search } = new URL(nextHref)
88+
//
89+
// return `${pathname}${search}`
90+
// }
8991

9092
return '/tracks'
9193
}

0 commit comments

Comments
 (0)