forked from rc/aircox
		
	update assets dependencies; still work to be done to solve it all
This commit is contained in:
		@ -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
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -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
 | 
			
		||||
            })
 | 
			
		||||
        },
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user