Skip to content

Commit

Permalink
Fixed download links for private tracks.
Browse files Browse the repository at this point in the history
  • Loading branch information
elsbree committed Apr 15, 2015
1 parent 5125533 commit 7cfe75f
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 11 deletions.
2 changes: 1 addition & 1 deletion sdk/js/templates/player-feed.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
{{else}}
{{#if download_url}}
<div class="buy tdlarge-6 tdsmall-12 tdcolumns">
<a class="tdbutton expand buy-link" href="{{download_url}}?client_id=6f85bdf51b0a19b7ab2df7b969233901" target="_blank">
<a class="tdbutton expand buy-link" href="{{download_url}}" target="_blank">
<i class="tdicon-file-download playlist-social-icon"></i>
</a>
</div>
Expand Down
2 changes: 1 addition & 1 deletion sdk/js/templates/player-mini.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
</div>
{{else}}
<div class="tdlarge-8 tdsmall-6 tdcolumns buy">
<a class="button expand buy-link" href="{{download_url}}?client_id=6f85bdf51b0a19b7ab2df7b969233901" target="_blank">
<a class="button expand buy-link" href="{{download_url}}" target="_blank">
DOWNLOAD
</a>
</div>
Expand Down
2 changes: 1 addition & 1 deletion sdk/js/templates/player-solo.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
{{else}}
{{#if download_url}}
<div class="buy tdlarge-6 tdsmall-12 tdcolumns">
<a class="tdbutton expand buy-link" href="{{download_url}}?client_id=6f85bdf51b0a19b7ab2df7b969233901" target="_blank">
<a class="tdbutton expand buy-link" href="{{download_url}}" target="_blank">
DOWNLOAD
</a>
</div>
Expand Down
2 changes: 1 addition & 1 deletion sdk/js/templates/player.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
{{else}}
{{#if download_url}}
<div class="buy tdlarge-3 tdsmall-12 tdcolumns">
<a class="tdbutton expand buy-link" href="{{download_url}}?client_id=6f85bdf51b0a19b7ab2df7b969233901" target="_blank">
<a class="tdbutton expand buy-link" href="{{download_url}}" target="_blank">
DOWNLOAD
</a>
</div>
Expand Down
8 changes: 8 additions & 0 deletions sdk/js/vendor/td-interface.js
Original file line number Diff line number Diff line change
Expand Up @@ -800,6 +800,14 @@ define(['vendor/soundmanager2', 'jquery', 'vendor/jquery-jsonp', 'vendor/d3', 'v
}
}

if(track.download_url) {
if(track.sharing === 'private') {
track.download_url += '&client_id=6f85bdf51b0a19b7ab2df7b969233901';
} else {
track.download_url += '?client_id=6f85bdf51b0a19b7ab2df7b969233901';
}
}

return cb(track);
};

Expand Down
5 changes: 1 addition & 4 deletions test/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,7 @@ <h1>A fresh new customizable SoundCloud player.</h1>
dom: '#player',
keyboardEvents: false,
urls: [
'https://soundcloud.com/giraffage/music-sounds-better-with-you',
'https://soundcloud.com/wave-racer/wave-racer-streamers',
'https://soundcloud.com/flume/sleepless-feat-jezzabell-doran',
'https://soundcloud.com/ryanhemsworth/ribs-lets-have-a-sleepover'
'https://soundcloud.com/killparis/sets/galaxies-between-us-free-download/s-LMUbm'
],
single: false,
mini: false,
Expand Down
6 changes: 3 additions & 3 deletions toneden.js

Large diffs are not rendered by default.

0 comments on commit 7cfe75f

Please sign in to comment.