Add games library with IGDB, file explorer and static files script
This commit is contained in:
1 parent
a16444451a
commit
ec57bd73b3
65 files changed
+2230
-352
No files matched your search
@@ -2,7 +2,7 @@ import { error } from '@sveltejs/kit';
|
||||
import type { Book, BookSeries, BookShelf } from '#lib/content';
|
||||
import { timestamp, type SqlDatabase } from './database';
|
||||
import { hasImage, imageUrl, removeImage, syncImage } from './images';
|
||||
import { readChoice, readHistory, readNumber, readRating, readText, readTextList, type RequestBody } from './input';
|
||||
import { parseList, readChoice, readHistory, readNumber, readRating, readText, readTextList, type RequestBody } from './input';
|
||||
|
||||
interface BookRow {
|
||||
goodreads_id: string;
|
||||
@@ -36,15 +36,6 @@ function coverImageId(goodreadsId: string): string {
|
||||
return `book-${goodreadsId}`;
|
||||
}
|
||||
|
||||
function parseList(text: string): string[] {
|
||||
try {
|
||||
const value = JSON.parse(text);
|
||||
return Array.isArray(value) ? value : [];
|
||||
} catch {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
function seriesOf(row: BookRow): BookSeries | undefined {
|
||||
if (!row.series_name) return undefined;
|
||||
return { name: row.series_name, url: row.series_url ?? '', ...(row.series_position && { position: row.series_position }) };
|
||||
|
||||
Reference in new issue
Block a user