Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions app/components/broadcasting-info.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import Component from '@glimmer/component';
import { inject as service } from '@ember/service';

interface BroadcastingInfoArgs {}

export default class BroadcastingInfo extends Component<BroadcastingInfoArgs> {
@service declare currentRadio: any;
}
24 changes: 24 additions & 0 deletions app/components/current-scheduled-show.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<h2 style="text-sl">Current Scheduled Show</h2>
<Await @promise={{this.fetchCurrentScheduledShow}} as |await|>
<await.Pending>
Loading...
</await.Pending>
<await.Fulfilled as |result|>
<div>
<span class="font-semibold">Current show:</span>
<span>{{result.current_show}}</span>
</div>
<div>
<span>The current show's playlist should be queued automatically, but if it's not working try this button.</span>
<button
{{on "click" this.queueCurrentShowPlaylist}}
class="btn"
type="button">
Queue Current Show's Playlist
</button>
</div>
</await.Fulfilled>
<await.Rejected>
Something went wrong :(
</await.Rejected>
</Await>
37 changes: 37 additions & 0 deletions app/components/current-scheduled-show.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import Component from '@glimmer/component';
import { action } from '@ember/object';
import { inject as service } from '@ember/service';
import ENV from 'streampusher-frontend/config/environment';

interface CurrentScheduledShowArgs {}

export default class CurrentScheduledShow extends Component<CurrentScheduledShowArgs> {
@service declare session: any;
@service declare flashMessages: any;

@action queueCurrentShowPlaylist() {
try {
fetch(`${ENV.API_HOST}/queue_current_show`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
Authorization: `Bearer ${this.session.data.authenticated.token}`,
},
}).then((response) => {
if (response.status === 200) {
this.flashMessages.success('Queue current show playlist!');
} else {
this.flashMessages.danger('Something went wrong!');
}
})
} catch(error) {
this.flashMessages.error('Error queueing current show playlist!');
console.log('error queuing current show playlist');
console.log(error);
}
}

@action
fetchCurrentScheduledShow() {
}
}
2 changes: 2 additions & 0 deletions app/templates/authenticated/dashboard.hbs
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<section class="w-full m-2">
<img src="/assets/images/under-construction.gif" alt="under construction 90s!"/>
<BroadcastingInfo />
<MetadataUpdateForm />
<DonationLinkForm />
<SkipButtonForm />
<CurrentScheduledShow />
<LiquidsoapRequests />
</section>
8 changes: 8 additions & 0 deletions app/templates/components/broadcasting-info.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<span>Host:</span>
<pre>
{{this.currentRadio.host}}
</pre>
<span>Port:</span>
<pre>
{{this.currentRadio.port}}
</pre>