navidrome/server/nativeapi
Claude 68591dab06
Add API abstraction layer for mediafiles in native API
Introduce a mapping layer between internal model.MediaFile and the API
response type. The native API /song endpoint now returns apimodel.Song
instead of exposing the database model directly. This decouples the API
surface from the persistence layer, enabling calculated fields and hiding
internal details (Path, FolderID, LibraryPath, PID, etc.).

The architecture is designed for expansion to other models:
- mappedRepository: generic REST repository wrapper that transforms
  Read/ReadAll results through mapping functions
- apimodel package: dedicated API response types with explicit field
  selection and JSON tags independent of the model

https://claude.ai/code/session_01TvZ2CgPPfFoxzNYoWuPUBg
2026-02-15 21:28:18 +00:00
..
apimodel Add API abstraction layer for mediafiles in native API 2026-02-15 21:28:18 +00:00
config.go refactor: run Go modernize (#5002) 2026-02-08 09:57:30 -05:00
config_test.go refactor: run Go modernize (#5002) 2026-02-08 09:57:30 -05:00
inspect.go feat: Multi-library support (#4181) 2025-07-18 18:41:12 -04:00
library.go fix: album statistics not updating after deleting missing files (#4668) 2025-11-08 20:11:00 -05:00
library_test.go feat(plugins): New Plugin System with multi-language PDK support (#4833) 2026-01-14 19:22:48 -05:00
mapped_repository.go Add API abstraction layer for mediafiles in native API 2026-02-15 21:28:18 +00:00
missing.go fix: album statistics not updating after deleting missing files (#4668) 2025-11-08 20:11:00 -05:00
native_api.go Add API abstraction layer for mediafiles in native API 2026-02-15 21:28:18 +00:00
native_api_song_test.go Add API abstraction layer for mediafiles in native API 2026-02-15 21:28:18 +00:00
native_api_suite_test.go Rename log.LevelCritical to log.LevelFatal 2022-12-21 14:53:36 -05:00
playlists.go refactor: run Go modernize (#5002) 2026-02-08 09:57:30 -05:00
plugin.go feat(plugins): add JSONForms-based plugin configuration UI (#4911) 2026-01-19 20:51:00 -05:00
plugin_test.go feat(plugins): New Plugin System with multi-language PDK support (#4833) 2026-01-14 19:22:48 -05:00
queue.go feat(server): add update and clear play queue endpoints to native API (#4215) 2025-06-11 12:02:31 -04:00
queue_test.go feat(server): add update and clear play queue endpoints to native API (#4215) 2025-06-11 12:02:31 -04:00
translations.go refactor: run Go modernize (#5002) 2026-02-08 09:57:30 -05:00
translations_test.go refactor: run Go modernize (#5002) 2026-02-08 09:57:30 -05:00