-proc play*(player: string, args: openArray[string], title: string) =
- styledEcho "\n", fgGreen, "Playing ", styleBright, fgMagenta, title
+
+func buildPlayerArgs(url: string, options: Table[string, bool], player: string): seq[string] =
+ let musicOnly = if options["musicOnly"]: "--no-video" else: ""
+ let fullScreen = if options["fullScreen"]: "--fullscreen" else: ""
+ filterIt([url, musicOnly, fullScreen], it != "")
+
+
+proc play*(player: string, options: Table[string, bool], url: string, title: string = "") =
+ let args = buildPlayerArgs(url, options, player)
+ if title != "":
+ styledEcho "\n", fgGreen, "Playing ", styleBright, fgMagenta, title