class MPD::CommandBuilder

Defined in:

crystal_mpd/command_builder.cr

Class Method Summary

Class Method Detail

def self.build(command : String, *args) : String #

[View source]
def self.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:"


[View source]