class

MPD::CommandBuilder

Inherits Reference < Object

Class methods

build(command : String, *args) : String
Source
parse_range(range : MPD::Range) : String

Converts a Crystal Range into an MPD-compatible "START:END" string.

MPD treats the range as exclusive, so:

  • Inclusive ranges (e.g., 0..2) must be converted to "0:3" to include index 2
  • Exclusive ranges (e.g., 0...2) are used directly as "0:2"

Examples: (0..20) -> "0:21" (0...20) -> "0:20" (..5) -> "0:6" (5..) -> "5:"

Source