diff --git a/src/lib/server/db.ts b/src/lib/server/db.ts index 5dc3131..b606921 100644 --- a/src/lib/server/db.ts +++ b/src/lib/server/db.ts @@ -199,6 +199,11 @@ export async function getPosts(since: string | null, limit: number) { reject(err); return; } + if (rows.length === 0) { + // No need to check for tags + resolve([]); + return; + } const postIdsParams = rows.map(() => '?').join(', '); db.all( `SELECT post_id, tags.url, tags.tag diff --git a/src/lib/server/timeline.ts b/src/lib/server/timeline.ts index 7861929..fe9b8e9 100644 --- a/src/lib/server/timeline.ts +++ b/src/lib/server/timeline.ts @@ -30,7 +30,7 @@ export class TimelineReader { const found_urls = urls.filter(t => post.content.includes(t)); if (found_urls.length === 0 && found_tags.length === 0) { - //return; + return; } const youtubeMatches = found_urls.map(u => u.match(YOUTUBE_REGEX)).filter(i => i !== null);