Change the way trackId and albumId are set.
This commit is contained in:
parent
eac6ce7269
commit
00b24efdc5
1 changed files with 4 additions and 4 deletions
|
@ -60,8 +60,8 @@ export function findMatchesAsync(share) {
|
|||
console.log(match)
|
||||
if (match.id) {
|
||||
models.match.create({
|
||||
trackId: share.albumName ? share.id : null,
|
||||
albumId: share.albumName ? null : share.id,
|
||||
trackId: share.$modelOptions.name.singular == 'track' ? share.id : null,
|
||||
albumId: share.$modelOptions.name.singular == 'album' ? share.id : null,
|
||||
externalId: match.id,
|
||||
service: match.service,
|
||||
name: match.name,
|
||||
|
@ -72,8 +72,8 @@ export function findMatchesAsync(share) {
|
|||
});
|
||||
} else {
|
||||
models.match.create({
|
||||
trackId: share.trackId ? share.id : null,
|
||||
albumId: share.albumId ? share.id : null,
|
||||
trackId: share.$modelOptions.name.singular == 'track' ? share.id : null,
|
||||
albumId: share.$modelOptions.name.singular == 'album' ? share.id : null,
|
||||
externalId: null,
|
||||
service: match.service,
|
||||
name: null,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue