fix(player): fall back to MPV playable source when watching anime and classify sentence audio export failures - #96
Closed
Jolimunium wants to merge 9 commits into
Conversation
- fall back only when the source has exactly one audio stream - allow audio export from HDR video sources - show clear warnings when sentence audio generation or Anki storage fails
- validate the selected stream before exporting sentence audio - fall back only when FFprobe finds exactly one readable audio stream - distinguish missing, non-audio, and protected stream failures
- distinguish original, MPV playable, and external audio inputs - detect missing audio streams separately from restricted codecs - show source-specific sentence audio export warnings
- retry sentence audio export from MPV's playable source only when the original has no audio stream - preserve safe track mapping and source-specific failure diagnostics
This was referenced Aug 1, 2026
Owner
|
the animated mining will be reworked so if you can fix the conflicts that would be good |
Contributor
Author
|
I've updated this in #106 instead. |
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.
Problem
When watching anime in the player, exporting sentence audio during scene mining could fail silently or produce generic error toasts without actionable feedback. Typical failure causes included:
ff-indexwas missing or mismatched relative to FFmpeg streams.Changes
1. Sentence Audio Fallback & Track Resolution (
SceneSentenceAudioService.kt,SceneVideoInput.kt,SceneCaptureRequest.kt)SceneVideoInputOrigin(ORIGINAL_VIDEO,PLAYABLE_VIDEO,EXTERNAL_AUDIO) to track source provenance.ScenePlayableFallbackResolutionandresolvePlayableFallback()to safely verify and resolve MPV's playable video source when the original video source fails.SceneSentenceAudioServicewith multi-stage probing (Selected Track Probe → All Stream Probe → Unrestricted Discovery Probe) and automatic fallback to the playable source for retryable errors (isPlayableFallbackRetryable).ff-indexproperty is unpopulated.2. Failure Classification & Safe Native Diagnostics (
FfmpegKitSceneCommandExecutor.kt,SceneMediaProbe.kt,SentenceAudioDiagnosticLog.kt)SceneFfmpegFailureenum andclassifySceneFfmpegFailure()to categorize native FFmpeg/FFprobe failures (STREAM_MAPPING,SOURCE_READ,SEEK,OUTPUT_WRITE,UNKNOWN).SceneMediaProbewithinspectSelectedAudio()andaudioStreams()to detect protection markers, codec types, and stream blocks.SentenceAudioDiagnosticJournalandStorageFolderSentenceAudioDiagnosticLoggerto record diagnostic events in storage while automatically redacting sensitive data (URLs, authorization tokens, headers, and local file paths).3. Detailed UI Warnings & Translations (
AnkiMedia.kt,AnkiCardCreator.kt,PlayerSceneMiningUi.kt,strings.xml,PlayerViewModel.kt)AnkiSentenceAudioFailure,AnkiSentenceAudioDiagnostic, andAnkiSentenceAudioPreparationin the Anki module.AnkiMediaWarning.SentenceAudioGenerationFailedandSentenceAudioStorageFailed.PlayerSceneMiningUi.ktand added 27+ localized string resources instrings.xmlto present detailed diagnostic toasts specifying whether issues arose from original video sources, MPV playable fallback sources, or external audio tracks.4. Comprehensive Unit Tests
eu.kanade.tachiyomi.ui.player.scene:SceneSentenceAudioServiceTest.kt: Playable fallback, track index recovery, probe failures, codec restrictions, external audio, and timeouts.SceneCaptureRequestTest.kt: Subtitle capture request resolution and single-audio tracking.SceneVideoInputTest.kt: Playable fallback resolution and discovery probe arguments.SentenceAudioDiagnosticLogTest.kt: Log redaction (URL/token/header masking) and byte budget retention.SceneFfmpegFailureClassifierTest.kt: FFmpeg failure regex classification.Result