Add refresh shelf capability

This commit is contained in:
Rob Walsh
2026-03-05 22:24:42 -07:00
parent 01b59fae9d
commit a564fefd7c
11 changed files with 206 additions and 29 deletions
+4 -1
View File
@@ -118,7 +118,10 @@ export async function processGoodreadsShelves(
const stats = createEmptyStats();
const maxLookups = resolveMaxLookups(options);
const whereClause = options.shelfId ? { id: options.shelfId } : {};
const whereClause: any = {};
if (options.shelfId) whereClause.id = options.shelfId;
if (options.userId) whereClause.userId = options.userId;
const shelves = await prisma.goodreadsShelf.findMany({
where: whereClause,
include: { user: { select: { id: true, plexUsername: true } } },
+4 -1
View File
@@ -39,7 +39,10 @@ export async function processHardcoverShelves(
const stats = createEmptyStats();
const maxLookups = resolveMaxLookups(options);
const whereClause = options.shelfId ? { id: options.shelfId } : {};
const whereClause: any = {};
if (options.shelfId) whereClause.id = options.shelfId;
if (options.userId) whereClause.userId = options.userId;
const shelves = await prisma.hardcoverShelf.findMany({
where: whereClause,
include: { user: { select: { id: true, plexUsername: true } } },
+1
View File
@@ -112,6 +112,7 @@ export interface SyncShelvesPayload extends JobPayload {
scheduledJobId?: string;
shelfId?: string;
shelfType?: 'goodreads' | 'hardcover';
userId?: string;
maxLookupsPerShelf?: number;
}
@@ -39,6 +39,7 @@ export interface ShelfSyncStats {
/** Common sync options */
export interface ShelfSyncOptions {
shelfId?: string;
userId?: string;
maxLookupsPerShelf?: number;
}