feat: Comprehensive improvements to robustness and diagnostics #1844
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 includes a series of changes aimed at improving error handling, logging, and playback/download resilience, based on a review of several outstanding issues.
Key changes:
Download Error Handling (
DownloadUtil.kt):dataSourceFactorywhenplayabilityStatusfromYouTube.player()is not "OK", providing more details (status, reason, mediaId) for download preparation failures.Discord RPC Error Handling (
KizzyRPC.kt,DiscordRPC.kt):android.util.Logstatements inKizzyRPC.setActivity()around WebSocket connect and send operations to catch and log potential errors.DiscordRPC.updateSong()via.onFailureto better diagnose issues when calling the underlying RPC library.Innertube Cookie Usage Logging (
InnerTube.kt):ytClient()method to output the state ofsetLoginparameter, cookie presence, anduseLoginForBrowseproperty. This will help you verify runtime decisions for making authenticated requests.Playback Resilience & Error Propagation (
YouTube.kt,MusicService.kt,DownloadUtil.kt):innertube/YouTube.kt player()method to ensure that if all client attempts (ANDROID_MUSIC, IOS, TVHTML5) fail to get an "OK" playability status, the error response from the final TVHTML5 attempt is prioritized for return. This provides more relevant error information.MusicService.createDataSourceFactory()andDownloadUtil.dataSourceFactory()by filtering out adaptive formats that have null or blank URLs or mimeTypes before attempting to select the best format. This aims to prevent errors from unusable stream data.DownloadUtil.ktfor cases where no suitable download format is found after filtering.Investigations:
InnerTube.kt) suggests the core logic for respecting preferences is in place.