navidrome/persistence
Deluan Quintão e3aec6d2a9
feat(ui): implement RecentlyAddedByModTime support for tracks (#4046) (#4279)
* fix: implement RecentlyAddedByModTime support for mediafiles

Fixes #4046 by adding recently_added sort mapping to MediaFileRepository that respects the RecentlyAddedByModTime configuration setting. Previously, this feature only worked for albums, causing inconsistent behavior when clients requested tracks sorted by 'recently added'.

Changes include:
- Add mediaFileRecentlyAddedSort() function that returns 'updated_at' when RecentlyAddedByModTime=true, 'created_at' otherwise
- Add 'recently_added' sort mapping to mediafile repository
- Add comprehensive tests to verify both configuration scenarios

This ensures consistent sorting behavior between albums and tracks when using the RecentlyAddedByModTime feature.

* fix: update createdAt field to sort by recently added

Modified the createdAt field in the SongList component to include a sortBy
attribute set to "recently_added". This change ensures that the media files
are displayed in the order they were added, improving the user experience
when browsing through recently added items.

Signed-off-by: Deluan <deluan@navidrome.org>

* better testing

Signed-off-by: Deluan <deluan@navidrome.org>

---------

Signed-off-by: Deluan <deluan@navidrome.org>
2025-06-30 09:14:35 -04:00
..
album_repository.go fix(scanner): optimize refresh (#4059) 2025-05-14 20:47:03 -04:00
album_repository_test.go feat(server): add Role filters to albums (#3829) 2025-03-14 21:43:52 -04:00
artist_repository.go feat(server): expose main credit stat to reflect only album artist | artist credit (#4268) 2025-06-28 19:00:13 -04:00
artist_repository_test.go test: add tests for filtering artists by role 2025-05-29 15:44:27 -04:00
collation_test.go revert: separation of write and read DBs 2024-11-19 18:41:50 -05:00
export_test.go feat(bfr): Big Refactor: new scanner, lots of new fields and tags, improvements and DB schema changes (#2709) 2025-02-19 20:35:17 -05:00
folder_repository.go feat(scanner): add folder hash for smarter quick scan change detection (#4220) 2025-06-12 13:17:34 -04:00
genre_repository.go feat(bfr): Big Refactor: new scanner, lots of new fields and tags, improvements and DB schema changes (#2709) 2025-02-19 20:35:17 -05:00
helpers.go fix(scanner): optimize refresh (#4059) 2025-05-14 20:47:03 -04:00
helpers_test.go feat(bfr): Big Refactor: new scanner, lots of new fields and tags, improvements and DB schema changes (#2709) 2025-02-19 20:35:17 -05:00
library_repository.go fix(scanner): filter folders by num_audio_files to ensure accurate statistics 2025-06-23 10:26:26 -04:00
library_repository_test.go feat(scanner): add library stats to DB (#4229) 2025-06-14 15:58:33 -04:00
mediafile_repository.go feat(ui): implement RecentlyAddedByModTime support for tracks (#4046) (#4279) 2025-06-30 09:14:35 -04:00
mediafile_repository_test.go feat(ui): implement RecentlyAddedByModTime support for tracks (#4046) (#4279) 2025-06-30 09:14:35 -04:00
persistence.go refactor: rename chain package to run and update references 2025-06-14 17:19:06 -04:00
persistence_suite_test.go fix: Allow nullable ReplayGain and support 0.0 (#4239) 2025-06-17 12:02:25 -04:00
persistence_test.go fix(server): play queue should not return empty entries for deleted tracks 2024-09-20 11:22:37 -04:00
player_repository.go fix(insights): fix issues and improve reports (#3558) 2024-12-18 20:37:35 -05:00
player_repository_test.go revert: separation of write and read DBs 2024-11-19 18:41:50 -05:00
playlist_repository.go feat(ui): add 'Show in Playlist' context menu (#4139) 2025-05-30 21:26:35 -04:00
playlist_repository_test.go feat(ui): add 'Show in Playlist' context menu (#4139) 2025-05-30 21:26:35 -04:00
playlist_track_repository.go feat(ui): add song Love and Rating functionality to playlist view (#4134) 2025-06-04 20:38:28 -04:00
playqueue_repository.go fix(server): ensure single record per user by reusing existing playqueue ID 2025-06-11 17:26:13 -04:00
playqueue_repository_test.go fix(server): ensure single record per user by reusing existing playqueue ID 2025-06-11 17:26:13 -04:00
property_repository.go Replace beego/orm with dbx (#2693) 2023-12-09 13:52:17 -05:00
property_repository_test.go revert: separation of write and read DBs 2024-11-19 18:41:50 -05:00
radio_repository.go feat(bfr): Big Refactor: new scanner, lots of new fields and tags, improvements and DB schema changes (#2709) 2025-02-19 20:35:17 -05:00
radio_repository_test.go revert: separation of write and read DBs 2024-11-19 18:41:50 -05:00
scrobble_buffer_repository.go fix(server): send artist mbids when scrobbling to ListenBrainz 2025-02-23 13:30:39 -05:00
scrobble_buffer_repository_test.go feat(plugins): experimental support for plugins (#3998) 2025-06-22 20:45:38 -04:00
share_repository.go feat(bfr): Big Refactor: new scanner, lots of new fields and tags, improvements and DB schema changes (#2709) 2025-02-19 20:35:17 -05:00
sql_annotations.go feat(bfr): Big Refactor: new scanner, lots of new fields and tags, improvements and DB schema changes (#2709) 2025-02-19 20:35:17 -05:00
sql_base_repository.go fix(subsonic): Sort songs by presence of lyrics for getLyrics (#4237) 2025-06-16 12:04:41 -04:00
sql_base_repository_test.go fix(subsonic): Sort songs by presence of lyrics for getLyrics (#4237) 2025-06-16 12:04:41 -04:00
sql_bookmarks.go feat(bfr): Big Refactor: new scanner, lots of new fields and tags, improvements and DB schema changes (#2709) 2025-02-19 20:35:17 -05:00
sql_bookmarks_test.go revert: separation of write and read DBs 2024-11-19 18:41:50 -05:00
sql_participations.go fix(server): send artist mbids when scrobbling to ListenBrainz 2025-02-23 13:30:39 -05:00
sql_restful.go feat(bfr): Big Refactor: new scanner, lots of new fields and tags, improvements and DB schema changes (#2709) 2025-02-19 20:35:17 -05:00
sql_restful_test.go feat(bfr): Big Refactor: new scanner, lots of new fields and tags, improvements and DB schema changes (#2709) 2025-02-19 20:35:17 -05:00
sql_search.go feat(bfr): Big Refactor: new scanner, lots of new fields and tags, improvements and DB schema changes (#2709) 2025-02-19 20:35:17 -05:00
sql_search_test.go feat(bfr): Big Refactor: new scanner, lots of new fields and tags, improvements and DB schema changes (#2709) 2025-02-19 20:35:17 -05:00
sql_tags.go feat(bfr): Big Refactor: new scanner, lots of new fields and tags, improvements and DB schema changes (#2709) 2025-02-19 20:35:17 -05:00
tag_repository.go fix(scanner): optimize refresh (#4059) 2025-05-14 20:47:03 -04:00
transcoding_repository.go fix(transcoding): restrict transcoding operations to admin users (#4096) 2025-05-21 22:19:23 -04:00
transcoding_repository_test.go fix(transcoding): restrict transcoding operations to admin users (#4096) 2025-05-21 22:19:23 -04:00
user_props_repository.go Replace beego/orm with dbx (#2693) 2023-12-09 13:52:17 -05:00
user_repository.go sec(subsonic): authentication bypass in Subsonic API with non-existent username 2025-02-20 20:14:19 -05:00
user_repository_test.go feat(bfr): Big Refactor: new scanner, lots of new fields and tags, improvements and DB schema changes (#2709) 2025-02-19 20:35:17 -05:00