Search: Reverse the order in which results are displayed #562

Open
opened 2026-02-19 23:11:01 -05:00 by deekerman · 22 comments
Owner

Originally created by @M4RC02U1F4A4 on GitHub (Dec 7, 2020).

Originally assigned to: @venik-fi, @keif888, @graciousgrey, @M4RC02U1F4A4 on GitHub.

As a user I want to be able to sort search results, albums, folders, moments and states by name in reverse order

Acceptance Criteria:

  • Option to sort by name in reverse order (Z-A) MUST be added to the search
  • Option to sort by name in reverse order (Z-A) MUST be added to all album overviews

I have a lot of files with the wrong metadata, the only thing that allows me to put them in chronological order is the name (I know, not the best)

I have seen that it is possible to "Sort by file name" but this way the recent photos are at the end

It would be nice to be able to order them backwards, as is possible for example with "Newest first" and "Oldest first"

I hope it is a simple thing to add and I hope you can add it, that would be great, for now thanks for the platform you are building

I also noticed that the files saved by Telegram (iOS) do not have an acquisition date, so it is very difficult to sort them except by using the name
And when they are synced (iOS) with Nextcloud or other methods, the date of the sync is used as the creation and last modified date

Originally created by @M4RC02U1F4A4 on GitHub (Dec 7, 2020). Originally assigned to: @venik-fi, @keif888, @graciousgrey, @M4RC02U1F4A4 on GitHub. **As a user I want to be able to sort search results, albums, folders, moments and states by name in reverse order** Acceptance Criteria: - Option to sort by name in reverse order (Z-A) MUST be added to the search - Option to sort by name in reverse order (Z-A) MUST be added to all album overviews -------------------------------------------------------------------------------------------------------------- I have a lot of files with the wrong metadata, the only thing that allows me to put them in chronological order is the name (I know, not the best) I have seen that it is possible to "Sort by file name" but this way the recent photos are at the end It would be nice to be able to order them backwards, as is possible for example with "Newest first" and "Oldest first" I hope it is a simple thing to add and I hope you can add it, that would be great, for now thanks for the platform you are building I also noticed that the files saved by Telegram (iOS) do not have an acquisition date, so it is very difficult to sort them except by using the name And when they are synced (iOS) with Nextcloud or other methods, the date of the sync is used as the creation and last modified date
Author
Owner

@graciousgrey commented on GitHub (Dec 7, 2020):

You are right, we definitely need to improve the handling of those messenger files.

@graciousgrey commented on GitHub (Dec 7, 2020): You are right, we definitely need to improve the handling of those messenger files.
Author
Owner

@layanto commented on GitHub (Apr 26, 2021):

I am having this issue too where imported Whatsapp photos (with file name IMG-yyyymmdd-WAnumber) all went into the same folder in Photoprism (the month and year when I did the import). I wish there is an option in Photoprism where import will skip photos with Date Taken metadata missing. It is much easier to fix the missing metadata outside of Photoprism and then import them then trying to fix them once imported. Especially since Photoprism's import renamed all the files (where the date taken information is stored).

@layanto commented on GitHub (Apr 26, 2021): I am having this issue too where imported Whatsapp photos (with file name IMG-yyyymmdd-WAnumber) all went into the same folder in Photoprism (the month and year when I did the import). I wish there is an option in Photoprism where import will skip photos with Date Taken metadata missing. It is much easier to fix the missing metadata outside of Photoprism and then import them then trying to fix them once imported. Especially since Photoprism's import renamed all the files (where the date taken information is stored).
Author
Owner

@layanto commented on GitHub (Apr 26, 2021):

Or better yet, Photoprism to be smart enough to populate the date metadata in Photoprism based on the filename (prior to renaming the files) on import.

@layanto commented on GitHub (Apr 26, 2021): Or better yet, Photoprism to be smart enough to populate the date metadata in Photoprism based on the filename (prior to renaming the files) on import.
Author
Owner

@lastzero commented on GitHub (Apr 27, 2021):

Or better yet, Photoprism to be smart enough to populate the date metadata in Photoprism based on the filename (prior to renaming the files) on import.

That should be the case, unless the date format string in the file name is not supported.

@lastzero commented on GitHub (Apr 27, 2021): > Or better yet, Photoprism to be smart enough to populate the date metadata in Photoprism based on the filename (prior to renaming the files) on import. That should be the case, unless the date format string in the file name is not supported.
Author
Owner

@graciousgrey commented on GitHub (Nov 2, 2021):

Related: https://github.com/photoprism/photoprism/issues/1102

@graciousgrey commented on GitHub (Nov 2, 2021): Related: https://github.com/photoprism/photoprism/issues/1102
Author
Owner

@ziggysid commented on GitHub (Nov 3, 2024):

Yes please, ability to sort folders in reverse alphabetical order (Z-A) will be fantastic.
I guess like many other people I put my photos in folders named yyyy-mm, the Photoprism default sort order for Folders by name is (A-Z) which puts the oldest dated folders first. Ability to sort in reverse alphabetical order (Z-A) will put the newest dates first.

@ziggysid commented on GitHub (Nov 3, 2024): Yes please, ability to sort folders in reverse alphabetical order (Z-A) will be fantastic. I guess like many other people I put my photos in folders named yyyy-mm, the Photoprism default sort order for Folders by name is (A-Z) which puts the oldest dated folders first. Ability to sort in reverse alphabetical order (Z-A) will put the newest dates first.
Author
Owner

@venik-fi commented on GitHub (Dec 3, 2024):

Hi, I’m experiencing the same issue.
I have a large legacy collection organized into folders named in the yyyy-mm format.

The PhotoPrism folder feature becomes almost unusable without the option to sort folders in reverse alphabetical order.
I have to scroll endlessly and it often loops back to the top, forcing me to repeat the scrolling process again and again...

@venik-fi commented on GitHub (Dec 3, 2024): Hi, I’m experiencing the same issue. I have a large legacy collection organized into folders named in the _yyyy-mm_ format. The PhotoPrism folder feature becomes almost unusable without the option to sort folders in reverse alphabetical order. I have to scroll endlessly and it often loops back to the top, forcing me to repeat the scrolling process again and again...
Author
Owner

@lastzero commented on GitHub (Dec 4, 2024):

We are currently upgrading our frontend component framework to a new major version, which will enable us to implement this and other UI enhancements going forward:

@lastzero commented on GitHub (Dec 4, 2024): We are currently upgrading our frontend component framework to a new major version, which will enable us to implement this and other UI enhancements going forward: - https://github.com/photoprism/photoprism/issues/3168
Author
Owner

@venik-fi commented on GitHub (Apr 7, 2025):

Hi, I’m experiencing the same issue. I have a large legacy collection organized into folders named in the yyyy-mm format.

The PhotoPrism folder feature becomes almost unusable without the option to sort folders in reverse alphabetical order. I have to scroll endlessly and it often loops back to the top, forcing me to repeat the scrolling process again and again...

Hi, @lastzero , do we have updates here?
(add sort by file name in reverse order)
We are still waiting for this relevant and essential improvement.
Thank you in advance

@venik-fi commented on GitHub (Apr 7, 2025): > Hi, I’m experiencing the same issue. I have a large legacy collection organized into folders named in the _yyyy-mm_ format. > > The PhotoPrism folder feature becomes almost unusable without the option to sort folders in reverse alphabetical order. I have to scroll endlessly and it often loops back to the top, forcing me to repeat the scrolling process again and again... Hi, @lastzero , do we have updates here? (add sort by file name in reverse order) We are still waiting for this relevant and essential improvement. Thank you in advance
Author
Owner

@venik-fi commented on GitHub (Apr 7, 2025):

add an image for the sake of clarity

Image

Here is supported date in both order, but not file name in reverse order...

@venik-fi commented on GitHub (Apr 7, 2025): add an image for the sake of clarity ![Image](https://github.com/user-attachments/assets/5a982107-cd57-41e6-ad6f-45bede52ee69) Here is supported date in both order, but not file name in reverse order...
Author
Owner

@venik-fi commented on GitHub (May 21, 2025):

We are currently upgrading our frontend component framework to a new major version, which will enable us to implement this and other UI enhancements going forward:

Hello @lastzero I saw #3168 is closed..
However we still miss the feature to sort folders in reverse alphabetical order..
Managing large collections named in yyyy-mm format is still currently very difficult.
Please don't forget about this feature. Thank you!

@venik-fi commented on GitHub (May 21, 2025): > We are currently upgrading our frontend component framework to a new major version, which will enable us to implement this and other UI enhancements going forward: > > * [Frontend: Upgrade Vuetify from v1.5 to v3.7 #3168](https://github.com/photoprism/photoprism/issues/3168) Hello @lastzero I saw #3168 is closed.. However we still miss the feature to sort folders in reverse alphabetical order.. Managing large collections named in _yyyy-mm_ format is still currently very difficult. Please don't forget about this feature. Thank you!
Author
Owner

@lastzero commented on GitHub (May 22, 2025):

@venik-fi Thanks for the reminder! We'll take care of this as soon as possible.

As publicly announced, we are currently working on batch editing and enhanced AI capabilities. Please also note that the "Frontend: Upgrade Vuetify from v1.5 to v3.7" issue was only for upgrading the frontend component framework. So while it was a prerequisite for adding this feature, it wasn't included in the task (though it did include a lot of other UX improvements).

@lastzero commented on GitHub (May 22, 2025): @venik-fi Thanks for the reminder! We'll take care of this as soon as possible. As publicly announced, we are currently working on batch editing and enhanced AI capabilities. Please also note that the "Frontend: Upgrade Vuetify from v1.5 to v3.7" issue was only for upgrading the frontend component framework. So while it was a prerequisite for adding this feature, it wasn't included in the task (though it did include a lot of other UX improvements).
Author
Owner

@venik-fi commented on GitHub (May 26, 2025):

Thank you, @lastzero! I know the team is working hard and on exciting new features..
Really appreciate that you consider adding this one in the next release.
Thank you in advance!

@venik-fi commented on GitHub (May 26, 2025): Thank you, @lastzero! I know the team is working hard and on exciting new features.. Really appreciate that you consider adding this one in the next release. Thank you in advance!
Author
Owner

@venik-fi commented on GitHub (Jul 12, 2025):

Hello @lastzero,
I saw the latest release, congratulations on the great work!

However, we're still missing proper sorting options for photos and folders, which would be a very helpful addition.
Is this feature still in your roadmap?

Thank you in advance!

@venik-fi commented on GitHub (Jul 12, 2025): Hello @lastzero, I saw the latest release, congratulations on the great work! However, we're still missing proper sorting options for photos and folders, which would be a very helpful addition. Is this feature still in your roadmap? Thank you in advance!
Author
Owner

@lastzero commented on GitHub (Jul 12, 2025):

Thanks again for the reminder! You're absolutely right. Our focus is on finalizing the batch editing feature so that we can release it. However, adding reverse sort shouldn't be difficult, and we should do it. One thing to consider, though, is the ongoing work to add PostgreSQL support, which requires upgrading the database abstraction layer. At a minimum, we should ask the contributor working on it for his opinion and suggestions to avoid merge conflicts.

@lastzero commented on GitHub (Jul 12, 2025): Thanks again for the reminder! You're absolutely right. Our focus is on finalizing the batch editing feature so that we can release it. However, adding reverse sort shouldn't be difficult, and we should do it. One thing to consider, though, is the ongoing work to add PostgreSQL support, which requires upgrading the database abstraction layer. At a minimum, we should ask the contributor working on it for his opinion and suggestions to avoid merge conflicts.
Author
Owner

@keif888 commented on GitHub (Jul 12, 2025):

The good news is that the Order clause is the same for the PostgreSQL branch. Gorm v2 didn't introduce any changes in how ordering works.

As such any changes made should merge in cleanly, without requiring any extra intervention on my part.

I am guessing that the change will be implemented in the searchPhotos function, with an additional sortby case. In the example below that would be sortby.NameDesc.
eg.

	case sortby.Name:
		s = s.Order("photos.photo_path, photos.photo_name, files.time_index")
	case sortby.NameDesc:
		s = s.Order("photos.photo_path DESC, photos.photo_name DESC, files.time_index DESC")

The example above is just an example, and probably not how it will actually end up.

@keif888 commented on GitHub (Jul 12, 2025): The good news is that the Order clause is the same for the PostgreSQL branch. Gorm v2 didn't introduce any changes in how ordering works. As such any changes made **should** merge in cleanly, without requiring any extra intervention on my part. I am guessing that the change will be implemented in the searchPhotos function, with an additional sortby case. In the example below that would be sortby.NameDesc. eg. ``` case sortby.Name: s = s.Order("photos.photo_path, photos.photo_name, files.time_index") case sortby.NameDesc: s = s.Order("photos.photo_path DESC, photos.photo_name DESC, files.time_index DESC") ``` The example above is just an example, and probably not how it will actually end up.
Author
Owner

@lastzero commented on GitHub (Jul 14, 2025):

These changes add a "reverse" query parameter for initial feedback and testing. You can manually add this parameter to the URL in your browser's navigation toolbar when searching for photos or albums, for example:

https://your.instance/library/browse?order=name&reverse=true

Unfortunately, (a) I don't have enough time right now to add a button or toggle to the user interface and (b) the reverse flag is not yet remembered. So, if you go back to the same page or delete the parameter from the URL, the default sorting order will be applied again.

@venik-fi It would be great if you could test the new reverse=true order flag with all the available sort options on the Search and Albums pages to see if the results match your expectations or if additional changes are needed:

  • For example, sorting by name first sorts by path name, and then by file name. However, since only the file name is displayed in the Cards results view, this could be confusing for users.
  • Reverse sorting could also cause performance issues with some order types if it prevents an existing index from being used.

An updated preview build will be available for testing soon:

Thank you very much! 🙏

@lastzero commented on GitHub (Jul 14, 2025): These changes add a "reverse" query parameter for initial feedback and testing. You can manually add this parameter to the URL in your browser's navigation toolbar when searching for photos or albums, for example: ```url https://your.instance/library/browse?order=name&reverse=true ``` Unfortunately, **(a)** I don't have enough time right now to add a button or toggle to the user interface and **(b)** the reverse flag is not yet remembered. So, if you go back to the same page or delete the parameter from the URL, the default sorting order will be applied again. @venik-fi It would be great if you could test the new `reverse=true` order flag with all the available sort options on the **Search** and **Albums** pages to see if the results match your expectations or if additional changes are needed: - For example, sorting by name first sorts by path name, and then by file name. However, since only the file name is displayed in the Cards results view, this could be confusing for users. - Reverse sorting could also cause performance issues with some order types if it prevents an existing index from being used. An updated preview build will be available for testing soon: - https://docs.photoprism.app/release-notes/#development-preview - https://docs.photoprism.app/getting-started/updates/#development-preview **Thank you very much!** 🙏
Author
Owner

@lastzero commented on GitHub (Jul 14, 2025):

A new preview build is now available on Docker Hub, and the release notes have been updated to include this change:

Your feedback is much appreciated so that we can complete the implementation! As mentioned above, you must manually add the reverse=true parameter to the URL in your browser's navigation toolbar to test this, since there is no button or toggle in the user interface yet. Also, the reverse flag is not remembered when you return to the same page.

@lastzero commented on GitHub (Jul 14, 2025): A new preview build is now available on Docker Hub, and the release notes have been updated to include this change: - https://docs.photoprism.app/release-notes/#development-preview Your feedback is much appreciated so that we can complete the implementation! As [mentioned above](https://github.com/photoprism/photoprism/issues/683#issuecomment-3070215533), you must manually add the `reverse=true` parameter to the URL in your browser's navigation toolbar to test this, since there is no button or toggle in the user interface yet. Also, the reverse flag is not remembered when you return to the same page.
Author
Owner

@venik-fi commented on GitHub (Jul 14, 2025):

Hello!

Thank you for the great news and the work done!

I’ve installed the latest preview and tested the reverse=true flag.

Here’s some feedback:

  1. I haven’t experienced any performance issues with approximately 3,000 folders.
  2. The flag works well with all existing sorting options.
  3. The fact that " sorting by name first sorts by path name, and then by file name" from my user perspective is perfect!

What I do miss are exactly the things you anticipated: the fact that the reverse flag isn’t remembered between sessions and that there’s currently no proper toggle for it in the interface.

Looking forward to seeing how this evolves.
Thanks again for the great work!

@venik-fi commented on GitHub (Jul 14, 2025): Hello! Thank you for the great news and the work done! I’ve installed the latest preview and tested the `reverse=true` flag. Here’s some feedback: 1. I haven’t experienced any performance issues with approximately 3,000 folders. 2. The flag works well with all existing sorting options. 3. The fact that " sorting by name first sorts by path name, and then by file name" from my user perspective is perfect! What I do miss are exactly the things you anticipated: the fact that the reverse flag isn’t remembered between sessions and that there’s currently no proper toggle for it in the interface. Looking forward to seeing how this evolves. Thanks again for the great work!
Author
Owner

@keif888 commented on GitHub (Jul 14, 2025):

Changes merged successfully into the PostgreSQL branch with no conflicts, and all unit tests passed against all supported databases.

@keif888 commented on GitHub (Jul 14, 2025): Changes merged successfully into the PostgreSQL branch with no conflicts, and all unit tests passed against all supported databases.
Author
Owner

@venik-fi commented on GitHub (Dec 5, 2025):

Hi All,
with the new update we are able to use order=name&reverse=true, which is great.
However, we currently need to manually add this query parameter to the URL.

Would it be possible in the near future to update the user interface and add a button or toggle for this?

Thank you!

@venik-fi commented on GitHub (Dec 5, 2025): Hi All, with the new update we are able to use order=name&reverse=true, which is great. However, we currently need to manually add this query parameter to the URL. Would it be possible in the near future to update the user interface and add a button or toggle for this? Thank you!
Author
Owner

@graciousgrey commented on GitHub (Dec 7, 2025):

Adding the new sort options to the ui is planned. We will most likely do it together with

@graciousgrey commented on GitHub (Dec 7, 2025): Adding the new sort options to the ui is planned. We will most likely do it together with - #4147
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/photoprism#562
No description provided.