diff options
Diffstat (limited to 'player-android/lib/api/player_api_client.dart')
| -rw-r--r-- | player-android/lib/api/player_api_client.dart | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/player-android/lib/api/player_api_client.dart b/player-android/lib/api/player_api_client.dart index 0094a90..ffb3457 100644 --- a/player-android/lib/api/player_api_client.dart +++ b/player-android/lib/api/player_api_client.dart @@ -177,6 +177,15 @@ class PlayerApiClient implements ProgressSyncClient { /// hard-code URL segments (Dependency Inversion Principle). String shareUrl(String token) => '${rawDio.options.baseUrl}/s/$token'; + /// Returns the base URL of the underlying Dio instance without a trailing slash. + /// + /// Exposed so screens can construct absolute URLs from server-relative paths + /// (e.g., `/s/abc123/stream`) without reaching into [rawDio] directly. + /// Encapsulating this lookup here prevents the Dio transport detail from + /// leaking into the UI layer (Interface Segregation, Dependency Inversion). + String get baseUrl => + rawDio.options.baseUrl.replaceAll(RegExp(r'/$'), ''); + Future<void> regenerateThumbnail(int mediaId) => throw UnimplementedError(); Future<bool> toggleFavorite(int mediaId) => throw UnimplementedError(); |
