Fix:API get media progress for episode

This commit is contained in:
advplyr 2024-11-24 15:05:19 -06:00
parent f9aaeb3a34
commit 315b21db00

View File

@ -611,7 +611,7 @@ class User extends Model {
*/ */
getOldMediaProgress(libraryItemId, episodeId = null) { getOldMediaProgress(libraryItemId, episodeId = null) {
const mediaProgress = this.mediaProgresses?.find((mp) => { const mediaProgress = this.mediaProgresses?.find((mp) => {
if (episodeId && mp.mediaItemId === episodeId) return true if (episodeId && mp.mediaItemId !== episodeId) return false
return mp.extraData?.libraryItemId === libraryItemId return mp.extraData?.libraryItemId === libraryItemId
}) })
return mediaProgress?.getOldMediaProgress() || null return mediaProgress?.getOldMediaProgress() || null