fix: files with no media

This commit is contained in:
ThaUnknown 2022-08-02 13:30:11 +02:00
parent 7934d0df16
commit 9b7975e75f
2 changed files with 2 additions and 2 deletions

View file

@ -1,6 +1,6 @@
{
"name": "Miru",
"version": "2.13.1",
"version": "2.13.2",
"author": "ThaUnknown_ <ThaUnknown@users.noreply.github.com>",
"main": "src/index.js",
"homepage": "https://github.com/ThaUnknown/miru#readme",

View file

@ -31,7 +31,7 @@ export function findInCurrent (obj) {
const oldNowPlaying = get(nowPlaying)
const fileList = get(files)
const targetFile = fileList.find(file => file.media.media.id === obj.media.id && file.media.episode === obj.episode)
const targetFile = fileList.find(file => file.media?.media?.id === obj.media.id && file.media?.episode === obj.episode)
if (!targetFile) return false
if (oldNowPlaying.media.id !== obj.media.id) {
// mediachange, filelist change