refactor: format

This commit is contained in:
edde746
2026-01-01 22:06:36 +01:00
parent 1d67a5d992
commit 1191d8a438
7 changed files with 12 additions and 49 deletions
+1 -4
View File
@@ -312,10 +312,7 @@ class PlayerNative implements Player {
// Explicitly set SubtitleTrack.off so episode navigation can detect "subtitles off"
selectedTrack = SubtitleTrack.off;
} else {
selectedTrack = _state.tracks.subtitle.cast<SubtitleTrack?>().firstWhere(
(t) => t?.id == id,
orElse: () => null,
);
selectedTrack = _state.tracks.subtitle.cast<SubtitleTrack?>().firstWhere((t) => t?.id == id, orElse: () => null);
}
_state = _state.copyWith(track: _state.track.copyWith(subtitle: selectedTrack));
+1 -4
View File
@@ -171,10 +171,7 @@ class _MainScreenState extends State<MainScreen> with RouteAware {
],
),
actions: [
TextButton(
onPressed: () => Navigator.pop(dialogContext),
child: Text(t.common.later),
),
TextButton(onPressed: () => Navigator.pop(dialogContext), child: Text(t.common.later)),
TextButton(
onPressed: () async {
await UpdateService.skipVersion(updateInfo['latestVersion']);
+2 -8
View File
@@ -86,10 +86,7 @@ class _MediaDetailScreenState extends State<MediaDetailScreen> with WatchStateAw
if (metadata != null && mounted) {
setState(() {
_fullMetadata = metadata.copyWith(
serverId: widget.metadata.serverId,
serverName: widget.metadata.serverName,
);
_fullMetadata = metadata.copyWith(serverId: widget.metadata.serverId, serverName: widget.metadata.serverName);
_onDeckEpisode = onDeckEpisode?.copyWith(
serverId: widget.metadata.serverId,
serverName: widget.metadata.serverName,
@@ -103,10 +100,7 @@ class _MediaDetailScreenState extends State<MediaDetailScreen> with WatchStateAw
if (mounted) {
setState(() {
_seasons = seasons
.map((s) => s.copyWith(
serverId: widget.metadata.serverId,
serverName: widget.metadata.serverName,
))
.map((s) => s.copyWith(serverId: widget.metadata.serverId, serverName: widget.metadata.serverName))
.toList();
});
}
+1 -3
View File
@@ -103,9 +103,7 @@ class DiscordRPCService {
_currentMetadata = metadata;
_currentClient = client;
_playbackStartTime = DateTime.now();
_mediaDuration = metadata.duration != null
? Duration(milliseconds: metadata.duration!)
: null;
_mediaDuration = metadata.duration != null ? Duration(milliseconds: metadata.duration!) : null;
_currentPosition = Duration.zero;
_cachedThumbnailUrl = null;
+2 -5
View File
@@ -52,9 +52,7 @@ class MacOSWindowService {
if (!Platform.isMacOS) return;
if (!_initialized) {
await _channel.invokeMethod('initialize', {
'enableWindowDelegate': enableWindowDelegate,
});
await _channel.invokeMethod('initialize', {'enableWindowDelegate': enableWindowDelegate});
_initialized = true;
}
@@ -80,8 +78,7 @@ class MacOSWindowService {
// MARK: - Traffic Light Buttons
/// Show or hide all traffic light buttons (close, miniaturize, zoom).
static Future<void> setTrafficLightsVisible(bool visible) =>
_invoke('setTrafficLightsVisible', {'visible': visible});
static Future<void> setTrafficLightsVisible(bool visible) => _invoke('setTrafficLightsVisible', {'visible': visible});
// MARK: - Fullscreen
+1 -6
View File
@@ -231,12 +231,7 @@ class HubSectionState extends State<HubSection> {
}
Future<void> _navigateToItem(dynamic item) async {
await navigateToMediaItem(
context,
item,
onRefresh: widget.onRefresh,
playDirectly: widget.isInContinueWatching,
);
await navigateToMediaItem(context, item, onRefresh: widget.onRefresh, playDirectly: widget.isInContinueWatching);
}
void _navigateToHubDetail(BuildContext context) {
+4 -19
View File
@@ -816,8 +816,7 @@ class _PlexVideoControlsState extends State<PlexVideoControls> with WindowListen
// Debounce: ignore taps within 200ms of last skip action
// This prevents double-taps from counting as two separate skips
if (_lastSkipActionTime != null &&
now.difference(_lastSkipActionTime!).inMilliseconds < 200) {
if (_lastSkipActionTime != null && now.difference(_lastSkipActionTime!).inMilliseconds < 200) {
return;
}
@@ -1039,20 +1038,11 @@ class _PlexVideoControlsState extends State<PlexVideoControls> with WindowListen
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
AppIcon(
Symbols.fast_forward_rounded,
fill: 1,
color: Colors.white,
size: 16,
),
AppIcon(Symbols.fast_forward_rounded, fill: 1, color: Colors.white, size: 16),
const SizedBox(width: 4),
const Text(
'2x',
style: TextStyle(
color: Colors.white,
fontSize: 14,
fontWeight: FontWeight.bold,
),
style: TextStyle(color: Colors.white, fontSize: 14, fontWeight: FontWeight.bold),
),
],
),
@@ -1536,12 +1526,7 @@ class _PlexVideoControlsState extends State<PlexVideoControls> with WindowListen
),
),
// Speed indicator overlay for long-press 2x
if (_showSpeedIndicator)
Positioned.fill(
child: IgnorePointer(
child: _buildSpeedIndicator(),
),
),
if (_showSpeedIndicator) Positioned.fill(child: IgnorePointer(child: _buildSpeedIndicator())),
// Skip intro/credits button
if (_currentMarker != null)
Positioned(