From: Joseph Nuthalapati Date: Fri, 10 Jan 2020 18:37:03 +0000 (+0530) Subject: Turns out both vlc and mpv have similar options! X-Git-Tag: 0.1.0~23 X-Git-Url: https://njoseph.me/gitweb/nimcoon.git/commitdiff_plain/46817cb7cbd9bd6b24e92ed9e292c62ce20d20ac?ds=sidebyside Turns out both vlc and mpv have similar options! Signed-off-by: Joseph Nuthalapati --- 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)