BUG: Memories `video_count` becomes stale after video deletion
I maintainer di solito rispondono entro 4 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- Mezza giornata
- Idoneità per principianti
- 45/100
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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
- Lingua principale
- Python
- Stelle
- 322
- Fork
- 793
- Merge medio
- 6g 9h
- PR unite (30g)
- 20
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di AOSSIE-Org/PictoPy
-
BUG: Semantic search sees portrait phone photos sideways (SigLIP ignores EXIF orientation)Forse già presa @jayssSmm l’ha presa 1 giorno fa. Apertabug enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
AOSSIE-Org/PictoPy#1780 · 5 commenti ·
I maintainer di solito rispondono entro 4 giorni
-
BUG: Share password loses leading/trailing spaces so the password you set doesn't workForse già presa @swastiksharma45 l’ha presa 2 giorni fa. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
AOSSIE-Org/PictoPy#1779 · 2 commenti ·
I maintainer di solito rispondono entro 4 giorni
-
BUG: PROD: Face search shows "No Matches Found" for every empty result, even when AI tagging is offForse già presa @dhruvbit l’ha presa 3 giorni fa. Apertabug enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
AOSSIE-Org/PictoPy#1770 · 3 commenti ·
I maintainer di solito rispondono entro 4 giorni
-
BUG: Add images to album: success message shows requested count, not number actually addedForse già presa @riyanshbhosale l’ha presa 5 giorni fa. Apertabug enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
AOSSIE-Org/PictoPy#1740 · 4 commenti ·
I maintainer di solito rispondono entro 4 giorni
-
BUG: /sync-folder does not validate the supplied folder_idForse di nuovo libera @sathvikn113 l’ha presa 10 giorni fa e non c’è nessuna pull request aperta. Apertabug possible-duplicate
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
AOSSIE-Org/PictoPy#1731 · 5 commenti ·
I maintainer di solito rispondono entro 4 giorni
Tutte le issue di AOSSIE-Org/PictoPy
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
bad-antics/lateralus-lang#1140 ·
I maintainer di solito rispondono entro 4 giorni
-
Groq: SQL fallback call sends tools with response_format, so a failed tool loop never recoversApertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 3 giorni
-
fixture good first issue help wanted vendor:cisco
Difficoltà 1/5 1-3 ore Idoneità per principianti 85/100