Skip to content

Conversation

@davidvedvick
Copy link
Collaborator

No description provided.

This commit refactors the file properties handling in the following ways:
- Introduces `CaseInsensitiveFilePropertiesProvider` to ensure that file property keys are treated as case-insensitive.
- Introduces `FreshestRevisionFilePropertiesProvider` to ensure that only the properties from the latest revision are used and cached.
- Modifies `LiveSubsonicConnection` to store properties in a `HashMap` instead of a case-insensitive `TreeMap` as case-insensitivity is now handled by `CaseInsensitiveFilePropertiesProvider`.
This commit refactors the file properties system to use a `LookupFileProperties` interface instead of a `Map<String, String>`. This change provides several benefits:

- **Type safety:** The interface defines specific properties like `artist`, `album`, etc.
- **Lazy loading:** The implementation `FilePropertiesLookup` uses lazy loading for properties.
- **Extensibility:** The interface can be extended to add new properties or functionality in the future.
- **Read-only and editable properties:** The system now distinguishes between read-only and editable properties.
- **Removed `CaseInsensitiveFilePropertiesProvider`:** Case-insensitivity is now handled within the `FilePropertiesLookup` implementation.
- Moved helper functions and classes into the `FileProperties.kt` file.
- Removed `EditableLibraryFilePropertiesProvider.kt`, `ProvideEditableLibraryFileProperties.kt`, and related tests as this functionality is now handled within `FilePropertiesLookup` and inheritors.
- Bound starting totalDistanceTraveled
- Skip initial state updates
@davidvedvick davidvedvick merged commit fe9c9b0 into main Sep 30, 2025
2 checks passed
@davidvedvick davidvedvick deleted the bugfix/normalize-file-properties branch September 30, 2025 02:47
@davidvedvick davidvedvick linked an issue Sep 30, 2025 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve File Property Normalization

2 participants