fix(playback): canonicalize base URL scheme case

FFmpeg's protocol lookup is case-sensitive, so a stored "Https://" base
URL reaches mpv verbatim through the direct-play string concat and fails
with "Protocol not found" (API calls survive because Dart's Uri
lowercases the scheme). Canonicalize at Jellyfin URL intake and in the
connection constructor so persisted configs self-heal on load, and
register mpv-escaped (https\://) redaction variants so option-value
logs stop leaking the server host.

close #1465
This commit is contained in:
edde746
2026-07-04 19:43:32 +02:00
parent dd09e421bf
commit 837fdf4031
7 changed files with 100 additions and 12 deletions
+7 -5
View File
@@ -1,6 +1,7 @@
import '../media/media_backend.dart';
import '../models/plex/plex_home_user.dart';
import '../services/plex_auth_service.dart';
import '../utils/url_utils.dart';
/// Identifier of a backend kind a [Connection] points at. Lighter-weight than
/// [MediaBackend] for places that only care about persistence/auth shape
@@ -233,7 +234,7 @@ class JellyfinConnection extends Connection {
JellyfinConnection({
required this.id,
required this.baseUrl,
required String baseUrl,
List<String>? baseUrls,
required this.serverName,
required this.serverMachineId,
@@ -245,7 +246,8 @@ class JellyfinConnection extends Connection {
this.status = ConnectionStatus.unknown,
required this.createdAt,
this.lastAuthenticatedAt,
}) : baseUrls = _normalizeBaseUrls(baseUrl, baseUrls);
}) : baseUrl = canonicalizeBaseUrl(baseUrl),
baseUrls = _normalizeBaseUrls(baseUrl, baseUrls);
@override
ConnectionKind get kind => ConnectionKind.jellyfin;
@@ -273,9 +275,9 @@ class JellyfinConnection extends Connection {
final seen = <String>{};
void add(String url) {
final trimmed = url.trim();
if (trimmed.isEmpty || !seen.add(trimmed)) return;
result.add(trimmed);
final normalized = canonicalizeBaseUrl(url);
if (normalized.isEmpty || !seen.add(normalized)) return;
result.add(normalized);
}
add(activeBaseUrl);