fix(jellyfin): a tap on someone a server shows names them, the password asked

Jellyfin v10.11 and later no longer say which accounts have a password
(HasPassword is always true, jellyfin/jellyfin#14950), so the demo's
account was listed as "With a password" and only named in the form.
Every listed account is now named in the form with the password field
focused, which says to leave it empty for an account without one, as
Jellyfin's own apps do; the line under each account goes.

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-14 01:52:42 +02:00
commit 107160cac4
Signed by: raisondetredev
GPG key ID: 07F6FCF405488B64
2 changed files with 62 additions and 66 deletions

View file

@ -238,15 +238,19 @@ void main() {
group('a Jellyfin server the instance suggests (decided 2026-10-13)', () {
setUp(() {
jellyfin.shownUsers = const [
JellyfinPublicUser(id: 'user-2', name: 'Demo', hasPassword: false),
JellyfinPublicUser(id: 'user-1', name: 'mika', hasPassword: true),
];
jellyfin
..shownUsers = const [
JellyfinPublicUser(id: 'user-2', name: 'Demo'),
JellyfinPublicUser(id: 'user-1', name: 'mika'),
]
..withoutPassword = const {'Demo'};
});
testWidgets('Add material offers it before signing in; the sign-in '
"finds it by itself and lists the server's public people, one "
'without a password signed in with a tap', (tester) async {
'without a password signed in with the password left empty', (
tester,
) async {
await show(
tester,
RoutePaths.studyset('japanese'),
@ -262,13 +266,16 @@ void main() {
expect(find.text('Demo'), findsOneWidget);
await tester.tap(find.text('Demo'));
await tester.pumpAndSettle();
expect(store.kept?.account, isNull);
await tester.tap(find.text('Sign in'));
await tester.pumpAndSettle();
expect(find.text('Libraries'), findsOneWidget);
expect(store.kept?.account?.userName, 'Demo');
});
testWidgets('one with a password is named in the form, which asks for '
'it', (tester) async {
testWidgets('a tap names one in the form, which asks for the '
'password', (tester) async {
await show(
tester,
RoutePaths.jellyfin('japanese'),
@ -285,6 +292,13 @@ void main() {
.text,
'mika',
);
expect(
tester
.widget<TextField>(find.widgetWithText(TextField, 'Password'))
.focusNode!
.hasFocus,
isTrue,
);
expect(store.kept?.account, isNull);
});
});

View file

@ -39,8 +39,9 @@ MockClient jellyfin12(List<http.Request> requests) => MockClient((
'id': 'e39b17f2',
'startupWizardCompleted': true,
}),
// The people the server shows on its login screen, one without a
// password (a demo's), in either case of field names.
// The people the server shows on its login screen, in either case of
// field names; whether one has a password, which servers before v10.11
// said, counts for nothing.
('GET', '/Users/Public') => json([
{'Name': 'Demo', 'Id': 'u-2', 'HasPassword': false},
{'name': 'mika', 'id': 'u-1', 'hasPassword': true},
@ -236,15 +237,14 @@ void main() {
},
);
test('lists the people a server shows on its login screen, and which '
'need a password', () async {
test('lists the people a server shows on its login screen', () async {
final server = await gateway.server(
Uri.parse('http://jellyfin.local:8096'),
);
expect(await gateway.publicUsers(server), const [
JellyfinPublicUser(id: 'u-2', name: 'Demo', hasPassword: false),
JellyfinPublicUser(id: 'u-1', name: 'mika', hasPassword: true),
JellyfinPublicUser(id: 'u-2', name: 'Demo'),
JellyfinPublicUser(id: 'u-1', name: 'mika'),
]);
});