]> njoseph.me Git - nimcoon.git/blobdiff - nimcoon.nim
Store player config options in a hashtable
[nimcoon.git] / nimcoon.nim
index f69813dbf4566702e67cacd161e6ca545e80e026..c838b343f66568c6e054d4f05de5bd7c55e20590 100644 (file)
@@ -10,10 +10,11 @@ import
   std/[terminal],
   strtabs,
   strutils,
   std/[terminal],
   strtabs,
   strutils,
+  tables,
   uri,
   xmltree
 
   uri,
   xmltree
 
-import preferences
+import config
 
 type
   SearchResult = tuple[title: string, url: string]
 
 type
   SearchResult = tuple[title: string, url: string]
@@ -100,13 +101,10 @@ proc main() =
   var command = @[player, searchResults[number].url]
 
   if musicOnly:
   var command = @[player, searchResults[number].url]
 
   if musicOnly:
-    command.add("--no-video")
+    command.add(playerOptions[player]["musicOnly"])
 
   if fullScreen:
 
   if fullScreen:
-    if player == "cvlc":
-      command.add("--fullscreen")
-    if player == "mpv":
-      command.add("--fs")
+    command.add(playerOptions[player]["fullScreen"])
 
   # Play the video using the preferred/available media player
   play(command.join(" "))
 
   # Play the video using the preferred/available media player
   play(command.join(" "))