quintodrome/server
Deluan Quintão b63630fa6e
fix(scanner) artist stats not refreshing during quick scan and after missing file deletion (#4269)
* Fix artist not being marked as touched during quick scans

When a new album is added during quick scans, artists were not being
marked as 'touched' due to media files having older modification times
than the scan completion time.

Changes:
- Add 'updated_at' to artist Put() columns in scanner to ensure
  timestamp is set when artists are processed
- Simplify RefreshStats query to check artist.updated_at directly
  instead of complex media file joins
- Artists from new albums now properly get refreshed in later phases

This fixes the issue where newly added albums would have incomplete
artist information after quick scans.

* fix(missing): refresh artist stats in background after deleting missing files

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

* fix(request): add InternalAuth to user context

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

* Add comprehensive test for artist stats update during quick scans

- Add test that verifies artist statistics are correctly updated when new files are added during incremental scans
- Test ensures both overall stats (AlbumCount, SongCount) and role-specific stats are properly refreshed
- Validates fix for artist stats not being refreshed during quick scans when new albums are added
- Uses real artist repository instead of mock to verify actual stats calculation behavior

---------

Signed-off-by: Deluan <deluan@navidrome.org>
2025-06-26 15:50:56 -04:00
..
backgrounds feat(ui): use webp for login backgrounds 2025-03-06 23:32:52 -05:00
events feat(ui): add Now Playing panel for admins (#4209) 2025-06-10 17:22:13 -04:00
nativeapi fix(scanner) artist stats not refreshing during quick scan and after missing file deletion (#4269) 2025-06-26 15:50:56 -04:00
public fix(share): force share image to be square (to fix aspect ratio) (#4122) 2025-05-26 17:39:05 -04:00
subsonic refactor: rename SimilarSongs to ArtistRadio (#4248) 2025-06-25 18:21:14 -04:00
auth.go feat(plugins): allow Plugins to call the Subsonic API (#4260) 2025-06-25 14:18:32 -04:00
auth_test.go fix(server): first user created should be admin, when using reverse proxy (#3920) 2025-04-05 08:24:14 -03:00
initial_setup.go chore(server): add logs to begin/end transaction 2025-02-24 19:13:42 -05:00
initial_setup_test.go Upgrade Ginkgo to V2 2022-07-26 16:53:17 -04:00
middlewares.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
middlewares_test.go feat(ui): show user's lastAccess (#3342) 2024-09-30 20:46:10 -04:00
serve_index.go feat(ui): add EnableNowPlaying configuration (default true) (#4219) 2025-06-13 00:06:08 -04:00
serve_index_test.go feat(ui): add EnableNowPlaying configuration (default true) (#4219) 2025-06-13 00:06:08 -04:00
server.go fix(server): don't override /song routes 2025-06-01 14:41:50 -04:00
server_suite_test.go Rename log.LevelCritical to log.LevelFatal 2022-12-21 14:53:36 -05:00
server_test.go Make server unix socket file permission configurable via flag UnixSocketPerm (#2763) 2024-01-20 14:50:30 -05:00