Skip to content

Commit

Permalink
feat: only set track as unavailable for track owner
Browse files Browse the repository at this point in the history
  • Loading branch information
Hugo Vieilledent committed Jul 13, 2018
1 parent 956f4f1 commit 03928d1
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions app/services/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,15 @@ export default Service.extend({
},

onMediaNotAvailable(event) {
get(this, 'store').findRecord('track', event.track.id).then(track => {
track.set('mediaNotAvailable', true);
track.save();
});
let channel = this.get('session.currentUser.channels.firstObject')
get(this, 'store').findRecord('track', event.track.id)
.then(track => {
// only set media as not-available for track owner (for now)
if(channel.get('id') === track.get('channel.id')) {
track.set('mediaNotAvailable', true);
track.save();
}
});
},

channelChanged(previousChannelId, channelId) {
Expand Down

0 comments on commit 03928d1

Please sign in to comment.