quintodrome/tests
Deluan Quintão cad9cdc53e
fix(scanner): preserve created_at when moving songs between libraries (#5055)
* fix: preserve created_at when moving songs between libraries (#5050)

When songs are moved between libraries, their creation date was being
reset to the current time, causing them to incorrectly appear in
"Recently Added". Three changes fix this:

1. Add hash:"ignore" to AlbumID in MediaFile struct so that Equals()
   works for cross-library moves (AlbumID includes library prefix,
   making hashes always differ between libraries)

2. Preserve album created_at in moveMatched() via CopyAttributes,
   matching the pattern already used in persistAlbum() for
   within-library album ID changes

3. Only set CreatedAt in Put() when it's zero (new files), and
   explicitly copy missing.CreatedAt to the target in moveMatched()
   as defense-in-depth for the INSERT code path

* test: add regression tests for created_at preservation (#5050)

Add tests covering the three aspects of the fix:
- Scanner: moveMatched preserves missing track's created_at
- Scanner: CopyAttributes called for album created_at on album change
- Scanner: CopyAttributes not called when album ID stays the same
- Persistence: Put sets CreatedAt to now for new files with zero value
- Persistence: Put preserves non-zero CreatedAt on insert
- Persistence: Put does not reset CreatedAt on update

Also adds CopyAttributes to MockAlbumRepo for test support.

* test: verify album created_at is updated in cross-library move test (#5050)

Added end-to-end assertion in the cross-library move test to verify that
the new album's CreatedAt field is actually set to the original value after
CopyAttributes runs, not just that the method was called. This strengthens
the test by confirming the mock correctly propagates the timestamp.
2026-02-17 08:37:05 -05:00
..
fixtures fix(scanner): pass filename hint to gotaglib's OpenStream for format detection (#5012) 2026-02-09 16:16:28 -05:00
fake_http_client.go Retry calls to Last.FM without MBIDs when if returns artist invalid (#1138) 2021-05-27 20:53:24 -04:00
init_tests.go Allow configuring cache folder (#2357) 2023-06-02 17:14:11 -04:00
mock_album_repo.go fix(scanner): preserve created_at when moving songs between libraries (#5055) 2026-02-17 08:37:05 -05:00
mock_artist_repo.go fix(server): optimize search3 performance with multi-library (#4382) 2025-07-25 18:53:40 -04:00
mock_data_store.go test(subsonic): add comprehensive e2e test suite for Subsonic API (#5003) 2026-02-09 08:24:37 -05:00
mock_ffmpeg.go refactor(server): remove ffmpeg unused code 2024-10-20 19:35:16 -04:00
mock_genre_repo.go refactor: external_metadata -> external.Provider (#3903) 2025-04-08 21:11:09 -04:00
mock_library_repo.go refactor: run Go modernize (#5002) 2026-02-08 09:57:30 -05:00
mock_library_service.go feat(plugins): New Plugin System with multi-language PDK support (#4833) 2026-01-14 19:22:48 -05:00
mock_mediafile_repo.go refactor: run Go modernize (#5002) 2026-02-08 09:57:30 -05:00
mock_playlist_repo.go fix(server): return 404 instead of 500 for non-existent playlists 2026-02-15 22:39:27 -05:00
mock_playqueue_repo.go feat(server): add update and clear play queue endpoints to native API (#4215) 2025-06-11 12:02:31 -04:00
mock_plugin_manager.go feat(plugins): add JSONForms-based plugin configuration UI (#4911) 2026-01-19 20:51:00 -05:00
mock_plugin_repo.go refactor: run Go modernize (#5002) 2026-02-08 09:57:30 -05:00
mock_property_repo.go refactor: external_metadata -> external.Provider (#3903) 2025-04-08 21:11:09 -04:00
mock_radio_repository.go refactor: external_metadata -> external.Provider (#3903) 2025-04-08 21:11:09 -04:00
mock_scanner.go feat(scanner): implement selective folder scanning and file system watcher improvements (#4674) 2025-11-14 22:15:43 -05:00
mock_scrobble_buffer_repo.go feat(ui): add EnableNowPlaying configuration (default true) (#4219) 2025-06-13 00:06:08 -04:00
mock_scrobble_repo.go feat(server): track scrobble/linstens history (#4770) 2025-12-06 11:07:18 -05:00
mock_share_repo.go refactor: run Go modernize (#5002) 2026-02-08 09:57:30 -05:00
mock_transcoding_repo.go Add global Downsampling feature (#1575) 2022-12-06 19:41:16 -05:00
mock_user_props_repo.go refactor: external_metadata -> external.Provider (#3903) 2025-04-08 21:11:09 -04:00
mock_user_repo.go refactor: run Go modernize (#5002) 2026-02-08 09:57:30 -05:00
mock_user_service.go feat(plugins): New Plugin System with multi-language PDK support (#4833) 2026-01-14 19:22:48 -05:00
navidrome-test.toml feat(plugins): experimental support for plugins (#3998) 2025-06-22 20:45:38 -04:00
test_helpers.go fix: album statistics not updating after deleting missing files (#4668) 2025-11-08 20:11:00 -05:00