mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-11-08 05:43:04 +00:00
Optimize subscription author lookup
This commit is contained in:
1 parent
090201e599
commit
bf908c3b05
3 files changed
+159
-5
No files matched your search
@@ -100,11 +100,22 @@ export function createSubscriptionAuthorsSource({ service } = {}) {
|
||||
: () => false,
|
||||
};
|
||||
|
||||
const authorList = Array.from(authors);
|
||||
const hasTargetedLookup =
|
||||
resolvedService &&
|
||||
typeof resolvedService.getActiveVideosByAuthors === "function";
|
||||
|
||||
let videos = [];
|
||||
try {
|
||||
videos = await Promise.resolve(
|
||||
resolvedService.getFilteredActiveVideos(options)
|
||||
);
|
||||
if (hasTargetedLookup) {
|
||||
videos = await Promise.resolve(
|
||||
resolvedService.getActiveVideosByAuthors(authorList, options)
|
||||
);
|
||||
} else {
|
||||
videos = await Promise.resolve(
|
||||
resolvedService.getFilteredActiveVideos(options)
|
||||
);
|
||||
}
|
||||
} catch (error) {
|
||||
context?.log?.(
|
||||
"[subscriptions-source] Failed to resolve videos from nostrService",
|
||||
|
||||
Reference in new issue
Block a user