From 8447eabebeb457830b01c67e32d4201812430949 Mon Sep 17 00:00:00 2001 From: Jair Oliveira Date: Mon, 7 Sep 2026 17:38:42 -0100 Subject: [PATCH] fix(english/mvlempyr): return contract-conformant novel items popularNovels and searchNovels returned the raw cached objects from getAllNovels(), leaking the internal ExtraNovelData fields. That put genres on a NovelItem as a string[], while the contract types it as a comma-separated string on SourceNovel only. Older app versions called genres.split() unguarded when rendering a novel opened from browse, so the array crashed the novel screen with "undefined is not a function". Map both return sites down to {name, path, cover}; filtering and sorting still run on the full objects beforehand. Refs #2437 --- plugins/english/mvlempyr.ts | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/plugins/english/mvlempyr.ts b/plugins/english/mvlempyr.ts index dc7723b0a..6e14966e9 100644 --- a/plugins/english/mvlempyr.ts +++ b/plugins/english/mvlempyr.ts @@ -30,7 +30,7 @@ class MVLEMPYRPlugin implements Plugin.PluginBase { name = 'MVLEMPYR'; icon = 'src/en/mvlempyr/icon.png'; site = 'https://www.mvlempyr.io/'; - version = '1.0.12'; + version = '1.0.13'; _chapSite = 'https://chap.heliosarchive.online/'; _allNovels: (Plugin.NovelItem & ExtraNovelData)[] | undefined; @@ -81,7 +81,11 @@ class MVLEMPYRPlugin implements Plugin.PluginBase { // @ts-ignore const sorted = filtered.sort((a, b) => b[sortKey] - a[sortKey]); - return this.paginate(sorted, pageNo); + return this.paginate(sorted, pageNo).map(({ name, path, cover }) => ({ + name, + path, + cover, + })); } convertNovelId(e: bigint) { @@ -186,7 +190,11 @@ class MVLEMPYRPlugin implements Plugin.PluginBase { novel.name.toLowerCase().includes(searchTerm.toLowerCase()), ); - return this.paginate(searchResults, page); + return this.paginate(searchResults, page).map(({ name, path, cover }) => ({ + name, + path, + cover, + })); } paginate(data: T[], page: number): T[] {