Skip to content

Commit

Permalink
Added stream status update
Browse files Browse the repository at this point in the history
  • Loading branch information
faebser committed Oct 24, 2015
1 parent 7158a6b commit 4f59e09
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
8 changes: 6 additions & 2 deletions js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ var backendStore = (function ($, Vue, superagent, Plite) {
module.init = function () {
//module.getStatus();
},
module.startUpdateStatusIntervall = function () {
updateStatusIntervall(2000);
}
module.getStatus = function () {
var self = this;
superagent.get(urls.status)
Expand All @@ -84,7 +87,7 @@ var backendStore = (function ($, Vue, superagent, Plite) {
superagent
.get(urls.stream)
.end(function (error, response) {
if(!Boolean(error) && response.body.errors !== 0) {
if(!Boolean(error) && response.body && response.body.errors !== 0) {
updateStatusList(response.body.messages);
p.reject();
}
Expand Down Expand Up @@ -348,10 +351,11 @@ var app = (function ($, Vue, superagent) {
this.state.store.getStreamStatus()
.then(function updateState (response) {
self.state.store.streamLink = response.body.link;
self.state.store.startUpdateStatusIntervall();
})
.catch(function error (error) {
console.error(error);
})
});
// console.log('the button raises to be clicked!');
}
});
Expand Down
2 changes: 0 additions & 2 deletions pistream.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,8 +247,6 @@ def get_stream_status():
error_messages = filter(None, [parse_errors(error) for error in errors.split(linesep)])
error_messages.extend(errors_from_lines)

print(darkice)

if len(error_messages) == 0 and darkice is not None:
# no errors
lcd_display.reset()
Expand Down
2 changes: 1 addition & 1 deletion views/template.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<div class="innerWrapper">
<!-- <img src="logo.jpg" id="logo"> -->
<div class="top">
<stream-form v-if="!state.store.hasErrorItems">
<stream-form v-if="!state.store.hasErrorItems || state.store.streamLink">
</stream-form>
</div>

Expand Down

0 comments on commit 4f59e09

Please sign in to comment.