Add BookDate card stack animations and thumbnail caching

Implements pure CSS card stack animations for BookDate recommendations, including smooth exit and advance transitions. Adds local caching of library cover thumbnails during scans, updates database schema and API to serve cached covers, and enhances BookDate to support 'favorites' scope with a book picker modal. Updates admin settings validation logic for Prowlarr, improves indexer state management, and documents new features and backend changes.
This commit is contained in:
kikootwo
2026-01-20 17:28:27 -05:00
parent 2d9ed5c76a
commit ac2ad8aac2
33 changed files with 2371 additions and 707 deletions
+18 -13
View File
@@ -8,7 +8,7 @@
import { useState, useEffect } from 'react';
import { useRouter } from 'next/navigation';
import { Header } from '@/components/layout/Header';
import { RecommendationCard } from '@/components/bookdate/RecommendationCard';
import { CardStack } from '@/components/bookdate/CardStack';
import { LoadingScreen } from '@/components/bookdate/LoadingScreen';
import { SettingsWidget } from '@/components/bookdate/SettingsWidget';
@@ -150,13 +150,8 @@ export default function BookDatePage() {
}, 3000);
}
// Move to next recommendation
setCurrentIndex(currentIndex + 1);
// Check if we need to load more recommendations
if (currentIndex + 1 >= recommendations.length) {
// At the end - could auto-load more or show empty state
}
// Note: currentIndex is now incremented in handleSwipeComplete
// after animations finish
} catch (error) {
console.error('Swipe error:', error);
@@ -164,6 +159,16 @@ export default function BookDatePage() {
}
};
const handleSwipeComplete = () => {
// Increment currentIndex after animations complete
setCurrentIndex((prev) => prev + 1);
// Check if we need to load more recommendations
if (currentIndex + 1 >= recommendations.length) {
// At the end - could auto-load more or show empty state
}
};
const handleUndo = async () => {
if (!lastSwipe || lastSwipe.action === 'right') {
return;
@@ -323,8 +328,6 @@ export default function BookDatePage() {
);
}
const currentRec = recommendations[currentIndex];
return (
<div className="min-h-screen bg-gray-50 dark:bg-gray-900">
<Header />
@@ -347,10 +350,12 @@ export default function BookDatePage() {
{currentIndex + 1} / {recommendations.length}
</div>
{/* Recommendation card */}
<RecommendationCard
recommendation={currentRec}
{/* Card Stack */}
<CardStack
recommendations={recommendations}
currentIndex={currentIndex}
onSwipe={handleSwipe}
onSwipeComplete={handleSwipeComplete}
/>
{/* Undo button */}