Skip to content

Commit

Permalink
Remove items from feed without an origin
Browse files Browse the repository at this point in the history
  • Loading branch information
gillesdemey committed Dec 8, 2015
1 parent c8f5a8c commit 2f216a1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion app/js/utils/soundcloud.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,11 @@ SoundCloud.prototype.fetchFeed = function(options) {
future_href = resp.next_href
return resp.collection
})
// filter out items with no origin (track-repost)
.reduce(function(tracks, item) {
if (item.origin) tracks.push(item)
return tracks
}, [])
.map(function(item) {
return item.origin
})
Expand Down Expand Up @@ -182,4 +187,4 @@ function _artworkFormat(url, size) {
return url.replace('-large', '-' + size);
}

module.exports = new SoundCloud();
module.exports = new SoundCloud();

0 comments on commit 2f216a1

Please sign in to comment.