Search by track on import is back

This commit is contained in:
Eliot Berriot 2018-02-28 19:03:40 +01:00
parent 46b9c6a1c8
commit 799cc01964
No known key found for this signature in database
GPG Key ID: DD6965E2476E5C27
1 changed files with 21 additions and 12 deletions

View File

@ -103,6 +103,7 @@ export default Vue.extend({
'cover', 'cover',
'mix' 'mix'
], ],
customQuery: '',
time time
} }
}, },
@ -115,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/'
@ -145,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']],
@ -156,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: {