Tags and Faces do not update in saved searches
Submitted by Eric Gregory
Link to original bug (#717725)
Description
---- Reported by eric@yorba.org 2011-08-02 15:50:00 -0700 ----
Original Redmine bug id: 3908
Original URL: http://redmine.yorba.org/issues/3908
Searchable id: yorba-bug-3908
Original author: Eric Gregory
Original description:
From Jim's e-mail:
- I created a saved search for a face containing a string that matched one of my face names. Worked like a charm. Then I added a new face that also matched the face name, but it did not appear in the saved search. Only when I closed Shotwell and ran it again did the photo appear.
---- Additional Comments From shotwell-maint@gnome.bugs 2012-03-26 12:25:00 -0700 ----
History
Comment 1
Updated by Adam Dingle over 2 years ago
- Priority changed from Normal to High
Comment 2
Updated by Adam Dingle over 2 years ago
-
Target version deleted (
<strike>
_0.11_</strike>
)
Comment 3
Updated by Eric Gregory over 2 years ago
-
Assignee deleted (
<strike>
_Eric Gregory_</strike>
)
Comment 4
Updated by Valentín Barros about 2 years ago
- File 0049-Fixed-3908-Tags-and-Faces-do-not-update-in-saved-sea.patch added
- Subject changed from Faces do not update in saved searches to Tags and Faces do not update in saved searches
- Keywords changed from faces to faces, tags
I've found that this also happens with Tags --not only when you add/remove a Tag/Face from a MediaSoruce, also if you rename it the changes aren't reflected.
The problem is that SavedSearchPage only monitors MediaCollections of Photos and Videos, and when you add a Tag/Face to a MediaSoruce, from Shotwell's point of view, the thing that is modified is the Tag/Face, not the MediaSource.
To solve this I've added calls to DataSource.notify_altered/DataCollection.items_altered when a Tag/Face is renamed or added/removed from a MediaSource.
Comment 5
Updated by Adam Dingle about 2 years ago
- Status changed from Open to Review
- Target version set to 0.11.1
Valentin, thanks as always for your work!
Lucas, please review. Given that this affects tags as well as faces, should we consider taking some part of this patch for 0.11.1?
Comment 6
Updated by Jim Nelson about 2 years ago
- Category set to 4
- Assignee set to Jim Nelson
Comment 7
Updated by Jim Nelson about 2 years ago
- Status changed from Review to Open
-
Assignee deleted (
<strike>
_Jim Nelson_</strike>
) - Target version changed from 0.11.1 to 0.12
Hi Valentin,
Thanks for the patch. Unfortunately, this isn't quite right for a number of reasons. For example, the alterations being fired on LibraryPhoto.global assume only photos are affected. This is true for Faces but not Tags. A deeper problem is that this design requires each ContainerSource and ContainerSourceCollection to be cognizant about MediaSources being added and removed requiring specific Alterations being fired; for example, if we add a search based on Events, we would need to add code like this to Events too, and Geographic locations, and so forth. Plus, firing Alterations on each MediaSource has scalability problems. Adding one Photo to a Tag is fine, but if you add 5000 Photos to a Tag, this causes quite a load on Shotwell. (In general, the altered() signal is the most expensive signal to fire in the core unit architecture, because it has so many subscribers and those subscribers have to update their own state.)
What we really want is for the SavedSearchPage to monitor the ContainerSources for additions and removals of MediaSources and then refresh its internal state when necessary. Much like ViewCollection has a monitor_source_collection(), we need the ViewCollection to have a monitor_container_source_collection() (or something like it) that deals with this issue.
The change to make this is out of the scope of 0.11.1. We'll come back to this for 0.12. If you want to keep at it and filing patches, we of course welcome that. Please feel free to ask any questions you might have as well.
Comment 8
Updated by Adam Dingle over 1 year ago
-
Target version deleted (
<strike>
_0.12_</strike>
)
--- Bug imported by chaz@yorba.org 2013-11-25 21:53 UTC ---
This bug was previously known as bug 3908 at http://redmine.yorba.org/show_bug.cgi?id=3908 Imported an attachment (id=262070)
Unknown Component Using default product and component set in Parameters Unknown version " in product shotwell. Setting version to "!unspecified". Unknown milestone "unknown in product shotwell. Setting to default milestone for this product, "---". Setting qa contact to the default for this product. This bug either had no qa contact or an invalid one. Resolution set on an open status. Dropping resolution