Verified Commit 4530e4f4 authored by Eliot Berriot's avatar Eliot Berriot
Browse files

Merge branch 'release/0.5.4'

parents 98e5fdeb 3b6d474d
...@@ -3,6 +3,19 @@ Changelog ...@@ -3,6 +3,19 @@ Changelog
.. towncrier .. 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) 0.5.3 (2018-02-27)
------------------ ------------------
......
# -*- coding: utf-8 -*- # -*- 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('.')]) __version_info__ = tuple([int(num) if num.isdigit() else num for num in __version__.replace('-', '.', 1).split('.')])
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
<source <source
@error="sourceErrored" @error="sourceErrored"
v-for="src in srcs" v-for="src in srcs"
src="src.url" :src="src.url"
:type="src.type"> :type="src.type">
</audio> </audio>
</template> </template>
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
import {mapState} from 'vuex' import {mapState} from 'vuex'
import url from '@/utils/url' import url from '@/utils/url'
import formats from '@/audio/formats' import formats from '@/audio/formats'
import _ from 'lodash'
// import logger from '@/logging' // import logger from '@/logging'
export default { export default {
...@@ -98,13 +98,14 @@ export default { ...@@ -98,13 +98,14 @@ export default {
} }
} }
}, },
updateProgress: function () { updateProgress: _.throttle(function () {
if (this.$refs.audio) { if (this.$refs.audio) {
this.$store.dispatch('player/updateProgress', this.$refs.audio.currentTime) this.$store.dispatch('player/updateProgress', this.$refs.audio.currentTime)
} }
}, }, 250),
ended: function () { 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.setCurrentTime(0)
this.$refs.audio.play() this.$refs.audio.play()
} else { } else {
......
<template> <template>
<div> <div>
<div v-if="batch" class="ui two buttons"> <div v-if="batch" class="ui container">
<file-upload-widget <file-upload-widget
class="ui icon button" :class="['ui', 'icon', 'left', 'floated', 'button']"
:post-action="uploadUrl" :post-action="uploadUrl"
:multiple="true" :multiple="true"
:size="1024 * 1024 * 30" :size="1024 * 1024 * 30"
...@@ -19,16 +19,18 @@ ...@@ -19,16 +19,18 @@
<i class="upload icon"></i> <i class="upload icon"></i>
Select files to upload... Select files to upload...
</file-upload-widget> </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> <i class="play icon" aria-hidden="true"></i>
Start Upload Start Upload
</button> </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> <i class="pause icon" aria-hidden="true"></i>
Stop Upload Stop Upload
</button> </button>
</div> </div>
<div class="ui hidden divider"></div> <div class="ui hidden clearing divider"></div>
<p v-if="batch"> <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. 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> </p>
......
...@@ -23,6 +23,18 @@ ...@@ -23,6 +23,18 @@
</div> </div>
</a> </a>
</div> </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"> <div class="ui attached segment">
<template v-if="currentStep === 0"> <template v-if="currentStep === 0">
<p>First, choose where you want to import the music from :</p> <p>First, choose where you want to import the music from :</p>
...@@ -101,17 +113,6 @@ ...@@ -101,17 +113,6 @@
@import-state-changed="updateImportState" @import-state-changed="updateImportState"
></component> ></component>
</div> </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> </div>
<div class="ui vertical stripe segment" v-if="currentRequest"> <div class="ui vertical stripe segment" v-if="currentRequest">
......
...@@ -100,8 +100,10 @@ export default Vue.extend({ ...@@ -100,8 +100,10 @@ export default Vue.extend({
warnings: [ warnings: [
'live', 'live',
'full', 'full',
'cover' 'cover',
'mix'
], ],
customQuery: '',
time time
} }
}, },
...@@ -114,7 +116,7 @@ export default Vue.extend({ ...@@ -114,7 +116,7 @@ export default Vue.extend({
$('.ui.checkbox').checkbox() $('.ui.checkbox').checkbox()
}, },
methods: { methods: {
search () { search: function () {
let self = this let self = this
this.isLoading = true this.isLoading = true
let url = 'providers/' + this.currentBackendId + '/search/' let url = 'providers/' + this.currentBackendId + '/search/'
...@@ -144,7 +146,11 @@ export default Vue.extend({ ...@@ -144,7 +146,11 @@ export default Vue.extend({
source: this.importedUrl source: this.importedUrl
} }
}, },
query () { query: {
get: function () {
if (this.customQuery.length > 0) {
return this.customQuery
}
let queryMapping = [ let queryMapping = [
['artist', this.releaseMetadata['artist-credit'][0]['artist']['name']], ['artist', this.releaseMetadata['artist-credit'][0]['artist']['name']],
['album', this.releaseMetadata['title']], ['album', this.releaseMetadata['title']],
...@@ -155,6 +161,10 @@ export default Vue.extend({ ...@@ -155,6 +161,10 @@ export default Vue.extend({
query = query.split('$' + e[0]).join(e[1]) query = query.split('$' + e[0]).join(e[1])
}) })
return query return query
},
set: function (newValue) {
this.customQuery = newValue
}
} }
}, },
watch: { watch: {
......
...@@ -95,7 +95,6 @@ export default { ...@@ -95,7 +95,6 @@ export default {
dispatch('radios/populateQueue', null, {root: true}) dispatch('radios/populateQueue', null, {root: true})
} }
dispatch('queue/next', null, {root: true}) dispatch('queue/next', null, {root: true})
dispatch('queue/next', null, {root: true})
}, },
trackErrored ({commit, dispatch, state}) { trackErrored ({commit, dispatch, state}) {
commit('errored', true) commit('errored', true)
......
...@@ -133,8 +133,8 @@ export default { ...@@ -133,8 +133,8 @@ export default {
} }
}, },
clean ({dispatch, commit}) { clean ({dispatch, commit}) {
dispatch('radios/stop', null, {root: true})
dispatch('player/stop', null, {root: true}) dispatch('player/stop', null, {root: true})
// radios.stop()
commit('tracks', []) commit('tracks', [])
dispatch('currentIndex', -1) dispatch('currentIndex', -1)
// so we replay automatically on next track append // so we replay automatically on next track append
......
...@@ -308,6 +308,7 @@ describe('store/queue', () => { ...@@ -308,6 +308,7 @@ describe('store/queue', () => {
{ type: 'ended', payload: true } { type: 'ended', payload: true }
], ],
expectedActions: [ expectedActions: [
{ type: 'radios/stop', payload: null, options: {root: true} },
{ type: 'player/stop', payload: null, options: {root: true} }, { type: 'player/stop', payload: null, options: {root: true} },
{ type: 'currentIndex', payload: -1 } { type: 'currentIndex', payload: -1 }
] ]
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment