Skip to content

Commit 958ad28

Browse files
committed
fix: fix missing update in playback init & translate french comments
1 parent 5c7f90b commit 958ad28

File tree

3 files changed

+20
-14
lines changed

3 files changed

+20
-14
lines changed

lib/client/plex_client.dart

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -480,18 +480,19 @@ class PlexClient {
480480
queryParams['subtitleStreamID'] = subtitleStreamID;
481481
}
482482
if (allParts) {
483-
// If no streams to select, return early
484-
if (queryParams.isEmpty) {
485-
return true;
486-
}
483+
// If no streams to select, return early
484+
if (queryParams.isEmpty) {
485+
return true;
486+
}
487487

488-
// Use PUT request on /library/parts/{partId}
489-
final response = await _dio.put(
490-
'/library/parts/$partId',
491-
queryParameters: queryParams,
492-
);
488+
// Use PUT request on /library/parts/{partId}
489+
final response = await _dio.put(
490+
'/library/parts/$partId',
491+
queryParameters: queryParams,
492+
);
493493

494-
return response.statusCode == 200;
494+
return response.statusCode == 200;
495+
}
495496
} catch (e) {
496497
appLogger.e('Failed to select streams', error: e);
497498
return false;

lib/screens/video_player_screen.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import '../i18n/strings.g.dart';
3131

3232
Map<String, dynamic>? _isoLangTable;
3333

34-
/// Charger la table en mémoire au démarrage du widget (dans initState par exemple)
34+
/// Load the table into memory at widget startup (in initState for example)
3535
Future<void> loadIsoTable() async {
3636
final data = await rootBundle.loadString('lib/data/iso_6369_codes.json');
3737
_isoLangTable = json.decode(data) as Map<String, dynamic>;
@@ -226,10 +226,10 @@ class VideoPlayerScreenState extends State<VideoPlayerScreen>
226226
}
227227
}
228228

229-
/// Convertit un code à 2 lettres "fr", "nl", "ca" en code Plex à 3 lettres, ou renvoie null si inconnu
229+
/// Converts a 2-letter code like "fr", "nl", "ca" to a Plex 3-letter code, or returns null if unknown
230230
String? _iso6391ToPlex6392(String? code) {
231231
if (code == null || code.isEmpty || _isoLangTable == null) return null;
232-
// Prend la base "fr" de "fr-FR"
232+
// Takes the base "fr" from "fr-FR"
233233
final lang = code.split('-').first.toLowerCase();
234234
final langEntry = _isoLangTable![lang] as Map<String, dynamic>?;
235235
return langEntry?['639-2'] as String?;

lib/services/playback_initialization_service.dart

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ class PlaybackInitializationService {
9696
// Return result with available versions for UI updates
9797
return PlaybackInitializationResult(
9898
availableVersions: playbackData.availableVersions,
99+
mediaInfo: mediaInfo,
99100
);
100101
} catch (e) {
101102
if (e is PlaybackException) {
@@ -199,8 +200,12 @@ class PlaybackInitializationService {
199200
/// Result of playback initialization
200201
class PlaybackInitializationResult {
201202
final List<dynamic> availableVersions;
203+
final PlexMediaInfo? mediaInfo;
202204

203-
PlaybackInitializationResult({required this.availableVersions});
205+
PlaybackInitializationResult({
206+
required this.availableVersions,
207+
this.mediaInfo,
208+
});
204209
}
205210

206211
/// Exception thrown when playback initialization fails

0 commit comments

Comments
 (0)