feat(jellyfin): watch from one's own Jellyfin server and learn the words of its subtitles

Animelon's way of learning from video, from the person's own Jellyfin
server: connected per device (Settings, or a studyset's Add material ›
Watch from Jellyfin) with a name and password or a Quick Connect code,
over HTTPS only (plain HTTP only to a server on the same machine); the
token stays in the system's keyring. Shows, films and videos tied to a
studyset follow the person in their settings as the server's and the
item's ids alone (settings schema 9), named by the server when shown.

The Watch screen plays the video (video_player on Android, media_kit's
libmpv on Linux and Windows) with the line in the studyset's front
language cut into the dictionary's words with furigana, and the back
language's line beneath; a word tapped pauses the video and becomes a
card with the line and its translation as its first hint, tagged with
the show. The video's words are listed, most frequent first. The sound is
the track in the studyset's language, whichever the file marks default,
and the menu switches it; the subtitles read are a whole track, never a
forced one (which only covers what the sound doesn't say), and captions
for the hard of hearing only without plain ones. The line and its
translation take the video's width in a box of a fixed height, so the
video keeps its size; in the dark theme the video's colours glow around
it, as YouTube's ambient mode, and the words' panel takes the colour of
the episode's picture under the pointer.

A line is cut into words with one request: DictionaryEndpoint.withKeys
looks up every stretch of it that may be a word, as it stands and as
every word it may be a conjugation of, in the new dictionary_key table
(one row per key, indexed; migration dictionary-keys adds the table and
its index, nothing else), which the loader fills beside the entries.
The instance gets the text of each line looked up and keeps none of it,
as the Watch screen says.

Linux builds need libmpv-dev, and the app links libmpv: the snap stages
Ubuntu's libmpv2, makes the update-alternatives links for BLAS and LAPACK
that ffmpeg's speech recognition needs (staging never runs install
scripts), and removes what the GNOME runtime and core24 already hold, as
older copies of cairo, pango and librsvg hid the runtime's from its GTK.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
This commit is contained in:
Tizian 「ティツィアーン」 2026-10-13 11:31:37 +02:00
commit da51ef73cb
Signed by: raisondetredev
GPG key ID: 07F6FCF405488B64

View file

@ -6423,6 +6423,185 @@ class AppLocalizationsEn extends AppLocalizations {
@override
String get planLearningPaths => 'Learning paths';
@override
String get jellyfinTitle => 'Jellyfin';
@override
String get jellyfinSubtitle =>
'Watch shows and films from your own Jellyfin server, and learn the words of their subtitles.';
@override
String get jellyfinPrivacy =>
'Your server\'s address and your sign-in stay on this device, and the shows tied to a studyset follow you as ids, never titles. To find the words of a line, the app asks the instance about its text, which it answers and doesn\'t keep.';
@override
String jellyfinSignedInAs(String user, String server) {
return '$user on $server';
}
@override
String get jellyfinSignOut => 'Sign out of Jellyfin';
@override
String get jellyfinAddress => 'Server address';
@override
String get jellyfinAddressHint => 'jellyfin.example.org';
@override
String get jellyfinFind => 'Continue';
@override
String get jellyfinUser => 'User name';
@override
String get jellyfinPassword => 'Password';
@override
String get jellyfinSignIn => 'Sign in';
@override
String get jellyfinQuickConnect => 'Sign in with a code';
@override
String get jellyfinQuickConnectCode =>
'Enter this code under Quick Connect in a Jellyfin app you\'re signed in to:';
@override
String get jellyfinQuickConnectWaiting =>
'Waiting for the code to be approved…';
@override
String get jellyfinOtherServer => 'Another server';
@override
String get jellyfinUnreachable =>
'No server answered at that address over HTTPS.';
@override
String get jellyfinNotEncrypted =>
'That address isn\'t encrypted, and your password would travel in the clear. Use the server\'s HTTPS address.';
@override
String get jellyfinNotJellyfin => 'That address isn\'t a Jellyfin server.';
@override
String get jellyfinWrongCredentials => 'The user name or password is wrong.';
@override
String get jellyfinSignedOut =>
'You were signed out of Jellyfin. Sign in again.';
@override
String get jellyfinFailed =>
'That didn\'t work on the Jellyfin server. Try again.';
@override
String get studysetWatch => 'Watch from Jellyfin';
@override
String get jellyfinBrowseTitle => 'Watch';
@override
String get jellyfinTied => 'Tied to this studyset';
@override
String get jellyfinLibraries => 'Libraries';
@override
String get jellyfinSearchHint => 'Search shows and films';
@override
String get jellyfinTie => 'Tie to this studyset';
@override
String get jellyfinUntie => 'Untie from this studyset';
@override
String get jellyfinEmpty => 'Nothing here';
@override
String jellyfinEpisode(int season, int episode) {
return 'S$season E$episode';
}
@override
String get jellyfinNoPlayer => 'Videos can\'t play on this device.';
@override
String get jellyfinNoPlayerLinux =>
'Videos can\'t play on this device: playing them needs libmpv (the package libmpv2).';
@override
String get watchNoSubtitles =>
'This video has no subtitles in the studyset\'s language as text, so there is nothing to look up.';
@override
String get watchSubtitles => 'Subtitles';
@override
String get watchTranslation => 'Translation';
@override
String get watchAudio => 'Audio';
@override
String get watchTracks => 'Audio and subtitles';
@override
String get watchNone => 'None';
@override
String get watchPlay => 'Play';
@override
String get watchPause => 'Pause';
@override
String get watchPreviousLine => 'Previous line';
@override
String get watchNextLine => 'Next line';
@override
String get watchRepeatLine => 'Repeat line';
@override
String get watchPauseAtLineEnd => 'Pause after each line';
@override
String get watchWordsTitle => 'Words in this video';
@override
String get watchWordsNewOnly => 'New only';
@override
String get watchWordsFinding => 'Finding the words…';
@override
String watchWordCount(int count) {
return '$count×';
}
@override
String get watchAdd => 'Add';
@override
String watchAdded(String word) {
return '$word added, with this line';
}
@override
String get watchTapAWord => 'Tap a word of the subtitles to look it up.';
@override
String watchFormOf(String word) {
return 'A form of $word';
}
@override
String get watchFailed => 'The video couldn\'t be played.';
}
/// The translations for English, as used in the United Kingdom (`en_GB`).