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

@ -61,6 +61,9 @@ dependencies:
# (LoopbackWebAuth) plugs in here, and opens the browser and brings the window
# back with the same packages flutter_web_auth_2 uses.
flutter_math_fork: ^0.7.4
# Keeps the token of a Jellyfin server in the system's keyring; Serverpod's
# sign-in keeps its session there with it already.
flutter_secure_storage: ^10.0.0
flutter_web_auth_2_platform_interface: ^5.0.0
fractional_indexing_dart: ^1.0.7
# Pinned exactly: every device on one app version must compute the same
@ -71,9 +74,20 @@ dependencies:
path: ../halkyon_learn_client
# Anki's fields are HTML; the editor brings this parser along already.
html: ^0.15.6
# Talks to Jellyfin servers; Serverpod's client brings it along already.
http: ^1.6.0
intl: ^0.20.3
lucide_icons_flutter: ^3.1.20
material_ui: ^1.5.0
# Videos from a Jellyfin server on Linux and Windows, where video_player has
# no player: libmpv (MIT; libmpv LGPL), the system's on Linux (a Linux build
# needs libmpv-dev), bundled on Windows. Used directly rather than behind
# video_player, which can't keep libmpv from drawing the video's own
# subtitles. Not fvp, whose libmdk is closed.
media_kit: ^1.2.6
media_kit_libs_linux: ^1.2.1
media_kit_libs_windows_video: ^1.0.11
media_kit_video: ^2.0.1
package_info_plus: ^10.2.2
path: ^1.9.1
# SVG path data, for the strokes KanjiVG draws characters with.
@ -94,6 +108,9 @@ dependencies:
# Anki collections are SQLite databases (the sync engine already bundles it).
sqlite3: ^3.6.0
url_launcher: ^6.3.2
# Videos from a Jellyfin server elsewhere: flutter.dev's player (ExoPlayer on
# Android, AVPlayer on iOS and macOS).
video_player: ^2.14.1
window_to_front: ^0.0.4
youtube_player_iframe: ^6.0.2