BUG: Memories `video_count` becomes stale after video deletion
Maintainer thường phản hồi trong vòng 4 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- Nửa ngày
- Mức phù hợp với người mới
- 45/100
Hướng nghiên cứu
Start with the memory read queries and the _with_live_count() helper, which already compute live_image_count and map it to image_count; video_count has no matching live calculation. Check how memory_videos is joined in those queries, then add a live_video_count the same way. Done means that fetching a memory after its only video is deleted returns video_count of 0, and the regression tests for single, multiple, empty and mixed image/video memories pass.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Description
The video_count returned by Smart Memories API endpoints can become stale after videos are deleted from the library.
When a video associated with a memory is deleted, the corresponding entry in memory_videos is removed through the database's foreign-key cascade. However, the memory API continues returning the previously stored video_count instead of the actual number of associated videos.
Steps to Reproduce
- Create a memory containing one or more videos.
- Note the memory's
video_countthrough the memories API. - Delete the associated video(s) from the library.
- Fetch the memory again using the memories API.
Expected Behavior
The API should return the current number of videos associated with the memory.
For example, after deleting the only associated video:
videosshould be an empty array.video_countshould be0.
Actual Behavior
The videos array correctly reflects the deletion, but video_count can retain its previous value.
For example:
videos: []video_count: 1
Root Cause
The database read queries calculate live_image_count dynamically and _with_live_count() maps it to image_count.
However, there was no corresponding live_video_count calculation or mapping. Consequently, video_count continued using its stored creation-time value.
Proposed Fix
Calculate live_video_count from the memory_videos association table in memory read queries and use that value when constructing API responses.
Verification
A fix has been implemented and tested locally.
- Regression tests cover single-video deletion, multiple videos, empty-video memories, and mixed image/video memories.
- Backend tests: 1,643 passed.
- Frontend tests: 488 passed.
- Ruff and Black checks passed.
Related Implementation
Fork: https://github.com/aakashkumarrr08-art/PictoPy
Branch: fix/memory-live-video-count
Commit: d4c891a3f4cec255793cf89e2aab3dfd060ac65a
- Ngôn ngữ chính
- Python
- Star
- 322
- Fork
- 793
- Merge trung bình
- 6 ngày 9 giờ
- Pull request đã merge (30 ngày)
- 20
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của AOSSIE-Org/PictoPy
-
BUG: Semantic search sees portrait phone photos sideways (SigLIP ignores EXIF orientation)Có thể đã có người làm @jayssSmm đã nhận 1 ngày trước. Đang mởbug enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
AOSSIE-Org/PictoPy#1780 · 5 bình luận ·
Maintainer thường phản hồi trong vòng 4 ngày
-
BUG: Share password loses leading/trailing spaces so the password you set doesn't workCó thể đã có người làm @swastiksharma45 đã nhận 2 ngày trước. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
AOSSIE-Org/PictoPy#1779 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 4 ngày
-
BUG: PROD: Face search shows "No Matches Found" for every empty result, even when AI tagging is offCó thể đã có người làm @dhruvbit đã nhận 3 ngày trước. Đang mởbug enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
AOSSIE-Org/PictoPy#1770 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 4 ngày
-
BUG: Add images to album: success message shows requested count, not number actually addedCó thể đã có người làm @riyanshbhosale đã nhận 5 ngày trước. Đang mởbug enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
AOSSIE-Org/PictoPy#1740 · 4 bình luận ·
Maintainer thường phản hồi trong vòng 4 ngày
-
BUG: /sync-folder does not validate the supplied folder_idCó thể làm lại được @sathvikn113 đã nhận 10 ngày trước và không có pull request nào đang mở. Đang mởbug possible-duplicate
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
AOSSIE-Org/PictoPy#1731 · 5 bình luận ·
Maintainer thường phản hồi trong vòng 4 ngày
Tất cả issue của AOSSIE-Org/PictoPy
Issue tương tự
-
S2-12 Atualizar README.mdĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
-
bug help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
cofade/open-garden-planner#1044 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
python-commandline-toolsĐang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 68/100
codecrafters-io/build-your-own-x#2126 ·
Maintainer thường phản hồi trong vòng 5 ngày
-
documentation good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
julianleno/cortai#10 ·
-
difficulty:easy func:python os:windows prio:high type:bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
NatronGitHub/Natron#2029 ·
Maintainer thường phản hồi trong vòng 1 ngày