Open
Conversation
This commit implements a robust, scalable, and accurate solution for exporting playlists to m3u format as requested in issue #112. Core Components: - M3uWriter: Generates m3u file content from song lists with proper formatting - Supports extended m3u format with #EXTINF metadata - Handles duration conversion (milliseconds to seconds) - Provides custom path resolver support for flexibility - PlaylistExporter: Service class for handling export operations - Multiple export strategies: to URI, to directory, or generate content - Best-effort path resolution for content:// URIs - Robust error handling with detailed error messages - Uses Android Storage Access Framework for file operations Repository Layer: - Added export methods to PlaylistRepository interface - Implemented in LocalPlaylistRepository with proper song retrieval UI Layer: - Added "Export playlist" menu item to playlist detail screen - Integrated with Android's file picker using ActivityResultContracts - User-friendly success/error messages with localized strings - Export uses playlist name as default filename Technical Approach: - Handles Android's content:// URI limitation by attempting to resolve real paths - Falls back to content URIs when real paths unavailable (known limitation) - Flexible path resolver allows callers to provide custom resolution logic - Comprehensive error handling for permissions, I/O, and invalid data Testing: - Added comprehensive unit tests for M3uWriter covering: - Basic single/multiple song export - Null handling for artist/track names - Custom path resolvers - Duration conversion accuracy - M3u format structure validation Addresses issue #112
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This commit implements a robust, scalable, and accurate solution for exporting playlists to m3u format as requested in issue #112.
Core Components:
M3uWriter: Generates m3u file content from song lists with proper formatting
PlaylistExporter: Service class for handling export operations
Repository Layer:
UI Layer:
Technical Approach:
Testing:
Addresses issue #112