diff --git a/src/app.html b/src/app.html index 5ed2f4b..9f237cb 100644 --- a/src/app.html +++ b/src/app.html @@ -1,4 +1,4 @@ - + @@ -54,9 +54,22 @@ color: var(--color-text); background-color: var(--color-bg); - font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, - Ubuntu, Cantarell, 'Helvetica Neue', Helvetica, Arial, sans-serif, 'Apple Color Emoji', - 'Segoe UI Emoji', 'Segoe UI Symbol'; + font-family: + system-ui, + -apple-system, + BlinkMacSystemFont, + 'Segoe UI', + Roboto, + Oxygen-Sans, + Ubuntu, + Cantarell, + 'Helvetica Neue', + Helvetica, + Arial, + sans-serif, + 'Apple Color Emoji', + 'Segoe UI Emoji', + 'Segoe UI Symbol'; } a { diff --git a/src/hooks.server.ts b/src/hooks.server.ts index cabb361..3e65e28 100644 --- a/src/hooks.server.ts +++ b/src/hooks.server.ts @@ -1,9 +1,10 @@ import { log } from '$lib/log'; import { TimelineReader } from '$lib/server/timeline'; -import type { HandleServerError } from '@sveltejs/kit'; +import type { Handle, HandleServerError } from '@sveltejs/kit'; import { error } from '@sveltejs/kit'; import fs from 'fs/promises'; +log.log('App startup'); TimelineReader.init(); export const handleError = (({ error }) => { @@ -16,8 +17,6 @@ export const handleError = (({ error }) => { }; }) satisfies HandleServerError; -import type { Handle } from '@sveltejs/kit'; - export const handle = (async ({ event, resolve }) => { // Reeder *insists* on checking /feed instead of /feed.xml if (event.url.pathname === '/feed') { diff --git a/src/lib/server/db.ts b/src/lib/server/db.ts index a954310..dd7d5dc 100644 --- a/src/lib/server/db.ts +++ b/src/lib/server/db.ts @@ -479,11 +479,11 @@ function saveSongInfoData(postUrl: string, songs: SongInfo[]): Promise { } export async function savePost(post: Post, songs: SongInfo[]) { + log.debug(`Saving post ${post.url}`); if (!databaseReady) { await waitReady(); } - log.debug(`Saving post ${post.url}`); const account = post.account; await saveAccountData(account); log.debug(`Saved account data ${post.url}`); diff --git a/src/lib/server/timeline.ts b/src/lib/server/timeline.ts index 54f040d..ef8309a 100644 --- a/src/lib/server/timeline.ts +++ b/src/lib/server/timeline.ts @@ -224,7 +224,7 @@ export class TimelineReader { accountUrl: accountUrl, file: fn, sizeDescriptor: `${i}x` - } as AccountAvatar) + }) as AccountAvatar ) .then(saveAvatar) ) @@ -261,7 +261,7 @@ export class TimelineReader { file: fn, sizeDescriptor: `${i}x`, kind: kind - } as SongThumbnailImage) + }) as SongThumbnailImage ) .then(saveSongThumbnail) ) @@ -363,6 +363,7 @@ export class TimelineReader { try { const data: TimelineEvent = JSON.parse(event.data.toString()); if (data.event !== 'update') { + log.log('Ignoring ES event', data.event); return; } const post: Post = JSON.parse(data.payload); @@ -410,10 +411,12 @@ export class TimelineReader { } private constructor() { + log.log('Constructing timeline object'); this.startWebsocket(); } public static init() { + log.log('Timeline object init'); if (this._instance === undefined) { this._instance = new TimelineReader(); }