Made verbose output optional

This commit is contained in:
Max Nuding 2023-04-02 10:06:36 +02:00
parent a60c5e7315
commit 81f40101be
Signed by: phlaym
GPG Key ID: A06651BAB6777237
2 changed files with 5 additions and 3 deletions

View File

@ -1,4 +1,6 @@
HASHTAG_FILTER = ichlausche,music,musik,nowplaying,tunetuesday
URL_FILTER = song.link,album.link,youtube.com,youtu.be,spotify.com,music.apple.com,bandcamp.com
YOUTUBE_API_KEY = CHANGE_ME
VERBOSE = false
PUBLIC_REFRESH_INTERVAL = 10000

View File

@ -1,10 +1,11 @@
import { env } from '$env/dynamic/private';
import type { Account, Post, Tag } from '$lib/mastodon/response';
import sqlite3 from 'sqlite3';
const { MODE } = import.meta.env;
const { DEV } = import.meta.env;
const db: sqlite3.Database = new sqlite3.Database('moshingmammut.db');
if (MODE === 'development') {
if (DEV && env.VERBOSE === 'true') {
sqlite3.verbose();
db.on('change', (t, d, table, rowid) => {
console.debug('DB change event', t, d, table, rowid);
@ -180,7 +181,6 @@ export async function getPosts(since: string | null, limit: number) {
} else {
filter_query = 'WHERE posts.created_at > $since';
params.$since = since;
console.debug('Filtering by created_at > ', since);
}
const sql = `SELECT posts.id, posts.content, posts.created_at, posts.url,
accounts.id AS account_id, accounts.acct, accounts.username, accounts.display_name,