Merge branch 'master' of git.flexites.org:Students/ITRadio
This commit is contained in:
commit
d332dac38f
|
|
@ -219,9 +219,9 @@ module.exports = configure(function (ctx) {
|
|||
},
|
||||
|
||||
manifest: {
|
||||
name: 'Tugan App',
|
||||
short_name: 'Tugan App',
|
||||
description: 'A Tugan project',
|
||||
name: 'IT Radio App',
|
||||
short_name: 'IT Radio App',
|
||||
description: 'IT Radio project',
|
||||
display: 'standalone',
|
||||
orientation: 'portrait',
|
||||
background_color: '#ffffff',
|
||||
|
|
@ -284,7 +284,7 @@ module.exports = configure(function (ctx) {
|
|||
builder: {
|
||||
// https://www.electron.build/configuration/configuration
|
||||
|
||||
appId: 'tugan',
|
||||
appId: 'it-radio',
|
||||
},
|
||||
|
||||
// "chain" is a webpack-chain object https://github.com/neutrinojs/webpack-chain
|
||||
|
|
|
|||
|
|
@ -156,11 +156,12 @@ export default {
|
|||
},
|
||||
},
|
||||
created() {
|
||||
this.initializationInfo();
|
||||
this.connectionPlayer();
|
||||
},
|
||||
mounted() {
|
||||
this.initializationInfo();
|
||||
this.$store.dispatch('initPlayer');
|
||||
// console.log(this.$store.state);
|
||||
if (this.user?.id) {
|
||||
this.checkSongIsFavorite();
|
||||
this.getSongList();
|
||||
|
|
@ -188,9 +189,22 @@ export default {
|
|||
}
|
||||
},
|
||||
methods: {
|
||||
async initializationInfo() {
|
||||
return app.getNowplaying().then((responce) => responce.now_playing.song);
|
||||
initializationInfo() {
|
||||
app
|
||||
.getNowplaying()
|
||||
.then((responce) => {
|
||||
console.log(responce.now_playing.song);
|
||||
this.$store.dispatch('setCurrentPlay', {
|
||||
...this.currentPlay,
|
||||
isLoader: false,
|
||||
...responce.now_playing.song,
|
||||
});
|
||||
console.log(this.player.target.src);
|
||||
// console.log(this.$store.state);
|
||||
})
|
||||
.catch((error) => console.log(error));
|
||||
},
|
||||
|
||||
connectionPlayer() {
|
||||
if (this.connection) {
|
||||
this.connection.removePlay();
|
||||
|
|
@ -231,6 +245,7 @@ export default {
|
|||
data.np.station.listen_url,
|
||||
);
|
||||
this.$store.dispatch('changePlayer', data.np.station.listen_url);
|
||||
console.log(this.player);
|
||||
const params = {
|
||||
...this.currentPlay,
|
||||
...data.np.now_playing.song,
|
||||
|
|
@ -241,6 +256,7 @@ export default {
|
|||
};
|
||||
delete params.unique_id;
|
||||
this.$store.dispatch('setCurrentPlay', params);
|
||||
console.log(this.$store.state);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -217,7 +217,7 @@ export default class extends REST {
|
|||
}
|
||||
|
||||
static getNowplaying(station, params) {
|
||||
return this._get('/radio/song/get_nowplaying/', params, {})
|
||||
return this._get('radio/song/get_nowplaying', params, {})
|
||||
.then((data) => {
|
||||
return data;
|
||||
})
|
||||
|
|
@ -229,5 +229,3 @@ export default class extends REST {
|
|||
});
|
||||
}
|
||||
}
|
||||
|
||||
// console.log(Django.getNowplaying());
|
||||
|
|
|
|||
|
|
@ -57,8 +57,8 @@ export default class extends REST {
|
|||
};
|
||||
}
|
||||
|
||||
onHandler(event) {
|
||||
this.connection.onmessage = event;
|
||||
onHandler(callback) {
|
||||
this.connection.onmessage = callback;
|
||||
}
|
||||
static getPlayList(station, params) {
|
||||
// return this._get(`station/${station}/playlists`, params, {}).then((data) => {
|
||||
|
|
|
|||
|
|
@ -41,5 +41,4 @@ const robotsTxt = {
|
|||
},
|
||||
],
|
||||
};
|
||||
console.log(urlPath);
|
||||
export { selfUrl, ajax, cache, urlPath, urlPathAudio, selfPath, robotsTxt };
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ export default createStore({
|
|||
},
|
||||
};
|
||||
},
|
||||
plugins: [vuexPersist.plugin],
|
||||
// plugins: [vuexPersist.plugin],
|
||||
mutations: {
|
||||
user(state, user) {
|
||||
state.user = user;
|
||||
|
|
@ -92,6 +92,7 @@ export default createStore({
|
|||
state.player.target.pause();
|
||||
}
|
||||
if (params.play) {
|
||||
console.log(state);
|
||||
if (state.player.target.readyState >= 3) {
|
||||
state.currentPlay.isPlay = true;
|
||||
state.player.target.play();
|
||||
|
|
|
|||
Loading…
Reference in New Issue