refactor: format
This commit is contained in:
@@ -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));
|
||||
|
||||
@@ -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']);
|
||||
|
||||
@@ -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();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user