Skip to content
Snippets Groups Projects
Verified Commit 799cc019 authored by Eliot Berriot's avatar Eliot Berriot
Browse files

Search by track on import is back

parent 46b9c6a1
No related branches found
No related tags found
No related merge requests found
......@@ -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: {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment