diff --git a/client/src/components/search-header.tsx b/client/src/components/search-header.tsx index b36931b..ee9a574 100644 --- a/client/src/components/search-header.tsx +++ b/client/src/components/search-header.tsx @@ -6,19 +6,13 @@ import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@ interface SearchHeaderProps { onSearch: (query: string) => void; - onCategoryChange: (category: string) => void; - onSortChange: (sort: string) => void; onViewChange: (view: "grid" | "list") => void; - categories: string[]; currentView: "grid" | "list"; } export default function SearchHeader({ onSearch, - onCategoryChange, - onSortChange, onViewChange, - categories, currentView }: SearchHeaderProps) { const [searchQuery, setSearchQuery] = useState(""); @@ -79,61 +73,33 @@ export default function SearchHeader({

Streaming from Bunny.net CDN

-
- - - - -
- - -
+
+ +
diff --git a/client/src/pages/home.tsx b/client/src/pages/home.tsx index ac6a8d0..af9c65e 100644 --- a/client/src/pages/home.tsx +++ b/client/src/pages/home.tsx @@ -12,25 +12,16 @@ interface VideosResponse { export default function Home() { const [searchQuery, setSearchQuery] = useState(""); - const [selectedCategory, setSelectedCategory] = useState("All Categories"); - const [sortBy, setSortBy] = useState("latest"); const [viewMode, setViewMode] = useState<"grid" | "list">("grid"); const [offset, setOffset] = useState(0); const [allVideos, setAllVideos] = useState([]); - // Fetch categories - const { data: categories = [] } = useQuery({ - queryKey: ["/api/categories"], - }); - // Fetch videos const { data: videosResponse, isLoading, refetch } = useQuery({ queryKey: ["/api/videos", { limit: 20, offset, - search: searchQuery || undefined, - category: selectedCategory !== "All Categories" ? selectedCategory : undefined, - sort: sortBy + search: searchQuery || undefined }], queryFn: async ({ queryKey }) => { const [, params] = queryKey as [string, any]; @@ -61,42 +52,27 @@ export default function Home() { } }, [videosResponse, offset]); - // Reset videos when search/filter changes + // Reset videos when search changes const handleSearch = (query: string) => { setSearchQuery(query); setOffset(0); setAllVideos([]); }; - const handleCategoryChange = (category: string) => { - setSelectedCategory(category); - setOffset(0); - setAllVideos([]); - }; - - const handleSortChange = (sort: string) => { - setSortBy(sort); - setOffset(0); - setAllVideos([]); - }; - const handleLoadMore = () => { setOffset(prev => prev + 20); }; - // Force refetch when filters change + // Force refetch when search changes useEffect(() => { refetch(); - }, [searchQuery, selectedCategory, sortBy, offset, refetch]); + }, [searchQuery, offset, refetch]); return (
diff --git a/server/routes.ts b/server/routes.ts index 2c7a230..ff022c8 100644 --- a/server/routes.ts +++ b/server/routes.ts @@ -10,10 +10,9 @@ export async function registerRoutes(app: Express): Promise { const limit = parseInt(req.query.limit as string) || 20; const offset = parseInt(req.query.offset as string) || 0; const search = req.query.search as string; - const category = req.query.category as string; - const videos = await storage.getVideos(limit, offset, search, category); - const total = await storage.getVideoCount(search, category); + const videos = await storage.getVideos(limit, offset, search); + const total = await storage.getVideoCount(search); res.json({ videos, @@ -48,17 +47,7 @@ export async function registerRoutes(app: Express): Promise { } }); - // Get video categories - app.get("/api/categories", async (req, res) => { - try { - const videos = await storage.getVideos(1000); - const categories = Array.from(new Set(videos.map(v => v.category).filter(Boolean))); - res.json(categories); - } catch (error) { - console.error("Error fetching categories:", error); - res.status(500).json({ message: "Failed to fetch categories" }); - } - }); + const httpServer = createServer(app); return httpServer; diff --git a/server/storage.ts b/server/storage.ts index 664fd8d..dfb4daa 100644 --- a/server/storage.ts +++ b/server/storage.ts @@ -3,11 +3,11 @@ import { randomUUID } from "crypto"; import { BunnyService } from "./bunny"; export interface IStorage { - getVideos(limit?: number, offset?: number, search?: string, category?: string): Promise; + getVideos(limit?: number, offset?: number, search?: string): Promise; getVideo(id: string): Promise