From 3da3f39f5ae33655e919e27b32b080d8abd20f5f Mon Sep 17 00:00:00 2001 From: Norbaev Date: Thu, 27 Jun 2024 17:44:14 +0500 Subject: [PATCH 1/6] =?UTF-8?q?=D0=B4=D0=B5=D1=81=D1=82=D1=80=D1=83=D0=BA?= =?UTF-8?q?=D1=82=D1=83=D1=80=D0=B8=D1=80=D0=BE=D0=B2=D0=B0=D0=BB=20=D0=BD?= =?UTF-8?q?=D1=83=D0=B6=D0=BD=D1=8B=D0=B5=20=D0=BE=D0=B1=D1=8A=D0=B5=D0=BA?= =?UTF-8?q?=D1=82=D1=8B=20=D0=B4=D0=BB=D1=8F=20=D0=BF=D1=80=D0=B5=D0=B4?= =?UTF-8?q?=D0=B2=D0=B0=D1=80=D0=B8=D1=82=D0=B5=D0=BB=D1=8C=D0=BD=D0=BE?= =?UTF-8?q?=D0=B9=20=D0=B7=D0=B0=D0=B3=D1=80=D1=83=D0=B7=D0=BA=D0=B8=20?= =?UTF-8?q?=D0=B2=20initializationInfo()?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/src/components/player.vue | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/client/src/components/player.vue b/client/src/components/player.vue index d50d9a9..87c4442 100644 --- a/client/src/components/player.vue +++ b/client/src/components/player.vue @@ -161,7 +161,6 @@ export default { }, mounted() { this.$store.dispatch('initPlayer'); - // console.log(this.$store.state); if (this.user?.id) { this.checkSongIsFavorite(); this.getSongList(); @@ -193,14 +192,15 @@ export default { app .getNowplaying() .then((responce) => { - console.log(responce.now_playing.song); + const { art, title, artist } = responce.now_playing.song; + this.$store.dispatch('setCurrentPlay', { ...this.currentPlay, isLoader: false, - ...responce.now_playing.song, + art, + title, + artist, }); - console.log(this.player.target.src); - // console.log(this.$store.state); }) .catch((error) => console.log(error)); }, @@ -236,6 +236,7 @@ export default { }, getPlaying(e) { const jsonData = JSON.parse(e.data); + if (jsonData?.pub?.data) { const data = jsonData?.pub?.data; if (this.currentPlay.live) { @@ -358,6 +359,7 @@ export default { app .getAudio(id) .then((res) => { + console.log('res в методе getAudio', res); const blob = new Blob([res], { type: 'application/audio' }); const audioUrl = URL.createObjectURL(blob); this.$store.dispatch('changePlayer', audioUrl); From e30b38d50b9eb73fb2505d15b0b5d2bf52f902d2 Mon Sep 17 00:00:00 2001 From: Norbaev Date: Thu, 27 Jun 2024 18:00:17 +0500 Subject: [PATCH 2/6] test ssh --- client/src/components/player.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/components/player.vue b/client/src/components/player.vue index 87c4442..893dd0d 100644 --- a/client/src/components/player.vue +++ b/client/src/components/player.vue @@ -193,7 +193,7 @@ export default { .getNowplaying() .then((responce) => { const { art, title, artist } = responce.now_playing.song; - + console.log(art, title, artist); this.$store.dispatch('setCurrentPlay', { ...this.currentPlay, isLoader: false, From b82f4137a64476778a1e9d8d504121ab6a4a071c Mon Sep 17 00:00:00 2001 From: Norbaev Date: Thu, 27 Jun 2024 20:51:07 +0500 Subject: [PATCH 3/6] =?UTF-8?q?=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B0=20=D0=BE=D0=B1=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D0=BA?= =?UTF-8?q?=D0=B0=20=D0=BF=D0=B5=D1=80=D0=B2=D0=BE=D0=B3=D0=BE=20=D1=81?= =?UTF-8?q?=D0=BE=D0=B1=D1=8B=D1=82=D0=B8=D1=8F=20=D0=B2=20getPlaying?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/src/components/player.vue | 52 ++++++++++++++++++-------------- client/src/services/audio.js | 2 ++ 2 files changed, 31 insertions(+), 23 deletions(-) diff --git a/client/src/components/player.vue b/client/src/components/player.vue index 87c4442..757e2f0 100644 --- a/client/src/components/player.vue +++ b/client/src/components/player.vue @@ -156,7 +156,7 @@ export default { }, }, created() { - this.initializationInfo(); + // this.initializationInfo(); this.connectionPlayer(); }, mounted() { @@ -209,8 +209,10 @@ export default { if (this.connection) { this.connection.removePlay(); } + this.connection = new Player(); this.connection.init(); + this.connection.onHandler(this.getPlaying); }, checkSongIsFavorite() { @@ -235,30 +237,34 @@ export default { }); }, getPlaying(e) { + // console.log('getPlaying', e); const jsonData = JSON.parse(e.data); + console.log('jsonData', jsonData); + const data = + // Второй ответ + jsonData?.pub?.data || + // Первый ответ + jsonData?.connect?.subs?.['station:it-radio']?.publications?.[0]?.data; + console.log('getPlaying', data); - if (jsonData?.pub?.data) { - const data = jsonData?.pub?.data; - if (this.currentPlay.live) { - if (data.np.station.listen_url !== this.player.target.src) { - console.log( - 'data.np.station.listen_url', - 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, - azura_id: data.np.now_playing.song.id, - isLoader: false, - live: true, - currentIndex: null, - }; - delete params.unique_id; - this.$store.dispatch('setCurrentPlay', params); - console.log(this.$store.state); - } + if (!data) return; + if (this.currentPlay.live) { + const dataUrl = data.np.station.listen_url; + if (data.np.station.listen_url !== this.player.target.src) { + console.log('data.np.station.listen_url', 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, + azura_id: data.np.now_playing.song.id, + isLoader: false, + live: true, + currentIndex: null, + }; + delete params.unique_id; + this.$store.dispatch('setCurrentPlay', params); + console.log(this.$store.state); } } }, diff --git a/client/src/services/audio.js b/client/src/services/audio.js index 532793d..6ab2f17 100644 --- a/client/src/services/audio.js +++ b/client/src/services/audio.js @@ -24,6 +24,8 @@ export default class extends REST { this.connection = new EventSource( sseBaseUri + '?' + sseUriParams.toString(), ); + // window.connection = this.connection; + this.connection.onopen = (e) => console.log('connected', e); } removePlay() { From 6e1fbf6b169552a7e8605d3a72293aa6ce2afc84 Mon Sep 17 00:00:00 2001 From: Norbaev Date: Fri, 28 Jun 2024 09:41:56 +0500 Subject: [PATCH 4/6] =?UTF-8?q?=D1=80=D0=B5=D1=84=D0=B0=D0=BA=D1=82=D0=BE?= =?UTF-8?q?=D1=80=D0=B8=D0=BD=D0=B3=20getPlaying.=20=D0=94=D0=BE=D0=B1?= =?UTF-8?q?=D0=B0=D0=B2=D0=B8=D0=BB=20=D0=BA=D0=B0=D1=81=D1=82=D0=BE=D0=BC?= =?UTF-8?q?=D0=BD=D0=BE=D0=B5=20=D0=BF=D1=80=D0=B0=D0=B2=D0=B8=D0=BB=D0=BE?= =?UTF-8?q?=20=D0=B2=20.eslintrc.cjs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/.eslintrc.cjs | 3 +++ client/src/components/player.vue | 13 +++++++------ client/src/services/audio.js | 3 +-- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/client/.eslintrc.cjs b/client/.eslintrc.cjs index 91c823b..32b5b72 100644 --- a/client/.eslintrc.cjs +++ b/client/.eslintrc.cjs @@ -83,5 +83,8 @@ module.exports = { 'vue/multi-word-component-names': 'off', // allow debugger during development only 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off', + + // Custom + 'no-console': 'warn', }, }; diff --git a/client/src/components/player.vue b/client/src/components/player.vue index 6546f4f..cfb7a93 100644 --- a/client/src/components/player.vue +++ b/client/src/components/player.vue @@ -239,20 +239,21 @@ export default { getPlaying(e) { // console.log('getPlaying', e); const jsonData = JSON.parse(e.data); - console.log('jsonData', jsonData); + // console.log('jsonData', jsonData); const data = // Второй ответ jsonData?.pub?.data || // Первый ответ jsonData?.connect?.subs?.['station:it-radio']?.publications?.[0]?.data; - console.log('getPlaying', data); + // console.log('getPlaying', data); if (!data) return; if (this.currentPlay.live) { const dataUrl = data.np.station.listen_url; - if (data.np.station.listen_url !== this.player.target.src) { - console.log('data.np.station.listen_url', data.np.station.listen_url); - this.$store.dispatch('changePlayer', data.np.station.listen_url); + const playerUrl = this.player.target.src; + if (dataUrl !== playerUrl) { + // console.log('data.np.station.listen_url', dataUrl); + this.$store.dispatch('changePlayer', dataUrl); console.log(this.player); const params = { ...this.currentPlay, @@ -262,9 +263,9 @@ export default { live: true, currentIndex: null, }; + console.log('params in getPlaying ', params); delete params.unique_id; this.$store.dispatch('setCurrentPlay', params); - console.log(this.$store.state); } } }, diff --git a/client/src/services/audio.js b/client/src/services/audio.js index 6ab2f17..08abe19 100644 --- a/client/src/services/audio.js +++ b/client/src/services/audio.js @@ -25,7 +25,7 @@ export default class extends REST { sseBaseUri + '?' + sseUriParams.toString(), ); // window.connection = this.connection; - this.connection.onopen = (e) => console.log('connected', e); + // this.connection.onopen = (e) => console.log('connected', e); } removePlay() { @@ -66,7 +66,6 @@ export default class extends REST { // return this._get(`station/${station}/playlists`, params, {}).then((data) => { return this._get(`radio.mp3`, params, {}) .then((data) => { - console.log(data); return data; }) .catch((error) => { From e4d0441239ffd3ca3bd9e768968304f62d8eaad9 Mon Sep 17 00:00:00 2001 From: Norbaev Date: Fri, 28 Jun 2024 10:59:36 +0500 Subject: [PATCH 5/6] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D0=BB?= =?UTF-8?q?=20favicon=20=D0=B2=20=D1=84=D0=BE=D1=80=D0=BC=D0=B0=D1=82?= =?UTF-8?q?=D0=B5=20ico=20+=20svg=2016x16?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/.eslintrc.cjs | 2 +- client/src/components/player.vue | 4 +-- client/src/index.template.html | 44 +++++++++++++++++++------------- 3 files changed, 29 insertions(+), 21 deletions(-) diff --git a/client/.eslintrc.cjs b/client/.eslintrc.cjs index 32b5b72..beb304a 100644 --- a/client/.eslintrc.cjs +++ b/client/.eslintrc.cjs @@ -85,6 +85,6 @@ module.exports = { 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off', // Custom - 'no-console': 'warn', + // 'no-console': 'warn', }, }; diff --git a/client/src/components/player.vue b/client/src/components/player.vue index cfb7a93..e1a1587 100644 --- a/client/src/components/player.vue +++ b/client/src/components/player.vue @@ -213,7 +213,7 @@ export default { this.connection = new Player(); this.connection.init(); - this.connection.onHandler(this.getPlaying); + this.connection.onHandler(this.handlePlayer); }, checkSongIsFavorite() { app @@ -236,7 +236,7 @@ export default { console.error(err); }); }, - getPlaying(e) { + handlePlayer(e) { // console.log('getPlaying', e); const jsonData = JSON.parse(e.data); // console.log('jsonData', jsonData); diff --git a/client/src/index.template.html b/client/src/index.template.html index 16eea2c..96a5cf6 100644 --- a/client/src/index.template.html +++ b/client/src/index.template.html @@ -1,20 +1,28 @@ - + - - - - - - - - - - - - - - - -
- + + + + + + + + + + + + + + + +
+ From 08f5022929a4586087c09dd37efaea8380198aa4 Mon Sep 17 00:00:00 2001 From: Norbaev Date: Fri, 28 Jun 2024 11:36:13 +0500 Subject: [PATCH 6/6] =?UTF-8?q?=D0=BF=D0=BE=D0=BF=D1=80=D0=B0=D0=B2=D0=B8?= =?UTF-8?q?=D0=BB=20=D0=BC=D0=B5=D1=82=D0=B0=D1=82=D0=B5=D0=B3=D0=B8=20?= =?UTF-8?q?=D0=BF=D0=BE=D0=B4=20=D1=84=D0=B0=D0=B2=D0=B8=D0=BA=D0=BE=D0=BD?= =?UTF-8?q?=D1=8B,=20=D0=BD=D0=BE=20ico=20=D0=BD=D0=B5=20=D1=82=D1=8F?= =?UTF-8?q?=D0=BD=D0=B5=D1=82=D1=81=D1=8F=20=D0=B2=20prod?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/quasar.config.js | 46 +++++++++++++++++----------------- client/src/index.template.html | 6 ++--- 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/client/quasar.config.js b/client/quasar.config.js index 3937e54..414ef9e 100644 --- a/client/quasar.config.js +++ b/client/quasar.config.js @@ -228,30 +228,30 @@ module.exports = configure(function (ctx) { theme_color: '#027be3', icons: [ { - src: 'icons/icon-128x128.png', - sizes: '128x128', - type: 'image/png', - }, - { - src: 'icons/icon-192x192.png', - sizes: '192x192', - type: 'image/png', - }, - { - src: 'icons/icon-256x256.png', - sizes: '256x256', - type: 'image/png', - }, - { - src: 'icons/icon-384x384.png', - sizes: '384x384', - type: 'image/png', - }, - { - src: 'icons/icon-512x512.png', - sizes: '512x512', - type: 'image/png', + src: 'icons/favicon-16x16.svg', + sizes: '16x16', + type: 'svg', }, + // { + // src: 'icons/icon-192x192.png', + // sizes: '192x192', + // type: 'image/png', + // }, + // { + // src: 'icons/icon-256x256.png', + // sizes: '256x256', + // type: 'image/png', + // }, + // { + // src: 'icons/icon-384x384.png', + // sizes: '384x384', + // type: 'image/png', + // }, + // { + // src: 'icons/icon-512x512.png', + // sizes: '512x512', + // type: 'image/png', + // }, ], }, }, diff --git a/client/src/index.template.html b/client/src/index.template.html index 96a5cf6..0998647 100644 --- a/client/src/index.template.html +++ b/client/src/index.template.html @@ -9,12 +9,12 @@ content="user-scalable=yes, initial-scale=1, maximum-scale=5, minimum-scale=1, width=device-width<% if (ctx.mode.cordova || ctx.mode.capacitor) { %>, viewport-fit=cover<% } %>" /> - +