diff --git a/client/src/components/bunny-video-modal.tsx b/client/src/components/bunny-video-modal.tsx index 4957de0..e577968 100644 --- a/client/src/components/bunny-video-modal.tsx +++ b/client/src/components/bunny-video-modal.tsx @@ -102,7 +102,9 @@ export default function BunnyVideoModal({ video, isOpen, onClose, onEdit, videos const handleVideoPlay = async () => { if (video) { try { - await apiRequest("POST", `/api/videos/${video.id}/view`); + // Use short ID for view tracking + const shortId = video.id.replace(/-/g, '').substring(0, 8); + await apiRequest("POST", `/api/videos/${shortId}/view`); } catch (error) { console.error("Failed to track video view:", error); } diff --git a/client/src/components/video-modal.tsx b/client/src/components/video-modal.tsx index f77d4f3..8bebcc3 100644 --- a/client/src/components/video-modal.tsx +++ b/client/src/components/video-modal.tsx @@ -315,7 +315,9 @@ export default function VideoModal({ video, isOpen, onClose, enableAds = true }: const handleVideoPlay = async () => { if (video) { try { - await apiRequest("POST", `/api/videos/${video.id}/view`); + // Use short ID for view tracking + const shortId = video.id.replace(/-/g, '').substring(0, 8); + await apiRequest("POST", `/api/videos/${shortId}/view`); } catch (error) { console.error("Failed to track video view:", error); } diff --git a/client/src/pages/VideoPage.tsx b/client/src/pages/VideoPage.tsx index 0d411ab..899f9c1 100644 --- a/client/src/pages/VideoPage.tsx +++ b/client/src/pages/VideoPage.tsx @@ -261,7 +261,9 @@ export default function VideoPage() { const handleVideoPlay = async () => { if (currentVideo) { try { - await apiRequest("POST", `/api/videos/${currentVideo.id}/view`); + // Use short ID for view tracking + const shortId = currentVideo.id.replace(/-/g, '').substring(0, 8); + await apiRequest("POST", `/api/videos/${shortId}/view`); } catch (error) { console.error("Failed to track video view:", error); }