fix(hubs): keep recently-added detail scoped to its library

close #1282
This commit is contained in:
edde746
2026-06-08 22:03:28 +02:00
parent d44a8994ce
commit 7de7802368
5 changed files with 97 additions and 11 deletions
+6 -3
View File
@@ -376,9 +376,12 @@ class MediaServerHttpClient {
Uri _buildUri(String path, Map<String, dynamic>? queryParameters) {
final base = baseUrl.endsWith('/') ? baseUrl : '$baseUrl/';
final cleanPath = path.startsWith('/') ? path.substring(1) : path;
final query = MediaServerHttpClient.encodeQueryParameters(queryParameters);
final full = query.isEmpty ? '$base$cleanPath' : '$base$cleanPath?$query';
return Uri.parse(full);
// [path] may already carry a query string (e.g. Plex home hub keys like
// `/hubs/home/recentlyAdded?type=2&sectionID=2`). Merge via [_appendQuery] —
// the same path used for absolute URLs in [_send] — so extra params join with
// `&` instead of producing a malformed double-`?` URL that corrupts the
// existing params (e.g. sectionID).
return _appendQuery(Uri.parse('$base$cleanPath'), queryParameters);
}
/// Append query parameters to an already-parsed URI.