From baaf0534967cf7ba49d3cd9dd27d917be4bb3b0f Mon Sep 17 00:00:00 2001 From: Oskar Rough Date: Fri, 13 Jul 2018 18:29:21 +0200 Subject: [PATCH] Lint --- app/components/track-edit/component.js | 2 +- app/models/track.js | 2 +- app/services/player.js | 3 ++- app/utils/youtube-api.js | 1 - 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/components/track-edit/component.js b/app/components/track-edit/component.js index 236d4d78e..e1ccdc6bc 100644 --- a/app/components/track-edit/component.js +++ b/app/components/track-edit/component.js @@ -36,6 +36,6 @@ export default TrackFormComponent.extend({ setMediaAvailable: task(function * (event) { event.preventDefault() - set(this, 'track.mediaNotAvailable', false) + yield set(this, 'track.mediaNotAvailable', false) }).drop() }) diff --git a/app/models/track.js b/app/models/track.js index e0f0f2f68..69c1336c4 100644 --- a/app/models/track.js +++ b/app/models/track.js @@ -102,7 +102,7 @@ export default Model.extend(Validations, { let mediaNotAvailable = yield !fetchTrackAvailability(ytid) - if(mediaNotAvailable) { + if (mediaNotAvailable) { this.set('mediaNotAvailable', true) } else { this.set('mediaNotAvailable', false) diff --git a/app/services/player.js b/app/services/player.js index 8b567fda7..979521436 100644 --- a/app/services/player.js +++ b/app/services/player.js @@ -101,7 +101,8 @@ export default Service.extend({ 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')) { + const isOwner = channel.get('id') === track.get('channel.id') + if (isOwner) { track.set('mediaNotAvailable', true); track.save(); } diff --git a/app/utils/youtube-api.js b/app/utils/youtube-api.js index dca6049cc..d34d697b2 100644 --- a/app/utils/youtube-api.js +++ b/app/utils/youtube-api.js @@ -26,7 +26,6 @@ const fetchTitle = async function (ytid) { return data && data.snippet.title } - const fetchTrackAvailability = async function (ytid) { // let data = await fetchYoutubeTrack(ytid, 'items(id,status)&part=status') let data = await fetchYoutubeTrack(ytid, 'items(id,snippet(title))&part=snippet');