diff --git a/CHANGELOG b/CHANGELOG index f2705739c095e2246ebb93d9c982998eb7a57138..6e8494425fc1df1d6cad0032239544a0faadebfa 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -3,6 +3,19 @@ Changelog .. towncrier +0.5.4 (2018-02-28) +------------------ + +Features: + +- Now stop running radio when clearing queue (#98) + +Bugfixes: + +- Fixed queue skipping tracks (#91) +- Now loop properly on queue when we only have one track (#95) + + 0.5.3 (2018-02-27) ------------------ diff --git a/api/funkwhale_api/__init__.py b/api/funkwhale_api/__init__.py index 03e434591bb102570ca35cf6602834153901412d..c1f45ffb6db4c5b33c2d560bb3a9ae8e4f987f40 100644 --- a/api/funkwhale_api/__init__.py +++ b/api/funkwhale_api/__init__.py @@ -1,3 +1,3 @@ # -*- coding: utf-8 -*- -__version__ = '0.5.3' +__version__ = '0.5.4' __version_info__ = tuple([int(num) if num.isdigit() else num for num in __version__.replace('-', '.', 1).split('.')]) diff --git a/front/src/components/audio/Track.vue b/front/src/components/audio/Track.vue index e3f1c18b33871f94671c391d16df51ad0b20cb50..370d8ae2d3a6c5a4076c5220f5e6d0f1f7f80e66 100644 --- a/front/src/components/audio/Track.vue +++ b/front/src/components/audio/Track.vue @@ -10,7 +10,7 @@ <source @error="sourceErrored" v-for="src in srcs" - src="src.url" + :src="src.url" :type="src.type"> </audio> </template> @@ -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,13 +98,14 @@ export default { } } }, - updateProgress: function () { + updateProgress: _.throttle(function () { if (this.$refs.audio) { this.$store.dispatch('player/updateProgress', this.$refs.audio.currentTime) } - }, + }, 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 { diff --git a/front/src/components/library/import/FileUpload.vue b/front/src/components/library/import/FileUpload.vue index 1b90adc9d71b2d0425603d0cbb9f98de0b51a905..35338c656170f3329a024d18f390916f74d81355 100644 --- a/front/src/components/library/import/FileUpload.vue +++ b/front/src/components/library/import/FileUpload.vue @@ -1,8 +1,8 @@ <template> <div> - <div v-if="batch" class="ui two buttons"> + <div v-if="batch" class="ui container"> <file-upload-widget - class="ui icon button" + :class="['ui', 'icon', 'left', 'floated', 'button']" :post-action="uploadUrl" :multiple="true" :size="1024 * 1024 * 30" @@ -19,16 +19,18 @@ <i class="upload icon"></i> Select files to upload... </file-upload-widget> - <button class="ui icon teal button" v-if="!$refs.upload || !$refs.upload.active" @click.prevent="$refs.upload.active = true"> + <button + :class="['ui', 'right', 'floated', 'icon', {disabled: files.length === 0}, 'button']" + v-if="!$refs.upload || !$refs.upload.active" @click.prevent="$refs.upload.active = true"> <i class="play icon" aria-hidden="true"></i> Start Upload </button> - <button type="button" class="ui icon yellow button" v-else @click.prevent="$refs.upload.active = false"> + <button type="button" class="ui right floated icon yellow button" v-else @click.prevent="$refs.upload.active = false"> <i class="pause icon" aria-hidden="true"></i> Stop Upload </button> </div> - <div class="ui hidden divider"></div> + <div class="ui hidden clearing divider"></div> <p v-if="batch"> Once all your files are uploaded, simply head over <router-link :to="{name: 'library.import.batches.detail', params: {id: batch.id }}">import detail page</router-link> to check the import status. </p> diff --git a/front/src/components/library/import/Main.vue b/front/src/components/library/import/Main.vue index 0a1cc6df9480366a7105166045e39ffbf91249de..66e16b71f467163cfb9313eaf5f6fa542cec4216 100644 --- a/front/src/components/library/import/Main.vue +++ b/front/src/components/library/import/Main.vue @@ -23,6 +23,18 @@ </div> </a> </div> + <div class="ui hidden divider"></div> + <div class="ui centered buttons"> + <button @click="currentStep -= 1" :disabled="currentStep === 0" class="ui icon button"><i class="left arrow icon"></i> Previous step</button> + <button @click="currentStep += 1" v-if="currentStep < 2" class="ui icon button">Next step <i class="right arrow icon"></i></button> + <button + @click="$refs.import.launchImport()" + v-if="currentStep === 2" + :class="['ui', 'positive', 'icon', {'loading': isImporting}, 'button']" + :disabled="isImporting || importData.count === 0" + >Import {{ importData.count }} tracks <i class="check icon"></i></button> + </div> + <div class="ui hidden divider"></div> <div class="ui attached segment"> <template v-if="currentStep === 0"> <p>First, choose where you want to import the music from :</p> @@ -101,17 +113,6 @@ @import-state-changed="updateImportState" ></component> </div> - <div class="ui hidden divider"></div> - <div class="ui buttons"> - <button @click="currentStep -= 1" :disabled="currentStep === 0" class="ui icon button"><i class="left arrow icon"></i> Previous step</button> - <button @click="currentStep += 1" v-if="currentStep < 2" class="ui icon button">Next step <i class="right arrow icon"></i></button> - <button - @click="$refs.import.launchImport()" - v-if="currentStep === 2" - :class="['ui', 'positive', 'icon', {'loading': isImporting}, 'button']" - :disabled="isImporting || importData.count === 0" - >Import {{ importData.count }} tracks <i class="check icon"></i></button> - </div> </div> </div> <div class="ui vertical stripe segment" v-if="currentRequest"> diff --git a/front/src/components/library/import/TrackImport.vue b/front/src/components/library/import/TrackImport.vue index edd444d92ee071ebbb0946c16badecf21a378346..f6adc5afbbbc77c99cca36ae19b04d1a2c449a7d 100644 --- a/front/src/components/library/import/TrackImport.vue +++ b/front/src/components/library/import/TrackImport.vue @@ -100,8 +100,10 @@ export default Vue.extend({ warnings: [ 'live', 'full', - 'cover' + 'cover', + 'mix' ], + customQuery: '', time } }, @@ -114,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/' @@ -144,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: { diff --git a/front/src/store/player.js b/front/src/store/player.js index 2dc3a7402f29c0f72ed46a36f2b02591330099dc..d849b7b56ceaa80fa93ab30cd2b5654fbcc33a9f 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) diff --git a/front/src/store/queue.js b/front/src/store/queue.js index 1725699d0ba1d78f166fd1177a5168ae83694b04..07263da63315deb04fb7d819037bbd04ff669931 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 3b970647fc163f606adc816e7c3c38848b980443..5439362dc389e1731e65e038a58c247974a816b8 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 } ]