This commit is contained in:
2025-06-08 16:35:06 +09:00
parent 230b3558b9
commit be026db3d8
20 changed files with 182 additions and 73 deletions

View File

@ -1,6 +1,6 @@
import { Database } from "bun:sqlite";
import fs from "fs";
import crypto from "crypto";
import fs from "fs";
import { config } from "./config.js";
// Database integrity fixes function
@ -275,7 +275,7 @@ export async function saveFeed(
try {
// Check if feed already exists
const existingFeed = await getFeedByUrl(feed.url);
if (existingFeed) {
// Update existing feed
const updateStmt = db.prepare(
@ -293,7 +293,7 @@ export async function saveFeed(
// Create new feed
const id = crypto.randomUUID();
const createdAt = new Date().toISOString();
const insertStmt = db.prepare(
"INSERT INTO feeds (id, url, title, description, last_updated, created_at, active) VALUES (?, ?, ?, ?, ?, ?, ?)",
);
@ -879,7 +879,7 @@ export interface TTSQueueItem {
export async function addToQueue(
itemId: string,
scriptText: string,
retryCount: number = 0,
retryCount = 0,
): Promise<string> {
const id = crypto.randomUUID();
const createdAt = new Date().toISOString();
@ -897,9 +897,7 @@ export async function addToQueue(
}
}
export async function getQueueItems(
limit: number = 10,
): Promise<TTSQueueItem[]> {
export async function getQueueItems(limit = 10): Promise<TTSQueueItem[]> {
try {
const stmt = db.prepare(`
SELECT * FROM tts_queue