Remove ad monetization indicator and explanation from the platform

Remove the `AdExplanation` component and the ad monetization indicator from `VideoCard`. Update the `/api/bunny/stats` and video fetching endpoints to use new `storage.getVideos` and `storage.getVideoCount` methods, returning pagination information.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: d7424866-83d1-4486-a212-ac12b4c7becf
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/8cc42625-c1f5-4e43-99bd-77f2c4dedee2/d7424866-83d1-4486-a212-ac12b4c7becf/JzV8bfS
This commit is contained in:
sebastjanartic 2025-08-28 10:04:50 +00:00
parent 8b694e8a3a
commit c2a3ce12eb
3 changed files with 14 additions and 17 deletions

View File

@ -72,10 +72,7 @@ export default function VideoCard({ video, onClick }: VideoCardProps) {
{formatDuration(video.duration)}
</div>
{/* VAST Ad monetization indicator */}
<div className="absolute top-2 left-2 bg-gradient-to-r from-yellow-500 to-orange-500 text-white text-xs px-2 py-1 rounded-full font-bold shadow-lg">
💰 OGLAS
</div>
{/* Play button overlay */}
<div className="absolute inset-0 bg-black/20 group-hover:bg-black/40 transition-all duration-300 flex items-center justify-center">

View File

@ -4,7 +4,7 @@ import { type Video } from "@shared/schema";
import SearchHeader from "@/components/search-header";
import VideoGrid from "@/components/video-grid";
import AdSettings from "@/components/ad-settings";
import AdExplanation from "@/components/ad-explanation";
interface VideosResponse {
videos: Video[];
@ -18,7 +18,7 @@ export default function Home() {
const [offset, setOffset] = useState(0);
const [allVideos, setAllVideos] = useState<Video[]>([]);
const [showAdSettings, setShowAdSettings] = useState(false);
const [showAdExplanation, setShowAdExplanation] = useState(false);
// Fetch videos
const { data: videosResponse, isLoading, refetch } = useQuery<VideosResponse>({
@ -79,7 +79,6 @@ export default function Home() {
onViewChange={setViewMode}
currentView={viewMode}
onAdSettingsOpen={() => setShowAdSettings(true)}
onAdExplanationOpen={() => setShowAdExplanation(true)}
/>
<main className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8">
@ -98,11 +97,7 @@ export default function Home() {
onClose={() => setShowAdSettings(false)}
/>
{/* Ad Explanation Modal */}
<AdExplanation
isOpen={showAdExplanation}
onClose={() => setShowAdExplanation(false)}
/>
{/* Footer */}
<footer className="bg-bunny-gray/50 border-t border-gray-700 mt-16">

View File

@ -132,8 +132,7 @@ export async function registerRoutes(app: Express): Promise<Server> {
// Bunny.net administration routes
app.get("/api/bunny/stats", async (req, res) => {
try {
const result = await storage.getVideos({ limit: 1000, offset: 0 });
const videos = result?.videos || [];
const videos = await storage.getVideos(1, 1000);
const totalViews = videos.length > 0 ? videos.reduce((sum: number, video: any) => sum + video.views, 0) : 0;
const stats = {
@ -179,10 +178,16 @@ export async function registerRoutes(app: Express): Promise<Server> {
console.log(`Fetching videos: limit=${limit}, offset=${offset}, search=${search}`);
const result = await storage.getVideos({ limit, offset, search });
console.log(`Returning ${result.videos.length} videos`);
const videos = await storage.getVideos(limit, offset, search);
const total = await storage.getVideoCount(search);
res.json(result);
console.log(`Returning ${videos.length} videos`);
res.json({
videos,
total,
hasMore: offset + limit < total
});
} catch (error) {
console.error("Error fetching videos:", error);
res.status(500).json({ message: "Failed to fetch videos" });