From 7ca9b68edae87ddfa7729ab13727e8f3bd89cf73 Mon Sep 17 00:00:00 2001 From: Fatpandac Date: Thu, 30 Nov 2023 12:49:44 +0800 Subject: [PATCH] feat: support fetch favicon from origin URL --- src/scripts/models/source.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/scripts/models/source.ts b/src/scripts/models/source.ts index 9c858a2..ee0f7e4 100644 --- a/src/scripts/models/source.ts +++ b/src/scripts/models/source.ts @@ -37,6 +37,7 @@ export const enum SourceTextDirection { export class RSSSource { sid: number url: string + originUrl?: string iconurl?: string name: string openTarget: SourceOpenTarget @@ -60,6 +61,7 @@ export class RSSSource { static async fetchMetaData(source: RSSSource) { let feed = await parseRSS(source.url) + source.originUrl = feed.link if (!source.name) { if (feed.title) source.name = feed.title.trim() source.name = source.name || intl.get("sources.untitled") @@ -426,8 +428,8 @@ export function updateFavicon( sids = sids.filter(sid => sid in initSources) } const promises = sids.map(async sid => { - const url = initSources[sid].url - let favicon = (await fetchFavicon(url)) || "" + const { originUrl, url }= initSources[sid] + let favicon = (await fetchFavicon(originUrl || url)) || "" const source = getState().sources[sid] if ( source &&