Skip to content

Commit

Permalink
Linting
Browse files Browse the repository at this point in the history
  • Loading branch information
jacksongoode committed Feb 7, 2024
1 parent 1a629c4 commit ed55534
Showing 1 changed file with 10 additions and 15 deletions.
25 changes: 10 additions & 15 deletions psst-gui/src/controller/playback.rs
Original file line number Diff line number Diff line change
Expand Up @@ -414,27 +414,22 @@ where
Event::KeyDown(key) if key.code == Code::ArrowRight => {
if key.mods.shift() {
self.next();
} else {
if let Some(now_playing) = &data.playback.now_playing {
let current_position = now_playing.progress;
let max_position = now_playing.item.duration();
let seek_position =
(current_position + Duration::from_secs(10)).min(max_position);
self.seek(seek_position);
}
} else if let Some(now_playing) = &data.playback.now_playing {
let current_position = now_playing.progress;
let max_position = now_playing.item.duration();
let seek_position =
(current_position + Duration::from_secs(10)).min(max_position);
self.seek(seek_position);
}
ctx.set_handled();
}
Event::KeyDown(key) if key.code == Code::ArrowLeft => {
if key.mods.shift() {
self.previous();
} else {
if let Some(now_playing) = &data.playback.now_playing {
let current_position = now_playing.progress;
let seek_position =
current_position.saturating_sub(Duration::from_secs(10));
self.seek(seek_position);
}
} else if let Some(now_playing) = &data.playback.now_playing {
let current_position = now_playing.progress;
let seek_position = current_position.saturating_sub(Duration::from_secs(10));
self.seek(seek_position);
}
ctx.set_handled();
}
Expand Down

0 comments on commit ed55534

Please sign in to comment.