Skip to content

Commit 15bca56

Browse files
ruslan.hryshchenkoclaude
andcommitted
style: fix SwiftFormat issues in ScriptCommands
- Add MARK comments before each class - Remove redundant type annotations Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent a3b1c9f commit 15bca56

File tree

1 file changed

+26
-4
lines changed

1 file changed

+26
-4
lines changed

Core/Services/Scripting/ScriptCommands.swift

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import AppKit
22
import Foundation
33

4-
// MARK: - AppleScript Commands
4+
// MARK: - PlayCommand
55

66
/// Play command: start or resume playback.
77
@objc(KasetPlayCommand)
@@ -15,6 +15,8 @@ final class PlayCommand: NSScriptCommand {
1515
}
1616
}
1717

18+
// MARK: - PauseCommand
19+
1820
/// Pause command: pause playback.
1921
@objc(KasetPauseCommand)
2022
final class PauseCommand: NSScriptCommand {
@@ -27,6 +29,8 @@ final class PauseCommand: NSScriptCommand {
2729
}
2830
}
2931

32+
// MARK: - PlayPauseCommand
33+
3034
/// PlayPause command: toggle play/pause state.
3135
@objc(KasetPlayPauseCommand)
3236
final class PlayPauseCommand: NSScriptCommand {
@@ -39,6 +43,8 @@ final class PlayPauseCommand: NSScriptCommand {
3943
}
4044
}
4145

46+
// MARK: - NextTrackCommand
47+
4248
/// NextTrack command: skip to the next track.
4349
@objc(KasetNextTrackCommand)
4450
final class NextTrackCommand: NSScriptCommand {
@@ -51,6 +57,8 @@ final class NextTrackCommand: NSScriptCommand {
5157
}
5258
}
5359

60+
// MARK: - PreviousTrackCommand
61+
5462
/// PreviousTrack command: go to the previous track.
5563
@objc(KasetPreviousTrackCommand)
5664
final class PreviousTrackCommand: NSScriptCommand {
@@ -63,6 +71,8 @@ final class PreviousTrackCommand: NSScriptCommand {
6371
}
6472
}
6573

74+
// MARK: - SetVolumeCommand
75+
6676
/// SetVolume command: set the playback volume (0-100).
6777
@objc(KasetSetVolumeCommand)
6878
final class SetVolumeCommand: NSScriptCommand {
@@ -82,6 +92,8 @@ final class SetVolumeCommand: NSScriptCommand {
8292
}
8393
}
8494

95+
// MARK: - ToggleShuffleCommand
96+
8597
/// ToggleShuffle command: toggle shuffle mode.
8698
@objc(KasetToggleShuffleCommand)
8799
final class ToggleShuffleCommand: NSScriptCommand {
@@ -94,6 +106,8 @@ final class ToggleShuffleCommand: NSScriptCommand {
94106
}
95107
}
96108

109+
// MARK: - CycleRepeatCommand
110+
97111
/// CycleRepeat command: cycle through repeat modes (off, all, one).
98112
@objc(KasetCycleRepeatCommand)
99113
final class CycleRepeatCommand: NSScriptCommand {
@@ -106,6 +120,8 @@ final class CycleRepeatCommand: NSScriptCommand {
106120
}
107121
}
108122

123+
// MARK: - ToggleMuteCommand
124+
109125
/// ToggleMute command: toggle mute state.
110126
@objc(KasetToggleMuteCommand)
111127
final class ToggleMuteCommand: NSScriptCommand {
@@ -118,24 +134,26 @@ final class ToggleMuteCommand: NSScriptCommand {
118134
}
119135
}
120136

137+
// MARK: - GetPlayerInfoCommand
138+
121139
/// GetPlayerInfo command: returns current player state as JSON.
122140
@objc(KasetGetPlayerInfoCommand)
123141
final class GetPlayerInfoCommand: NSScriptCommand {
124142
override func performDefaultImplementation() -> Any? {
125143
// AppleScript runs on main thread, so we can assume MainActor isolation
126-
let result: String = MainActor.assumeIsolated {
144+
let result = MainActor.assumeIsolated {
127145
guard let playerService = PlayerService.shared else {
128146
return "{\"error\": \"Player not available\"}"
129147
}
130148

131149
let track = playerService.currentTrack
132-
let repeatMode: String = switch playerService.repeatMode {
150+
let repeatMode = switch playerService.repeatMode {
133151
case .off: "off"
134152
case .all: "all"
135153
case .one: "one"
136154
}
137155

138-
let likeStatus: String = switch playerService.currentTrackLikeStatus {
156+
let likeStatus = switch playerService.currentTrackLikeStatus {
139157
case .like: "liked"
140158
case .dislike: "disliked"
141159
case .indifferent: "none"
@@ -176,6 +194,8 @@ final class GetPlayerInfoCommand: NSScriptCommand {
176194
}
177195
}
178196

197+
// MARK: - LikeTrackCommand
198+
179199
/// LikeTrack command: like/unlike the current track.
180200
@objc(KasetLikeTrackCommand)
181201
final class LikeTrackCommand: NSScriptCommand {
@@ -188,6 +208,8 @@ final class LikeTrackCommand: NSScriptCommand {
188208
}
189209
}
190210

211+
// MARK: - DislikeTrackCommand
212+
191213
/// DislikeTrack command: dislike/undislike the current track.
192214
@objc(KasetDislikeTrackCommand)
193215
final class DislikeTrackCommand: NSScriptCommand {

0 commit comments

Comments
 (0)