pulsejet / memories

Fast, modern and advanced photo management suite. Runs as a Nextcloud app.
https://memories.gallery
GNU Affero General Public License v3.0
2.82k stars 76 forks source link

Showing info for photos with faces takes very long #1127

Closed andreaskoelsch closed 1 month ago

andreaskoelsch commented 1 month ago

Describe the bug When I open a photo in Memories and click the Info button, it takes very long for the info to load. This only occurs for photos with tagged people in them. The more photos of a person exist, the slower the loading. Sometimes, it can take ~2 min for the information to display.

NB: Not sure if this is a problem with Memories, or Recognize. If you think it's an issue with Recognize, please let me know. I will then create an issue there.

To Reproduce Have a person with many detections. Open one of their photos. Click info. Wait...

Screenshots image

Platform:

Additional context Apparently, there's some long-running database query. Any way to speed this up?

MariaDB [(none)]> SHOW PROCESSLIST;
+------+----------+-----------+-----------+---------+------+---------------------+------------------------------------------------------------------------------------------------------+----------+
| Id   | User     | Host      | db        | Command | Time | State               | Info                                                                                                 | Progress |
+------+----------+-----------+-----------+---------+------+---------------------+------------------------------------------------------------------------------------------------------+----------+
| 3913 | ncdbuser | localhost | nextcloud | Query   |  103 | Creating sort index | WITH RECURSIVE oc_cte_folders_all(fileid, name, hidden) AS (
            SELECT f.fileid, f.name,
   |    0.000 |
| 3928 | root     | localhost | NULL      | Query   |    0 | starting            | SHOW PROCESSLIST                                                                                     |    0.000 |
+------+----------+-----------+-----------+---------+------+---------------------+------------------------------------------------------------------------------------------------------+----------+
2 rows in set (0.000 sec)

Any errors in the JS console?

vue.runtime.esm.js:3065 TypeError: Cannot read properties of null (reading 'isFavourited')
    at fn (Sidebar.vue?589a:1:533)
    at Object.a [as subname] (vue.runtime.esm.js:2421:66)
    at o.$ (NcAppSidebar-CSjqjYTb.mjs:578:274)
    at e._render (vue.runtime.esm.js:2700:28)
    at o.r (vue.runtime.esm.js:3891:27)
    at e.get (vue.runtime.esm.js:3462:33)
    at new e (vue.runtime.esm.js:3452:51)
    at e (vue.runtime.esm.js:3908:5)
    at jr.$mount (vue.runtime.esm.js:8797:12)
    at init (vue.runtime.esm.js:4427:19)
vue.runtime.esm.js:3065 TypeError: Cannot read properties of undefined (reading 'focus')
    at o.focus (NcAppSidebar-CSjqjYTb.mjs:510:25)
    at o.mounted (NcAppSidebar-CSjqjYTb.mjs:424:39)
    at un (vue.runtime.esm.js:3033:61)
    at zn (vue.runtime.esm.js:4048:13)
    at Object.insert (vue.runtime.esm.js:4443:13)
    at w (vue.runtime.esm.js:6966:38)
    at wi.nodeOps [as __patch__] (vue.runtime.esm.js:7180:9)
    at e._update (vue.runtime.esm.js:3785:25)
    at o.r (vue.runtime.esm.js:3891:16)
    at e.get (vue.runtime.esm.js:3462:33)
pulsejet commented 1 month ago

Can you try the patch in https://github.com/pulsejet/memories/commit/9d504d4d7f8624b3a6d8078da61debfd8f115231

andreaskoelsch commented 1 month ago

Yes, that works! Awesome, thanks for the quick reaction and fix 👍

Just a general question: As I installed the memories app from the app store and just did a manual code change, will this cause a problem when updating via the app store? Should I revert the change before an update or will it just be overwritten?

pulsejet commented 1 month ago

Don't worry about it. Since the patch is already in master it'll be included in the next release. No need to revert since all files are replaced anyway.