mirror of
https://github.com/FoxxMD/multi-scrobbler.git
synced 2026-10-19 15:26:33 +00:00
fix: scrobble may be undefined
This commit is contained in:
parent
270fb2414e
commit
ae416866f4
2 changed files with 3 additions and 3 deletions
|
|
@ -110,7 +110,7 @@ export type GroupedFixedPlays = TupleMap<DeviceId,PlayUserId,FixedSizeList<Progr
|
|||
|
||||
export interface ScrobbledPlayObject {
|
||||
play: PlayObject
|
||||
scrobble: PlayObjectMinimal
|
||||
scrobble?: PlayObjectMinimal
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -758,7 +758,7 @@ export default abstract class AbstractScrobbleClient extends AbstractComponent i
|
|||
// if no existing transform then we can run cheap db match
|
||||
const cheapExisting = await this.playRepo.checkExisting(playObj, {states: ['scrobbled'], notId: playObjPre.id});
|
||||
if(cheapExisting !== undefined) {
|
||||
const s: ScrobbledPlayObject = {play: cheapExisting.play, scrobble: cheapExisting.play.scrobble?.mergedScrobble!};
|
||||
const s: ScrobbledPlayObject = {play: cheapExisting.play, scrobble: cheapExisting.play.scrobble?.mergedScrobble};
|
||||
return [s, [s]];
|
||||
}
|
||||
}
|
||||
|
|
@ -782,7 +782,7 @@ export default abstract class AbstractScrobbleClient extends AbstractComponent i
|
|||
return [undefined, []];
|
||||
}
|
||||
|
||||
const s: ScrobbledPlayObject = {play: matchPlayDate, scrobble: matchPlayDate.scrobble?.mergedScrobble!};
|
||||
const s: ScrobbledPlayObject = {play: matchPlayDate, scrobble: matchPlayDate.scrobble?.mergedScrobble};
|
||||
|
||||
return [s, [s]];
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue