From 46817cb7cbd9bd6b24e92ed9e292c62ce20d20ac Mon Sep 17 00:00:00 2001 From: Joseph Nuthalapati Date: Sat, 11 Jan 2020 00:07:03 +0530 Subject: [PATCH] Turns out both vlc and mpv have similar options! Signed-off-by: Joseph Nuthalapati --- config.nim | 13 ------------- nimcoon.nim | 5 ++--- 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/config.nim b/config.nim index f55bc9d..2431cd7 100644 --- a/config.nim +++ b/config.nim @@ -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 diff --git a/nimcoon.nim b/nimcoon.nim index f47b249..cea1797 100644 --- a/nimcoon.nim +++ b/nimcoon.nim @@ -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) -- 2.43.0