Skip to content

Commit

Permalink
actually only wnyc fm/am streams
Browse files Browse the repository at this point in the history
  • Loading branch information
dparrington committed Mar 17, 2017
1 parent 4eb21fd commit e41729c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions app/stream/model.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { shareMetadata } from 'wqxr-web-client/helpers/share-metadata';
const WQXR_slugs = ["wqxr","q2","jonathan-channel","wqxr-special","wqxr-special2"];
// wqxr-special = Operavore,
// wqxr-special2 = Holiday Channel
const WNYC_slugs = ["wnyc-fm939", "wnyc-am820"];

export default Model.extend({
audioType: 'stream',
Expand Down Expand Up @@ -36,6 +37,10 @@ export default Model.extend({
return WQXR_slugs.includes(this.get('slug'));
}),

isWNYC: computed('slug', function(){
return WNYC_slugs.includes(this.get('slug'));
}),

liveWQXR: computed('isWQXR', 'whatsOn', function(){
return this.get('isWQXR') && (this.get('whatsOn') > 0);
}),
Expand Down
2 changes: 1 addition & 1 deletion app/stream/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default Route.extend({
return this.store.findAll('stream').then(streams => {
return {
wqxrStreams: streams.filterBy('isWQXR'),
otherStreams: streams.rejectBy('isWQXR')
wnycStreams: streams.filterBy('isWNYC')
};
});
},
Expand Down
2 changes: 1 addition & 1 deletion app/stream/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
currentAudio=audio.currentId
playState=audio.playState}}
{{stream-list
streams=model.otherStreams
streams=model.wnycStreams
currentAudio=audio.currentId
playState=audio.playState}}
</main>
Expand Down
2 changes: 1 addition & 1 deletion tests/acceptance/streams-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ test('visiting /streams', function(assert) {

andThen(function() {
assert.equal(currentURL(), '/streams');
assert.equal(find('.stream-list li').length, 7, 'should display a list of streams');
assert.equal(find('.stream-list li').length, 6, 'should display a list of streams');
assert.ok(refreshSpy.calledOnce, 'refresh was called');
});
});
Expand Down

0 comments on commit e41729c

Please sign in to comment.