]> njoseph.me Git - nimcoon.git/commitdiff
Turns out both vlc and mpv have similar options!
authorJoseph Nuthalapati <njoseph@riseup.net>
Fri, 10 Jan 2020 18:37:03 +0000 (00:07 +0530)
committerJoseph Nuthalapati <njoseph@riseup.net>
Fri, 10 Jan 2020 18:37:03 +0000 (00:07 +0530)
Signed-off-by: Joseph Nuthalapati <njoseph@riseup.net>
config.nim
nimcoon.nim

index f55bc9dc02dfdd0838802d7435e04bd69df193fd..2431cd72dea17e2389c180f9243430487c2929e2 100644 (file)
@@ -1,5 +1,3 @@
-import tables
-
 # Your configuration here.
 
 # Supported video players in order of preference.
@@ -8,14 +6,3 @@ let supportedPlayers* = ["mpv", "cvlc"]
 
 # Only show these many results
 let limit* = 10
-
-# Some NimCoon options mapped to player options
-let playerOptions* = { "mpv": {
-                        "musicOnly": "--no-video",
-                        "fullScreen": "--fullscreen"
-                      }.toTable,
-                      "cvlc": {
-                        "musicOnly": "--no-video",
-                        "fullScreen": "--fs"
-                      }.toTable
-                    }.toTable
index f47b249b1de9abb4e1974e77b299de2787fe5797..cea1797f1cc542b957f273c04e9bb8f58c5ab3b5 100644 (file)
@@ -9,7 +9,6 @@ import
   std/[terminal],
   strtabs,
   strutils,
-  tables,
   uri,
   xmltree
 
@@ -96,10 +95,10 @@ proc main() =
   var args = @[searchResults[number].url]
 
   if musicOnly:
-    args.add(playerOptions[player]["musicOnly"])
+    args.add("--no-video")
 
   if fullScreen:
-    args.add(playerOptions[player]["fullScreen"])
+    args.add("--fullscreen")
 
   # Play the video using the preferred/available media player
   play(player, args)