Search by track on import is back
This commit is contained in:
parent
46b9c6a1c8
commit
799cc01964
|
@ -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,17 +146,25 @@ export default Vue.extend({
|
||||||
source: this.importedUrl
|
source: this.importedUrl
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
query () {
|
query: {
|
||||||
let queryMapping = [
|
get: function () {
|
||||||
['artist', this.releaseMetadata['artist-credit'][0]['artist']['name']],
|
if (this.customQuery.length > 0) {
|
||||||
['album', this.releaseMetadata['title']],
|
return this.customQuery
|
||||||
['title', this.metadata['recording']['title']]
|
}
|
||||||
]
|
let queryMapping = [
|
||||||
let query = this.customQueryTemplate
|
['artist', this.releaseMetadata['artist-credit'][0]['artist']['name']],
|
||||||
queryMapping.forEach(e => {
|
['album', this.releaseMetadata['title']],
|
||||||
query = query.split('$' + e[0]).join(e[1])
|
['title', this.metadata['recording']['title']]
|
||||||
})
|
]
|
||||||
return query
|
let query = this.customQueryTemplate
|
||||||
|
queryMapping.forEach(e => {
|
||||||
|
query = query.split('$' + e[0]).join(e[1])
|
||||||
|
})
|
||||||
|
return query
|
||||||
|
},
|
||||||
|
set: function (newValue) {
|
||||||
|
this.customQuery = newValue
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
|
Loading…
Reference in New Issue