diff --git a/lib/i18n/az.i18n.json b/lib/i18n/az.i18n.json index 79dce66b..ff88d999 100644 --- a/lib/i18n/az.i18n.json +++ b/lib/i18n/az.i18n.json @@ -763,6 +763,7 @@ "deleteThisProfileTitle": "Bu profil silinsin?", "deleteThisProfileMessage": "${displayName} silinəcək. Qoşulmalar təsirlənmir.", "active": "Aktiv", + "viaPlexAccount": "", "manage": "İdarə et", "delete": "Sil", "signOut": "Çıxış et", diff --git a/lib/i18n/bg.i18n.json b/lib/i18n/bg.i18n.json index 13d0c7c1..1342be46 100644 --- a/lib/i18n/bg.i18n.json +++ b/lib/i18n/bg.i18n.json @@ -763,6 +763,7 @@ "deleteThisProfileTitle": "Да се изтрие ли този профил?", "deleteThisProfileMessage": "Премахване на ${displayName}. Връзките не се засягат.", "active": "Активен", + "viaPlexAccount": "", "manage": "Управление", "delete": "Изтрий", "signOut": "Изход", diff --git a/lib/i18n/da.i18n.json b/lib/i18n/da.i18n.json index 013a80fd..a11db77c 100644 --- a/lib/i18n/da.i18n.json +++ b/lib/i18n/da.i18n.json @@ -763,6 +763,7 @@ "deleteThisProfileTitle": "Slet denne profil?", "deleteThisProfileMessage": "Fjern ${displayName}. Forbindelser påvirkes ikke.", "active": "Aktiv", + "viaPlexAccount": "", "manage": "Administrer", "delete": "Slet", "signOut": "Log ud", diff --git a/lib/i18n/de.i18n.json b/lib/i18n/de.i18n.json index e40b00e6..94011c9f 100644 --- a/lib/i18n/de.i18n.json +++ b/lib/i18n/de.i18n.json @@ -763,6 +763,7 @@ "deleteThisProfileTitle": "Dieses Profil löschen?", "deleteThisProfileMessage": "${displayName} entfernen. Verbindungen bleiben unberührt.", "active": "Aktiv", + "viaPlexAccount": "", "manage": "Verwalten", "delete": "Löschen", "signOut": "Abmelden", diff --git a/lib/i18n/en.i18n.json b/lib/i18n/en.i18n.json index c5bcfdb1..1f869235 100644 --- a/lib/i18n/en.i18n.json +++ b/lib/i18n/en.i18n.json @@ -763,6 +763,7 @@ "deleteThisProfileTitle": "Delete this profile?", "deleteThisProfileMessage": "Remove ${displayName}. Connections aren't affected.", "active": "Active", + "viaPlexAccount": "via ${name}", "manage": "Manage", "delete": "Delete", "signOut": "Sign out", diff --git a/lib/i18n/es.i18n.json b/lib/i18n/es.i18n.json index e8f8d11a..ae5e5a3b 100644 --- a/lib/i18n/es.i18n.json +++ b/lib/i18n/es.i18n.json @@ -763,6 +763,7 @@ "deleteThisProfileTitle": "¿Eliminar este perfil?", "deleteThisProfileMessage": "Eliminar ${displayName}. Las conexiones no se verán afectadas.", "active": "Activo", + "viaPlexAccount": "", "manage": "Administrar", "delete": "Eliminar", "signOut": "Cerrar sesión", diff --git a/lib/i18n/fr.i18n.json b/lib/i18n/fr.i18n.json index 9f3b0c48..e098cd6b 100644 --- a/lib/i18n/fr.i18n.json +++ b/lib/i18n/fr.i18n.json @@ -763,6 +763,7 @@ "deleteThisProfileTitle": "Supprimer ce profil ?", "deleteThisProfileMessage": "Supprimer ${displayName}. Les connexions ne sont pas affectées.", "active": "Actif", + "viaPlexAccount": "", "manage": "Gérer", "delete": "Supprimer", "signOut": "Se déconnecter", diff --git a/lib/i18n/hu.i18n.json b/lib/i18n/hu.i18n.json index 132b1ca9..958579f2 100644 --- a/lib/i18n/hu.i18n.json +++ b/lib/i18n/hu.i18n.json @@ -763,6 +763,7 @@ "deleteThisProfileTitle": "Törlöd ezt a profilt?", "deleteThisProfileMessage": "${displayName} eltávolítása. A kapcsolatokat nem érinti.", "active": "Aktív", + "viaPlexAccount": "", "manage": "Kezelés", "delete": "Törlés", "signOut": "Kijelentkezés", diff --git a/lib/i18n/it.i18n.json b/lib/i18n/it.i18n.json index e2e21996..452a65c0 100644 --- a/lib/i18n/it.i18n.json +++ b/lib/i18n/it.i18n.json @@ -763,6 +763,7 @@ "deleteThisProfileTitle": "Eliminare questo profilo?", "deleteThisProfileMessage": "Rimuovi ${displayName}. Le connessioni resteranno invariate.", "active": "Attivo", + "viaPlexAccount": "", "manage": "Gestisci", "delete": "Elimina", "signOut": "Esci", diff --git a/lib/i18n/ja.i18n.json b/lib/i18n/ja.i18n.json index 8e021c89..f5f8fb57 100644 --- a/lib/i18n/ja.i18n.json +++ b/lib/i18n/ja.i18n.json @@ -762,6 +762,7 @@ "deleteThisProfileTitle": "このプロフィールを削除しますか?", "deleteThisProfileMessage": "${displayName}を削除します。接続には影響しません。", "active": "アクティブ", + "viaPlexAccount": "", "manage": "管理", "delete": "削除", "signOut": "サインアウト", diff --git a/lib/i18n/kk.i18n.json b/lib/i18n/kk.i18n.json index c30420d6..d8e59f99 100644 --- a/lib/i18n/kk.i18n.json +++ b/lib/i18n/kk.i18n.json @@ -763,6 +763,7 @@ "deleteThisProfileTitle": "Осы профиль өшірілсін бе?", "deleteThisProfileMessage": "${displayName} өшіріледі. Қосылымдарға әсер етпейді.", "active": "Белсенді", + "viaPlexAccount": "", "manage": "Басқару", "delete": "Өшіру", "signOut": "Шығу", diff --git a/lib/i18n/ko.i18n.json b/lib/i18n/ko.i18n.json index ee2d7870..dcb15dca 100644 --- a/lib/i18n/ko.i18n.json +++ b/lib/i18n/ko.i18n.json @@ -762,6 +762,7 @@ "deleteThisProfileTitle": "이 프로필을 삭제하시겠습니까?", "deleteThisProfileMessage": "${displayName}을(를) 제거합니다. 연결에는 영향이 없습니다.", "active": "활성", + "viaPlexAccount": "", "manage": "관리", "delete": "삭제", "signOut": "로그아웃", diff --git a/lib/i18n/nb.i18n.json b/lib/i18n/nb.i18n.json index b5f1246f..573d1815 100644 --- a/lib/i18n/nb.i18n.json +++ b/lib/i18n/nb.i18n.json @@ -763,6 +763,7 @@ "deleteThisProfileTitle": "Slett denne profilen?", "deleteThisProfileMessage": "Fjern ${displayName}. Tilkoblinger påvirkes ikke.", "active": "Aktiv", + "viaPlexAccount": "", "manage": "Administrer", "delete": "Slett", "signOut": "Logg ut", diff --git a/lib/i18n/nl.i18n.json b/lib/i18n/nl.i18n.json index d7df7c1c..2f16e05f 100644 --- a/lib/i18n/nl.i18n.json +++ b/lib/i18n/nl.i18n.json @@ -763,6 +763,7 @@ "deleteThisProfileTitle": "Dit profiel verwijderen?", "deleteThisProfileMessage": "Verwijder ${displayName}. Verbindingen blijven ongewijzigd.", "active": "Actief", + "viaPlexAccount": "", "manage": "Beheren", "delete": "Verwijderen", "signOut": "Afmelden", diff --git a/lib/i18n/pl.i18n.json b/lib/i18n/pl.i18n.json index 5fdb94c2..5d7f7da7 100644 --- a/lib/i18n/pl.i18n.json +++ b/lib/i18n/pl.i18n.json @@ -765,6 +765,7 @@ "deleteThisProfileTitle": "Usunąć ten profil?", "deleteThisProfileMessage": "Usuń ${displayName}. Połączenia nie zostaną zmienione.", "active": "Aktywny", + "viaPlexAccount": "", "manage": "Zarządzaj", "delete": "Usuń", "signOut": "Wyloguj się", diff --git a/lib/i18n/pt.i18n.json b/lib/i18n/pt.i18n.json index 0cdec741..1f4dc34b 100644 --- a/lib/i18n/pt.i18n.json +++ b/lib/i18n/pt.i18n.json @@ -763,6 +763,7 @@ "deleteThisProfileTitle": "Excluir este perfil?", "deleteThisProfileMessage": "Remover ${displayName}. As conexões não serão afetadas.", "active": "Ativo", + "viaPlexAccount": "", "manage": "Gerenciar", "delete": "Excluir", "signOut": "Sair", diff --git a/lib/i18n/ru.i18n.json b/lib/i18n/ru.i18n.json index 7529b9d4..4533fb53 100644 --- a/lib/i18n/ru.i18n.json +++ b/lib/i18n/ru.i18n.json @@ -765,6 +765,7 @@ "deleteThisProfileTitle": "Удалить этот профиль?", "deleteThisProfileMessage": "Удалить ${displayName}. Подключения не изменятся.", "active": "Активный", + "viaPlexAccount": "", "manage": "Управление", "delete": "Удалить", "signOut": "Выйти", diff --git a/lib/i18n/strings.g.dart b/lib/i18n/strings.g.dart index 597d9896..82305407 100644 --- a/lib/i18n/strings.g.dart +++ b/lib/i18n/strings.g.dart @@ -4,7 +4,7 @@ /// To regenerate, run: `dart run slang` /// /// Locales: 22 -/// Strings: 32737 (1488 per locale) +/// Strings: 32738 (1488 per locale) // coverage:ignore-file // ignore_for_file: type=lint, unused_import diff --git a/lib/i18n/strings_en.g.dart b/lib/i18n/strings_en.g.dart index 73308506..09ece13f 100644 --- a/lib/i18n/strings_en.g.dart +++ b/lib/i18n/strings_en.g.dart @@ -2296,6 +2296,9 @@ class Translations$profiles$en { /// en: 'Active' String get active => 'Active'; + /// en: 'via ${name}' + String viaPlexAccount({required Object name}) => 'via ${name}'; + /// en: 'Manage' String get manage => 'Manage'; @@ -6754,6 +6757,7 @@ extension on Translations { 'profiles.deleteThisProfileTitle' => 'Delete this profile?', 'profiles.deleteThisProfileMessage' => ({required Object displayName}) => 'Remove ${displayName}. Connections aren\'t affected.', 'profiles.active' => 'Active', + 'profiles.viaPlexAccount' => ({required Object name}) => 'via ${name}', 'profiles.manage' => 'Manage', 'profiles.delete' => 'Delete', 'profiles.signOut' => 'Sign out', @@ -7062,9 +7066,9 @@ extension on Translations { 'explore.stats.onHold' => ({required Object n}) => '${n} on hold', 'explore.stats.dropped' => ({required Object n}) => '${n} dropped', 'explore.season.winter' => 'Winter', - 'explore.season.spring' => 'Spring', _ => null, } ?? switch (path) { + 'explore.season.spring' => 'Spring', 'explore.season.summer' => 'Summer', 'explore.season.fall' => 'Fall', 'explore.season.withYear' => ({required Object season, required Object year}) => '${season} ${year}', @@ -7576,9 +7580,9 @@ extension on Translations { 'externalPlayer.playerPackage' => 'Package Name', 'externalPlayer.playerUrlScheme' => 'URL Scheme', 'externalPlayer.off' => 'Off', - 'externalPlayer.launchFailed' => 'Failed to open external player', _ => null, } ?? switch (path) { + 'externalPlayer.launchFailed' => 'Failed to open external player', 'externalPlayer.appNotInstalled' => ({required Object name}) => '${name} is not installed', 'externalPlayer.playInExternalPlayer' => 'Play in External Player', 'metadataEdit.editMetadata' => 'Edit...', diff --git a/lib/i18n/sv.i18n.json b/lib/i18n/sv.i18n.json index bef4f5eb..8ddb3df2 100644 --- a/lib/i18n/sv.i18n.json +++ b/lib/i18n/sv.i18n.json @@ -763,6 +763,7 @@ "deleteThisProfileTitle": "Ta bort denna profil?", "deleteThisProfileMessage": "Ta bort ${displayName}. Anslutningar påverkas inte.", "active": "Aktiv", + "viaPlexAccount": "", "manage": "Hantera", "delete": "Ta bort", "signOut": "Logga ut", diff --git a/lib/i18n/tr.i18n.json b/lib/i18n/tr.i18n.json index 9ddba236..8e01931b 100644 --- a/lib/i18n/tr.i18n.json +++ b/lib/i18n/tr.i18n.json @@ -763,6 +763,7 @@ "deleteThisProfileTitle": "Bu profil silinsin mi?", "deleteThisProfileMessage": "${displayName} kişisi kaldırılacak. Bağlantılar etkilenmez.", "active": "Aktif", + "viaPlexAccount": "", "manage": "Yönet", "delete": "Sil", "signOut": "Çıkış Yap", diff --git a/lib/i18n/uz.i18n.json b/lib/i18n/uz.i18n.json index 5c021374..0b4e9e68 100644 --- a/lib/i18n/uz.i18n.json +++ b/lib/i18n/uz.i18n.json @@ -763,6 +763,7 @@ "deleteThisProfileTitle": "Ushbu profil oʻchirilsinmi?", "deleteThisProfileMessage": "${displayName} oʻchiriladi. Ulanishlarga taʼsir qilmaydi.", "active": "Faol", + "viaPlexAccount": "", "manage": "Boshqarish", "delete": "Oʻchirish", "signOut": "Chiqish", diff --git a/lib/i18n/zh-Hant.i18n.json b/lib/i18n/zh-Hant.i18n.json index d3be3e2c..215da132 100644 --- a/lib/i18n/zh-Hant.i18n.json +++ b/lib/i18n/zh-Hant.i18n.json @@ -762,6 +762,7 @@ "deleteThisProfileTitle": "刪除此使用者設定檔?", "deleteThisProfileMessage": "將移除 ${displayName}。連線資訊將不受影響。", "active": "使用中", + "viaPlexAccount": "", "manage": "管理", "delete": "刪除", "signOut": "登出", diff --git a/lib/i18n/zh.i18n.json b/lib/i18n/zh.i18n.json index bffe47cf..41d5f6fd 100644 --- a/lib/i18n/zh.i18n.json +++ b/lib/i18n/zh.i18n.json @@ -762,6 +762,7 @@ "deleteThisProfileTitle": "删除此用户资料?", "deleteThisProfileMessage": "移除 ${displayName}。连接不会受影响。", "active": "当前使用", + "viaPlexAccount": "", "manage": "管理", "delete": "删除", "signOut": "退出登录", diff --git a/lib/screens/profile/profile_switch_screen.dart b/lib/screens/profile/profile_switch_screen.dart index 21cc50dd..e5c70edd 100644 --- a/lib/screens/profile/profile_switch_screen.dart +++ b/lib/screens/profile/profile_switch_screen.dart @@ -4,6 +4,7 @@ import 'package:flutter/material.dart'; import 'package:material_symbols_icons/symbols.dart'; import 'package:provider/provider.dart'; +import '../../connection/connection.dart'; import '../../connection/connection_registry.dart'; import '../../focus/focusable_wrapper.dart'; import '../../i18n/strings.g.dart'; @@ -331,7 +332,16 @@ class _ProfileSwitchScreenState extends State with MountedS final parentId = profile.parentConnectionId; if (parentId != null) { final conn = view.connectionsById[parentId]; - if (conn != null) chips.add(_ChipData(backend: conn.backend, label: conn.displayLabel)); + if (conn != null) { + chips.add( + _ChipData( + backend: conn.backend, + label: conn is PlexAccountConnection + ? t.profiles.viaPlexAccount(name: conn.accountLabel) + : conn.displayLabel, + ), + ); + } } } final pcs = visibleProfileConnections( diff --git a/test/screens/profile/profile_switch_screen_test.dart b/test/screens/profile/profile_switch_screen_test.dart index 6b6ea9ee..ec9942fe 100644 --- a/test/screens/profile/profile_switch_screen_test.dart +++ b/test/screens/profile/profile_switch_screen_test.dart @@ -368,6 +368,71 @@ void main() { await tester.pumpWidget(const SizedBox.shrink()); await tester.pump(); }); + + testWidgets('labels a Plex Home parent connection as an account, not as the profile', (tester) async { + final db = AppDatabase.forTesting(NativeDatabase.memory()); + final profile = Profile.plexHome( + id: 'home-alice', + displayName: 'Alice', + parentConnectionId: 'plex-account', + plexHomeUserUuid: 'alice-uuid', + createdAt: DateTime(2026, 1, 1), + ); + final profiles = _FakeProfileRegistry(db, [profile]); + final connections = _FakeConnectionRegistry(db, [ + PlexAccountConnection( + id: 'plex-account', + accountToken: 'token', + clientIdentifier: 'client', + accountLabel: 'Bob', + createdAt: DateTime(2026, 1, 1), + ), + ]); + final profileConnections = _FakeProfileConnectionRegistry(db); + final storage = await StorageService.getInstance(); + final plexHome = PlexHomeService( + connections: connections, + profileConnections: profileConnections, + storage: storage, + plexHomeUserFetcher: (_) async => const [], + ); + final activeProfile = ActiveProfileProvider( + registry: profiles, + plexHome: plexHome, + connections: connections, + profileConnections: profileConnections, + storage: storage, + ); + addTearDown(() async { + activeProfile.dispose(); + await plexHome.dispose(); + await db.close(); + }); + + await tester.pumpWidget( + TranslationProvider( + child: MultiProvider( + providers: [ + Provider.value(value: storage), + Provider.value(value: profiles), + Provider.value(value: profileConnections), + Provider.value(value: connections), + Provider.value(value: plexHome), + ChangeNotifierProvider.value(value: activeProfile), + ], + child: MaterialApp(theme: monoTheme(dark: true), home: const ProfileSwitchScreen()), + ), + ), + ); + await tester.pumpAndSettle(); + + expect(find.text('Alice'), findsOneWidget); + expect(find.text(t.profiles.viaPlexAccount(name: 'Bob')), findsOneWidget); + expect(find.text('Bob'), findsNothing); + + await tester.pumpWidget(const SizedBox.shrink()); + await tester.pump(); + }); } /// Tile labels in painted order. Only the two names the reorder tests seed are