BUG: Favourite videos are not displayed in the Favourites page
Is there an existing issue for this?
- [x] I have searched the existing issues
What happened?
Videos can be marked as favourites successfully, but favourited videos do not appear in the Favourites page.
Problem Statement
PictoPy supports favouriting both images and videos. The favourite status for videos is correctly persisted in the backend, and the frontend already provides the required API, Redux state, and UI support for toggling a video's favourite status.
However, the Favourites page currently only loads and filters images. Because videos are not fetched or passed to the Favourites gallery, a video that has been successfully marked as a favourite is missing from the Favourites page.
This makes the favourite functionality inconsistent between images and videos.
Current Behavior
- Open PictoPy and navigate to a video.
- Hover over the video and use the favourite action.
- The video is successfully marked as favourite.
- Navigate to the Favourites page.
- The favourited video does not appear.
- Favourited images are displayed normally.
Expected Behavior
The Favourites page should display both favourited images and favourited videos.
A video marked as favourite should appear in the Favourites page until it is unfavourited.
Technical Details
The backend already supports favourite status for videos.
The videos table contains isFavourite BOOLEAN DEFAULT 0.
The backend also provides db_toggle_video_favourite_status(video_id: str), which updates the video's isFavourite value.
The frontend also supports video favourites through updateVideoFavoriteStatus(...).
The existing video API provides fetchAllVideos() and toggleVideoFav(...).
The VideoCard component also contains the existing favourite action and uses video.isFavourite.
Therefore, the issue is not with storing or toggling the video's favourite status.
Root Cause
The issue is in:
frontend/src/pages/Home/MyFav.tsx
The Favourites page currently fetches only images using fetchAllImages().
It then filters only the image list:
const favouriteImages = useMemo(() => images.filter((image) => image.isFavourite === true), [images]);
The resulting list is passed to the image-only ChronologicalGallery.
There is currently no equivalent fetchAllVideos() call or filtering of favourited videos in the Favourites page.
Impact
Users can successfully favourite videos, but cannot find those favourited videos from the Favourites page.
This creates inconsistent behaviour:
- Favourite image → appears in Favourites ✅
- Favourite video → does not appear in Favourites ❌
This may also make users think that their video favourite action was not saved, even though the favourite status is persisted correctly.
Proposed Solution
Update the existing Favourites page to fetch and display both favourite images and favourite videos.
A simple UI approach would be to keep the existing Favourites page and add two sections:
Favourite Images
Display the existing favourited images using the current image gallery.
Favourite Videos
Display favourited videos using the existing video gallery/card components.
This keeps the existing image and video gallery implementations separate while making both types of favourited media accessible from the same Favourites page.
The existing backend favourite functionality, video API, VideoCard, and video state management can be reused without changing their existing behaviour.
Acceptance Criteria
- [ ] Favourited images continue to appear in the Favourites page.
- [ ] Favourited videos appear in the Favourites page.
- [ ] Unfavouriting a video removes it from the Favourites page.
- [ ] Unfavouriting an image continues to remove it from the Favourites page.
- [ ] Existing image and video favourite functionality is not broken.
- [ ] If there are no favourited images or videos, an appropriate empty state is displayed.
Screenshot
I would like to work on this issue
Please review and assign it to me if appropriate. I’ll wait for maintainer confirmation before opening a PR.
Record
- [x] I agree to follow this project's Code of Conduct
👋 Thanks for opening this issue! The maintainers will review it shortly. Till then, do not open any PR. This is a strict rule we like to follow around here :)
@rohan-pandeyy Can I work on this ?