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

Search: Sort results by "File Size" and "Video Duration" #2620

Closed
maumi opened this issue Aug 17, 2022 · 23 comments
Closed

Search: Sort results by "File Size" and "Video Duration" #2620

maumi opened this issue Aug 17, 2022 · 23 comments
Assignees
Labels
idea Feedback wanted / feature request released Available in the stable release

Comments

@maumi
Copy link

maumi commented Aug 17, 2022

I miss some sorting options for Videos like sort by Duration or sort by Size.
I would love to see that feature

@lastzero lastzero added the idea Feedback wanted / feature request label Aug 17, 2022
@maumi
Copy link
Author

maumi commented Aug 18, 2022

The Code for this is really easy and I did it already. I would also create a PR, but I am to dumb to show it on the frontend.
Maybe anyone is willing to help me. What I did in short:
-Add SortOrderBiggest in entity_const.go
-Add the sort-Case in photos.go
-->I can call it pe by URL call with order=biggest and it works as expected

For the Frontend part I did:
-Add the sorting biggest to frontend/src/dialog/album/edit.vue
-and to frontend/src/component/album/toolbar.vue
-and frontend/src/component/photo/toolbar.vue
-Maybe it was too much but it should at least be visible on the DropDown
-For the localization I also run npm run gettext-extract and added a local. in de.po and then run npm run gettext-compile to build a now translations.json
-For testing purposes I also changed an existing local. in German and rebuild photoprism but even this local. wasn't changed.

I don't run photoprism in docker, I run it like in https://github.com/IndrekHaav/photoprism-debian described

I would be really glad if anyone can point me into the right direction

@maumi
Copy link
Author

maumi commented Aug 20, 2022

Forget my last comment. Got the frontend working.
Issue could be closed if no one else needs that kind of sorting.
Otherwise I could try a PR but only with german and english locale.

@iwanzarembo
Copy link

@maumi I am new to photoprism, but I love your sorting idea. It would also be great if it would be possible to filter for videos in an album as well.

@maumi
Copy link
Author

maumi commented Aug 22, 2022

I think there is no filtering in albums only a sorting. You could sort by length and so Videos will be at the top.

@iwanzarembo
Copy link

iwanzarembo commented Aug 22, 2022 via email

@graciousgrey
Copy link
Member

I think there is no filtering in albums only a sorting.

I am new to photoprism, but I love your sorting idea. It would also be great if it would be possible to filter for videos in an album as well.

In the search section you can use 'album:Holiday type:video' to find all videos that are part of the album with the name Holiday.

https://docs.photoprism.app/user-guide/search/filters/#filter-reference

We do also have an open issue for a search bar in albums.

When it comes to sorting for size and duration, this is of great interest for others as well.
But we need to take care of edge cases e.g. stacks

@maumi
Copy link
Author

maumi commented Aug 22, 2022

Can you explain the edge cases a little bit more?
In my naive understanding is a sorting by size and duration always better than a Photoprism without this sorting, even when it's not perfect in the logic.

@iwanzarembo
Copy link

@graciousgrey I have people who are end users (like my wife and kids) and they are supposed to be able to find videos.
e.g. I have an album with 250 Images and 3 Videos. Now my Kid is navigating to Album -> Select the album and trying to find the 3 Videos beneath the 250 images. But there is no filtering at all. So she has to do it manually, which is really bad.
It is not really user-friendly to learn the search pattern.

@maumi Does the use case make sense to you?

@maumi
Copy link
Author

maumi commented Aug 22, 2022

Sure. Until now I don't use Albums but in the video section it is useful to sort by duration or size.
But it could be strange to sort photos by duration.
I could make a PR so you can pull it for now.

@iwanzarembo
Copy link

sure, I would love to give it a try.

@graciousgrey
Copy link
Member

@iwanzarembo Search box and filter dropdowns in albums are planned. Search filters will also be integrated into the user interface at some point. It's not that we don't want it, but development takes time. Users can do their part and become sponsors :)

In my naive understanding is a sorting by size and duration always better than a Photoprism without this sorting, even when it's not perfect in the logic.

We do not publish features that are not suitable for all use cases, as this leads to a high support effort on our side.

Videos might be stacked and those stacked videos might have different durations/sizes.
This is even important when you want to add the size filter for views that contain photos as well. Photos are often stacked e.g. JPG+JPG, JPG+RAW ...
We need to determine a logic what file size should be used for the sorting.
Feel free to create a PR and label it with work in progress. This way interested people can already pull it. Once we find time for this we can review and test it with more edge cases.

@iwanzarembo
Copy link

@graciousgrey Well I understand that development needs time, but there is always the problem of over engineering if you think too long about a feature 😄.

@lastzero
Copy link
Member

It's not that we think too long, but have too many feature request to deliver all of them instantly.

@maumi
Copy link
Author

maumi commented Aug 24, 2022

@iwanzarembo: PR is created as WIP
@lastzero: just to clarify: I really love photo prism and I think it is impressive what you guys are doing.

@graciousgrey
Copy link
Member

Thank you :)

@lastzero lastzero self-assigned this Oct 14, 2022
lastzero added a commit that referenced this issue Oct 24, 2022
Signed-off-by: Michael Mayer <michael@photoprism.app>
@lastzero lastzero added the please-test Ready for acceptance test label Oct 24, 2022
@lastzero lastzero changed the title Videos: More sorting options Search: Sort results by "File Size" and "Video Duration" Oct 24, 2022
@lastzero
Copy link
Member

You can now test this using our Development Preview and/or Public Demo!

@maumi
Copy link
Author

maumi commented Nov 1, 2022

I've tested in Live Demo.
Just to clarify: you only did a descending sorting for both?
I think to be consequent you should remove "Oldest first" or give other sorting criterias also an ascending sorting.

@lastzero
Copy link
Member

lastzero commented Nov 1, 2022

Why would you want to find the smallest files or the shortest videos? 0 bytes, 0 seconds. Can tell you that without looking it up. It also would not help usability to have a order select as long as the actual result list. But of course it makes sense to sort from oldest to newest and vice versa.

@lastzero
Copy link
Member

lastzero commented Nov 1, 2022

The rationale is that the higher you go, the fewer results there are. Like you would generally not search for the smallest mountain, but for the highest. People with live photos will have a ton of very short videos, potentially thousands. Why even bother sorting them by shortest duration? What is the use case?

@lastzero
Copy link
Member

lastzero commented Nov 1, 2022

If you want to find short videos, filter for live photos and sort them by something useful like oldest or newest. If you want to find very small files and delete them all at once, use terminal commands.

@lastzero
Copy link
Member

lastzero commented Nov 2, 2022

Since there was no further feedback on my last 3 comments (and the commit is 9 days old), we will release it as is. If you feel that you really need to find the shortest videos and smallest files, please open a new feature request and describe what problem this solves and why this would be valuable to many users.

lastzero added a commit that referenced this issue Nov 2, 2022
Signed-off-by: Michael Mayer <michael@photoprism.app>
lastzero added a commit that referenced this issue Nov 2, 2022
Signed-off-by: Michael Mayer <michael@photoprism.app>
@lastzero lastzero added released Available in the stable release and removed please-test Ready for acceptance test labels Nov 2, 2022
@lastzero lastzero closed this as completed Nov 2, 2022
@pippo73
Copy link

pippo73 commented Aug 18, 2023

Hello all,
I've just found this post and even if it is a little bit old, I've decidet to write here. If needed I can open a new 3d.
Actually I'm running Build 230719-73fa7bbe8 on a docker env.
I would like to know if there is some way to sort the by the size or search them with a particular resolution.
I've searched the filter page but I have not found anything like that.
Did I missed something?

thank to all

@graciousgrey
Copy link
Member

graciousgrey commented Aug 18, 2023

You can define the sort order using the sort order filter.

SortOrderFileSize

Searching for a specific resolution or size is not possible at this time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
idea Feedback wanted / feature request released Available in the stable release
Projects
Status: Release 🌈
Development

No branches or pull requests

5 participants