BUG: Memories `video_count` becomes stale after video deletion
メンテナーはふだん 4 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 半日
- 初心者へのやさしさ
- 45/100
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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
- 主要言語
- Python
- スター
- 322
- フォーク
- 793
- 平均マージ
- 6日 9時間
- マージ済み PR(30日)
- 20
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
AOSSIE-Org/PictoPy のほかの issue
-
BUG: Semantic search sees portrait phone photos sideways (SigLIP ignores EXIF orientation)対応中かも @jayssSmm が 1 日前に担当しました。 オープンbug enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
AOSSIE-Org/PictoPy#1780 · コメント 5 件 ·
メンテナーはふだん 4 日以内に返信
-
BUG: Share password loses leading/trailing spaces so the password you set doesn't work対応中かも @swastiksharma45 が 2 日前に担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
AOSSIE-Org/PictoPy#1779 · コメント 2 件 ·
メンテナーはふだん 4 日以内に返信
-
BUG: PROD: Face search shows "No Matches Found" for every empty result, even when AI tagging is off対応中かも @dhruvbit が 3 日前に担当しました。 オープンbug enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
AOSSIE-Org/PictoPy#1770 · コメント 3 件 ·
メンテナーはふだん 4 日以内に返信
-
BUG: Add images to album: success message shows requested count, not number actually added対応中かも @riyanshbhosale が 5 日前に担当しました。 オープンbug enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
AOSSIE-Org/PictoPy#1740 · コメント 4 件 ·
メンテナーはふだん 4 日以内に返信
-
BUG: /sync-folder does not validate the supplied folder_id再び着手できるかも @sathvikn113 が 10 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンbug possible-duplicate
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
AOSSIE-Org/PictoPy#1731 · コメント 5 件 ·
メンテナーはふだん 4 日以内に返信
AOSSIE-Org/PictoPy の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
-
bug help wanted
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
cofade/open-garden-planner#1044 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 68/100
codecrafters-io/build-your-own-x#2126 ·
メンテナーはふだん 5 日以内に返信
-
documentation good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
julianleno/cortai#10 ·
-
difficulty:easy func:python os:windows prio:high type:bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
NatronGitHub/Natron#2029 ·
メンテナーはふだん 1 日以内に返信