update assets dependencies; still work to be done to solve it all

This commit is contained in:
bkfox
2022-03-10 15:47:56 +01:00
parent 4e03abcac8
commit ab8858154b
24 changed files with 6863 additions and 4776 deletions

View File

@ -1,5 +1,3 @@
import Vue from 'vue';
import Model, {Set} from 'public/model';
import {setEcoInterval} from 'public/utils';
@ -61,7 +59,7 @@ export class Source extends Model {
if(!this.data.remaining || !this.isPlaying)
return;
const delta = (Date.now() - this.commitDate) / 1000;
Vue.set(this, 'remaining', this.data.remaining - delta)
this.remaining = this.data.remaining - delta
}
commit(data) {
@ -70,7 +68,7 @@ export class Source extends Model {
this.commitDate = Date.now()
super.commit(data)
Vue.set(this, 'remaining', data.remaining)
this.remaining = data.remaining
}
}

View File

@ -1,13 +1,13 @@
import Vue from 'vue';
import {setAppConfig} from 'public/app';
import Model from 'public/model';
import App from 'public/app';
import Model, {Set} from 'public/model';
import Sound from 'public/sound';
import {setEcoInterval} from 'public/utils';
import {Streamer, Queue} from './controllers';
window.aircox.appConfig = {
window.aircox.builder.config = {
...App,
data() {
return {
// current streamer
@ -16,12 +16,13 @@ window.aircox.appConfig = {
streamers: [],
// fetch interval id
fetchInterval: null,
Sound: Sound,
}
},
computed: {
...(App.computed || {}),
apiUrl() {
return this.$el && this.$el.dataset.apiUrl;
},
@ -33,12 +34,13 @@ window.aircox.appConfig = {
},
methods: {
...(App.methods || {}),
fetchStreamers() {
Streamer.Set.fetch(this.apiUrl)
.then(streamers => {
Vue.set(this, 'streamers', streamers);
Vue.set(this, 'streamer', streamers ? streamers[0] : null);
})
Set.fetch(Streamer, this.apiUrl).then(streamers => {
this.streamers = streamers
this.streamer = streamers ? streamers[0] : null
})
},
},