Allow CLI player controls for music
authorJoseph Nuthalapati <njoseph@riseup.net>
Fri, 27 Mar 2020 07:10:51 +0000 (12:40 +0530)
committerJoseph Nuthalapati <njoseph@riseup.net>
Fri, 27 Mar 2020 07:10:51 +0000 (12:40 +0530)
Signed-off-by: Joseph Nuthalapati <njoseph@riseup.net>
src/lib.nim

index 1b6ed93770f0571ec0d9df915cb4302371637e17..f5ee8a57001ccafa86eeb8f99e2f861b347eb2f8 100644 (file)
@@ -51,7 +51,10 @@ proc presentVideoOptions*(searchResults: seq[SearchResult]) =
 
 proc play*(player: string, args: openArray[string], title: string) =
   styledEcho "\n", fgGreen, "Playing ", styleBright, fgMagenta, title
-  discard execProcess(player, args=args, options=processOptions)
+  if "--no-video" in args:
+    discard execShellCmd(&"{player} {args.join(\" \")}")
+  else:
+    discard execProcess(player, args=args, options=processOptions)
 
 proc download*(args: openArray[string], title: string) =
   styledEcho "\n", fgGreen, "Downloading ", styleBright, fgMagenta, title