Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[enhancement] Counters for total pictures and subalbums #226

Open
norey opened this issue May 1, 2019 · 10 comments · May be fixed by #2504
Open

[enhancement] Counters for total pictures and subalbums #226

norey opened this issue May 1, 2019 · 10 comments · May be fixed by #2504
Assignees
Labels
enhancement New feature or request

Comments

@norey
Copy link

norey commented May 1, 2019

It's good to have a couple more fields in the About view in an album that shows

  • Total number of pictures in current album and all subalbums
  • Total number of subalbums in current album
@kamil4 kamil4 added the enhancement New feature or request label May 1, 2019
@kamil4
Copy link
Contributor

kamil4 commented May 1, 2019

I would actually argue for the total picture count to be displayed in the overlay on top of each album's thumb, like we already do with the title and date (we do display the count for smart albums but not for the regular ones).

The number of subalbums is easy, so long as we are talking about only the direct children of the current album, not recursive subalbums.

The total number of pictures, including in subalbums, strikes me as much harder to implement efficiently than it would seem, though. We currently don't keep track of the count, so either we would need to add such a field to the albums table (and keep it up to date whenever we add/delete/move anything in the album or any of its subalbums) or we would need to calculate it on-the-fly, which could get inefficient pretty quickly for large installations. @ildyria, what do you think?

@ildyria
Copy link
Member

ildyria commented May 1, 2019

The total number of pictures, including in subalbums, strikes me as much harder to implement efficiently than it would seem, though. We currently don't keep track of the count, so either we would need to add such a field to the albums table (and keep it up to date whenever we add/delete/move anything in the album or any of its subalbums) or we would need to calculate it on-the-fly, which could get inefficient pretty quickly for large installations. @ildyria, what do you think?

As usual this is quite a tricky one because it varies in function of the person seing it. Also may "reveal" hidden albums etc.. This is pretty much tied to the sharing system and the thumbnail.

Adding a counter in the album part is not going to work due to the fluctuation (in contrary to last take date field which does not reveal as much info.

@kamil4
Copy link
Contributor

kamil4 commented May 1, 2019

Good point. Frankly, I'm breathing a sigh of relief that a counter in the albums table is not going to work. It struck me as something that would be a royal PITA to get to work reliably.

So the count will have to be generated at run time then. If this is implemented, a config setting may need to be provided to disable this feature for large installations where the overhead could be significant...

@norey
Copy link
Author

norey commented May 1, 2019

What about an on demand button? e.g. "Get number of pictures" that will do the counting when executed by the user. That way, the user waits for it since they already know what they requested which could take some time.

@kamil4
Copy link
Contributor

kamil4 commented May 8, 2019

BTW, the easy part of this request (the count of subalbums) was implemented in LycheeOrg/Lychee-front#94. It is displayed in the info sidebar, along with image and video counts.

@pseudex
Copy link

pseudex commented Feb 22, 2021

today I updated from 4.1 to 4.2.2 and it looks like the counts are gone. Is there a new setting I miss?

@ildyria
Copy link
Member

ildyria commented Feb 22, 2021

today I updated from 4.1 to 4.2.2 and it looks like the counts are gone. Is there a new setting I miss?

Most likely a bug. Can you open a new issue of that as this is unrelated to this one.

@kamil4
Copy link
Contributor

kamil4 commented Feb 22, 2021

Do you mean the counts for smart albums? That was removed as a speed optimization...

@pseudex
Copy link

pseudex commented Feb 22, 2021

I'm talking about the counts on the (Smart) Album covers. I use the tags for marking persons in them. Was interesting to see how many photos are tagged. If it was remove because of speed, why did you remove it also for the recent album? A Select just for a count on photos looked up by an indexed column should be fast enough?

Update: btw. I really love the speed of this program. One of the reason I'm importing my nextlcoud pictures in here and not use "slowcloud"!

@kamil4
Copy link
Contributor

kamil4 commented Feb 22, 2021

To tell you the truth, this was broken semi-accidentally. @ildyria did a huge refactoring of the server code between 4.1 and 4.2, in the process vastly reducing the number of SQL queries performed on the initial load of the albums list (which was a big performance issue for users with many nested albums; it could take 20 seconds or more for that list to be generated on slow servers).

With a refactoring this large, some things inevitably break in the process, and that was the case with the counts. Because we were still in the "must minimize the number of SQL queries" mindset, we figured that simply removing the counts from the few albums that had them was the easiest thing to do.

@ildyria ildyria self-assigned this Dec 28, 2023
@ildyria ildyria linked a pull request Oct 9, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Long term
Development

Successfully merging a pull request may close this issue.

4 participants