From 282533786033fa0f3afd6d20052e91f5bba59dca Mon Sep 17 00:00:00 2001 From: Eliot Berriot Date: Tue, 27 Feb 2018 23:38:31 +0100 Subject: [PATCH 01/10] Fixed broken player track url --- front/src/components/audio/Track.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/front/src/components/audio/Track.vue b/front/src/components/audio/Track.vue index e3f1c18b3..ff177e624 100644 --- a/front/src/components/audio/Track.vue +++ b/front/src/components/audio/Track.vue @@ -10,7 +10,7 @@ From af11b735d825682824c06741a5af0e0f4298fae8 Mon Sep 17 00:00:00 2001 From: Eliot Berriot Date: Wed, 28 Feb 2018 17:57:37 +0100 Subject: [PATCH 02/10] Fix #91: queue skipping tracks --- changes/changelog.d/91.bugfix | 0 front/src/store/player.js | 1 - 2 files changed, 1 deletion(-) create mode 100644 changes/changelog.d/91.bugfix diff --git a/changes/changelog.d/91.bugfix b/changes/changelog.d/91.bugfix new file mode 100644 index 000000000..e69de29bb diff --git a/front/src/store/player.js b/front/src/store/player.js index 2dc3a7402..d849b7b56 100644 --- a/front/src/store/player.js +++ b/front/src/store/player.js @@ -95,7 +95,6 @@ export default { dispatch('radios/populateQueue', null, {root: true}) } dispatch('queue/next', null, {root: true}) - dispatch('queue/next', null, {root: true}) }, trackErrored ({commit, dispatch, state}) { commit('errored', true) From e65606fd9de1cba18840dd08a37355d370617582 Mon Sep 17 00:00:00 2001 From: Eliot Berriot Date: Wed, 28 Feb 2018 18:11:13 +0100 Subject: [PATCH 03/10] Throttle track progress for better performance --- front/src/components/audio/Track.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/front/src/components/audio/Track.vue b/front/src/components/audio/Track.vue index ff177e624..e291dae78 100644 --- a/front/src/components/audio/Track.vue +++ b/front/src/components/audio/Track.vue @@ -19,7 +19,7 @@ import {mapState} from 'vuex' import url from '@/utils/url' import formats from '@/audio/formats' - +import _ from 'lodash' // import logger from '@/logging' export default { @@ -98,11 +98,11 @@ export default { } } }, - updateProgress: function () { + updateProgress: _.throttle(function () { if (this.$refs.audio) { this.$store.dispatch('player/updateProgress', this.$refs.audio.currentTime) } - }, + }, 1000), ended: function () { if (this.looping === 1) { this.setCurrentTime(0) From f40eefcd6a944059fed4095a73d286bd81119068 Mon Sep 17 00:00:00 2001 From: Eliot Berriot Date: Wed, 28 Feb 2018 18:16:25 +0100 Subject: [PATCH 04/10] Fix #98: Now stop running radio when clearing queue --- changes/changelog.d/91.bugfix | 1 + changes/changelog.d/98.feature | 0 front/src/store/queue.js | 2 +- front/test/unit/specs/store/queue.spec.js | 1 + 4 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 changes/changelog.d/98.feature diff --git a/changes/changelog.d/91.bugfix b/changes/changelog.d/91.bugfix index e69de29bb..4fde544cf 100644 --- a/changes/changelog.d/91.bugfix +++ b/changes/changelog.d/91.bugfix @@ -0,0 +1 @@ +Fixed queue skipping tracks (#91) diff --git a/changes/changelog.d/98.feature b/changes/changelog.d/98.feature new file mode 100644 index 000000000..e69de29bb diff --git a/front/src/store/queue.js b/front/src/store/queue.js index 1725699d0..07263da63 100644 --- a/front/src/store/queue.js +++ b/front/src/store/queue.js @@ -133,8 +133,8 @@ export default { } }, clean ({dispatch, commit}) { + dispatch('radios/stop', null, {root: true}) dispatch('player/stop', null, {root: true}) - // radios.stop() commit('tracks', []) dispatch('currentIndex', -1) // so we replay automatically on next track append diff --git a/front/test/unit/specs/store/queue.spec.js b/front/test/unit/specs/store/queue.spec.js index 3b970647f..5439362dc 100644 --- a/front/test/unit/specs/store/queue.spec.js +++ b/front/test/unit/specs/store/queue.spec.js @@ -308,6 +308,7 @@ describe('store/queue', () => { { type: 'ended', payload: true } ], expectedActions: [ + { type: 'radios/stop', payload: null, options: {root: true} }, { type: 'player/stop', payload: null, options: {root: true} }, { type: 'currentIndex', payload: -1 } ] From 4eb1d458d5e0db5a32240a9536fc1512938c5c46 Mon Sep 17 00:00:00 2001 From: Eliot Berriot Date: Wed, 28 Feb 2018 18:44:23 +0100 Subject: [PATCH 05/10] Fix #95: Now loop properly on queue when we only have one track --- changes/changelog.d/95.bugfix | 1 + front/src/components/audio/Track.vue | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 changes/changelog.d/95.bugfix diff --git a/changes/changelog.d/95.bugfix b/changes/changelog.d/95.bugfix new file mode 100644 index 000000000..fea5c947a --- /dev/null +++ b/changes/changelog.d/95.bugfix @@ -0,0 +1 @@ +Now loop properly on queue when we only have one track (#95) diff --git a/front/src/components/audio/Track.vue b/front/src/components/audio/Track.vue index e291dae78..370d8ae2d 100644 --- a/front/src/components/audio/Track.vue +++ b/front/src/components/audio/Track.vue @@ -102,9 +102,10 @@ export default { if (this.$refs.audio) { this.$store.dispatch('player/updateProgress', this.$refs.audio.currentTime) } - }, 1000), + }, 250), ended: function () { - if (this.looping === 1) { + let onlyTrack = this.$store.state.queue.tracks.length === 1 + if (this.looping === 1 || (onlyTrack && this.looping === 2)) { this.setCurrentTime(0) this.$refs.audio.play() } else { From 46b9c6a1c8a4ed360af7f98792c1d28a0770830e Mon Sep 17 00:00:00 2001 From: Eliot Berriot Date: Wed, 28 Feb 2018 19:03:12 +0100 Subject: [PATCH 06/10] Added "mix" to the list of highlighted keywords in import --- front/src/components/library/import/TrackImport.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/front/src/components/library/import/TrackImport.vue b/front/src/components/library/import/TrackImport.vue index edd444d92..08ee72cbd 100644 --- a/front/src/components/library/import/TrackImport.vue +++ b/front/src/components/library/import/TrackImport.vue @@ -100,7 +100,8 @@ export default Vue.extend({ warnings: [ 'live', 'full', - 'cover' + 'cover', + 'mix' ], time } From 799cc0196432d7a7518186e5f4616be14fa7ceef Mon Sep 17 00:00:00 2001 From: Eliot Berriot Date: Wed, 28 Feb 2018 19:03:40 +0100 Subject: [PATCH 07/10] Search by track on import is back --- .../components/library/import/TrackImport.vue | 33 ++++++++++++------- 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/front/src/components/library/import/TrackImport.vue b/front/src/components/library/import/TrackImport.vue index 08ee72cbd..f6adc5afb 100644 --- a/front/src/components/library/import/TrackImport.vue +++ b/front/src/components/library/import/TrackImport.vue @@ -103,6 +103,7 @@ export default Vue.extend({ 'cover', 'mix' ], + customQuery: '', time } }, @@ -115,7 +116,7 @@ export default Vue.extend({ $('.ui.checkbox').checkbox() }, methods: { - search () { + search: function () { let self = this this.isLoading = true let url = 'providers/' + this.currentBackendId + '/search/' @@ -145,17 +146,25 @@ export default Vue.extend({ source: this.importedUrl } }, - query () { - let queryMapping = [ - ['artist', this.releaseMetadata['artist-credit'][0]['artist']['name']], - ['album', this.releaseMetadata['title']], - ['title', this.metadata['recording']['title']] - ] - let query = this.customQueryTemplate - queryMapping.forEach(e => { - query = query.split('$' + e[0]).join(e[1]) - }) - return query + query: { + get: function () { + if (this.customQuery.length > 0) { + return this.customQuery + } + let queryMapping = [ + ['artist', this.releaseMetadata['artist-credit'][0]['artist']['name']], + ['album', this.releaseMetadata['title']], + ['title', this.metadata['recording']['title']] + ] + let query = this.customQueryTemplate + queryMapping.forEach(e => { + query = query.split('$' + e[0]).join(e[1]) + }) + return query + }, + set: function (newValue) { + this.customQuery = newValue + } } }, watch: { From 7561f4dddf45db134eff685d97ac71d9134c1940 Mon Sep 17 00:00:00 2001 From: Eliot Berriot Date: Wed, 28 Feb 2018 19:21:06 +0100 Subject: [PATCH 08/10] Prettier file upload form --- front/src/components/library/import/FileUpload.vue | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/front/src/components/library/import/FileUpload.vue b/front/src/components/library/import/FileUpload.vue index 1b90adc9d..35338c656 100644 --- a/front/src/components/library/import/FileUpload.vue +++ b/front/src/components/library/import/FileUpload.vue @@ -1,8 +1,8 @@