Commit Graph
4359 Commits
Author SHA1 Message Date
Deluan c1365cd236 feat(subsonic): implement user-specific library access in GetMusicFolders
Signed-off-by: Deluan <deluan@navidrome.org>
2025-07-16 18:10:15 -04:00
Deluan 5d926538d7 Add library_id field support for smart playlists
- Add library_id field to smart playlist criteria system
- Supports Is and IsNot operators for filtering by library ID
- Includes comprehensive test coverage for single values and lists
- Enables creation of library-specific smart playlists
2025-07-16 18:10:15 -04:00
Deluan 4b107b213c feat(artist): add library ID filtering for artists in repository and update resource filtering logic
Signed-off-by: Deluan <deluan@navidrome.org>

# Conflicts:
#	persistence/artist_repository.go
2025-07-16 18:10:15 -04:00
Deluan 5ecad64a3f feat(library): add refresh functionality on LibrarySelector close
Signed-off-by: Deluan <deluan@navidrome.org>
2025-07-16 18:10:15 -04:00
Deluan 2f9a9cf4fb fix(repository): add table name handling in filter functions for SQL queries
Signed-off-by: Deluan <deluan@navidrome.org>
2025-07-16 18:10:15 -04:00
Deluan 93059204f3 feat(library): streamline library ID filtering in repositories and update resource filtering logic
Signed-off-by: Deluan <deluan@navidrome.org>
2025-07-16 18:10:15 -04:00
Deluan d44292cdc7 feat(library): add library ID filtering for album resources
Signed-off-by: Deluan <deluan@navidrome.org>
2025-07-16 18:10:15 -04:00
Deluan ac31ea640f test: add unit tests for file utility functions
Signed-off-by: Deluan <deluan@navidrome.org>
2025-07-16 18:10:15 -04:00
Deluan 17bb39c472 feat(library): add tests for LibrarySelector and library selection hooks
Signed-off-by: Deluan <deluan@navidrome.org>
2025-07-16 18:10:14 -04:00
Deluan 1713396da2 feat(library): implement library selection functionality with reducer and UI component
Signed-off-by: Deluan <deluan@navidrome.org>

# Conflicts:
#	.github/copilot-instructions.md

# Conflicts:
#	.gitignore
2025-07-16 18:10:14 -04:00
Deluan db167f56b9 feat(user): add library selection for user creation and editing
Signed-off-by: Deluan <deluan@navidrome.org>
2025-07-16 18:10:14 -04:00
Deluan e9d6a8eccf feat(repository): apply library filtering in CountAll methods for albums, folders, and media files
Signed-off-by: Deluan <deluan@navidrome.org>
2025-07-16 18:10:14 -04:00
Deluan f9fc3cd1c6 prepend libraryID for track and album PIDs
Signed-off-by: Deluan <deluan@navidrome.org>
2025-07-16 18:10:14 -04:00
Deluan 4b8b19e154 fix: track processed libraries by updating state with scan timestamps
Signed-off-by: Deluan <deluan@navidrome.org>
2025-07-16 18:10:14 -04:00
Deluan 4f4b0fb94a refactor(scanner): streamline library handling by using state-libraries for consistency
Signed-off-by: Deluan <deluan@navidrome.org>
2025-07-16 18:10:14 -04:00
Deluan ee18a04da9 feat(library): add/remove watchers on demand, not only when server starts
Signed-off-by: Deluan <deluan@navidrome.org>
2025-07-16 18:10:14 -04:00
Deluan 8c8ef7836a feat(library): add library path and name fields to album and mediafile models
Signed-off-by: Deluan <deluan@navidrome.org>
2025-07-16 18:10:14 -04:00
Deluan b4c3590bfe refactor: move scan triggering logic into a helper method for clarity
Signed-off-by: Deluan <deluan@navidrome.org>
2025-07-16 18:10:14 -04:00
Deluan 6c5c9e0b68 rename migration file for user library table to maintain versioning order
Signed-off-by: Deluan <deluan@navidrome.org>
2025-07-16 18:10:14 -04:00
Deluan df3e03698f feat(library): trigger scan after successful library deletion to clean up orphaned data
Signed-off-by: Deluan <deluan@navidrome.org>
2025-07-16 18:10:14 -04:00
Deluan 12562dbfab feat(library): implement scanner interface for triggering library scans on create/update
Signed-off-by: Deluan <deluan@navidrome.org>

# Conflicts:
#	cmd/wire_gen.go
#	cmd/wire_injectors.go

# Conflicts:
#	cmd/wire_gen.go

# Conflicts:
#	cmd/wire_gen.go
#	cmd/wire_injectors.go
2025-07-16 18:10:14 -04:00
Deluan c8ee3edba7 feat(missingfiles): add library filter and display in MissingFilesList component
Signed-off-by: Deluan <deluan@navidrome.org>
2025-07-16 18:10:14 -04:00
Deluan 2dee0fee98 feat(mediafile): add LibraryName field and update queries to include library name
Signed-off-by: Deluan <deluan@navidrome.org>
2025-07-16 18:10:14 -04:00
Deluan 20968ef0b9 feat(library): enhance LibraryCreate and LibraryEdit components with additional props and styling
Signed-off-by: Deluan <deluan@navidrome.org>
2025-07-16 18:10:14 -04:00
Deluan f1cea72715 feat(library): add additional fields and restructure LibraryEdit component for enhanced statistics display
Signed-off-by: Deluan <deluan@navidrome.org>
2025-07-16 18:10:14 -04:00
Deluan a036db7ebd feat(controller): add function to retrieve the most recent scan time across all libraries
Signed-off-by: Deluan <deluan@navidrome.org>
2025-07-16 18:10:14 -04:00
Deluan 9e90145291 test(scanner): improve handling of filesystem errors and ensure warnings are returned
Signed-off-by: Deluan <deluan@navidrome.org>
2025-07-16 18:10:14 -04:00
Deluan 4c06cd2ac8 test(scanner): add tests for multi-library scanning and validation
Signed-off-by: Deluan <deluan@navidrome.org>
2025-07-16 18:10:14 -04:00
Deluan daa3648b06 lint
Signed-off-by: Deluan <deluan@navidrome.org>
2025-07-16 18:10:14 -04:00
Deluan 5a78c6e49a feat(library): enhance validation messages and error handling for library paths
Signed-off-by: Deluan <deluan@navidrome.org>
2025-07-16 18:10:14 -04:00
Deluan 0ef4c3ed8c simplify DeleteLibraryButton.jsx
Signed-off-by: Deluan <deluan@navidrome.org>
2025-07-16 18:10:14 -04:00
Deluan 1713095414 use utils/formatBytes
Signed-off-by: Deluan <deluan@navidrome.org>
2025-07-16 18:10:14 -04:00
Deluan 4c3bc499c1 feat(library): improve library path validation and error handling - WIP
Signed-off-by: Deluan <deluan@navidrome.org>
2025-07-16 18:10:14 -04:00
Deluan 4ab37346fc feat(library): enhance library validation and management with path checks and normalization - WIP
Signed-off-by: Deluan <deluan@navidrome.org>
2025-07-16 18:10:14 -04:00
Deluan 2b8af050a4 feat(library): add library management features including create, edit, delete, and list functionalities - WIP
Signed-off-by: Deluan <deluan@navidrome.org>
2025-07-16 18:10:14 -04:00
Deluan e9fb649e9e fix migration file name
Signed-off-by: Deluan <deluan@navidrome.org>
2025-07-16 18:10:14 -04:00
Deluan b93a753b9f add total_duration column to library and update user_library table
Signed-off-by: Deluan <deluan@navidrome.org>
2025-07-16 18:10:14 -04:00
Deluan d2a2c43ef5 refactor library service to use REST repository pattern and remove CRUD operations
Signed-off-by: Deluan <deluan@navidrome.org>
2025-07-16 18:10:14 -04:00
Deluan 5c01eb06ae feat(database): add library filtering to album, folder, and media file queries
Signed-off-by: Deluan <deluan@navidrome.org>
2025-07-16 18:10:14 -04:00
Deluan c1c7cfa49f refactor(library): implement library management service and update API routes
Signed-off-by: Deluan <deluan@navidrome.org>
2025-07-16 18:10:14 -04:00
Deluan 7dce0da557 feat(api): restrict access to library and config endpoints to admin users
Signed-off-by: Deluan <deluan@navidrome.org>
2025-07-16 18:10:14 -04:00
Deluan 403fe19e1a feat(api): implement library management and user-library association endpoints
Signed-off-by: Deluan <deluan@navidrome.org>
2025-07-16 18:10:14 -04:00
Deluan a736d79985 feat(database): enhance user retrieval with library associations
Signed-off-by: Deluan <deluan@navidrome.org>
2025-07-16 18:10:14 -04:00
Deluan 40bbae16c4 feat(database): add user_library table and library access methods
Signed-off-by: Deluan <deluan@navidrome.org>

# Conflicts:
#	tests/mock_library_repo.go
2025-07-16 18:10:14 -04:00
Deluan 3c1e5603d0 fix(ui): don't show year "0"
Signed-off-by: Deluan <deluan@navidrome.org>
2025-07-15 19:12:25 -04:00
Deluan adef0ea1e7 fix(plugins): resolve race condition in plugin manager registration
Fixed a race condition in the plugin manager where goroutines started during
plugin registration could concurrently access shared plugin maps while the
main registration loop was still running. The fix separates plugin registration
from background processing by collecting all plugins first, then starting
background goroutines after registration is complete.

This prevents concurrent read/write access to the plugins and adapters maps
that was causing data races detected by the Go race detector. The solution
maintains the same functionality while ensuring thread safety during the
plugin scanning and registration process.

Signed-off-by: Deluan <deluan@navidrome.org>
2025-07-15 12:58:16 -04:00
bytesingsong b69a7652b9 chore: fix some typos in comment and logs (#4333)
Signed-off-by: bytesingsong <bytesing@icloud.com>
2025-07-13 14:31:15 -04:00
d8e829ad18 chore: fix function name/description in comment (#4325)
* chore: fix function in comment

Signed-off-by: bytetigers <bytetiger@icloud.com>

* Update model/metadata/persistent_ids.go

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

---------

Signed-off-by: bytetigers <bytetiger@icloud.com>
Co-authored-by: Deluan Quintão <github@deluan.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2025-07-13 14:30:58 -04:00
Deluan Quintão 5b73a4d5b7 feat(plugins): add TimeNow function to SchedulerService (#4337)
* feat: add TimeNow function to SchedulerService plugin

Added new TimeNow RPC method to the SchedulerService host service that returns
the current time in two formats: RFC3339Nano string and Unix milliseconds int64.
This provides plugins with a standardized way to get current time information
from the host system.

The implementation includes:
- TimeNowRequest/TimeNowResponse protobuf message definitions
- Go host service implementation using time.Now()
- Complete test coverage with format validation
- Generated WASM interface code for plugin communication

* feat: add LocalTimeZone field to TimeNow response

Added LocalTimeZone field to TimeNowResponse message in the SchedulerService
plugin host service. This field contains the server's local timezone name
(e.g., 'America/New_York', 'UTC') providing plugins with timezone context
alongside the existing RFC3339Nano and Unix milliseconds timestamps.

The implementation includes:
- New local_time_zone protobuf field definition
- Go implementation using time.Now().Location().String()
- Updated test coverage with timezone validation
- Generated protobuf serialization/deserialization code

* docs: update plugin README with TimeNow function documentation

Updated the plugins README.md to document the new TimeNow function in the
SchedulerService. The documentation includes detailed descriptions of the
three return formats (RFC3339Nano, UnixMilli, LocalTimeZone), practical
use cases, and a comprehensive Go code example showing how plugins can
access current time information for logging, calculations, and timezone-aware
operations.

* docs: remove wrong comment from InitRequest

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

* fix: add missing TimeNow method to namedSchedulerService

Added TimeNow method implementation to namedSchedulerService struct to satisfy the scheduler.SchedulerService interface contract. This method was recently added to the interface but the namedSchedulerService wrapper was not updated, causing compilation failures in plugin tests. The implementation is a simple pass-through to the underlying scheduler service since TimeNow doesn't require any special handling for named callbacks.

---------

Signed-off-by: Deluan <deluan@navidrome.org>
2025-07-13 14:23:58 -04:00
Deluan 1de84dbd0c refactor(ui): replace translation key with direct character for remove action
Signed-off-by: Deluan <deluan@navidrome.org>
2025-07-12 16:55:21 -04:00