Preferences go into a config file
authorJoseph Nuthalapati <njoseph@Josephs-MacBook-Pro.local>
Wed, 4 Dec 2019 19:17:42 +0000 (00:47 +0530)
committerJoseph Nuthalapati <njoseph@Josephs-MacBook-Pro.local>
Wed, 4 Dec 2019 19:17:42 +0000 (00:47 +0530)
TODO.md
clitube.nim
preferences.nim [new file with mode: 0644]

diff --git a/TODO.md b/TODO.md
index b6f9883d754257bc8db234ddf256ed97c1f51c14..2c41ca87b63922a04c3d9735ff8dcaba85d2eae8 100644 (file)
--- a/TODO.md
+++ b/TODO.md
@@ -2,8 +2,8 @@
 
 - [x] Pretty colors in terminal
 - [x] Get rid of temp file or make one temp file per user
+- [x] Preferences should go into a config file
 - [ ] Terminal color themes?
-- [ ] Preferences should go into a config file
 - [ ] Use cligen to create a proper CLI
-
+- [ ] Spawn video player and quit immediately
 
index 89e863cb5bdf8af381fb44cbf9ac0f3dc466b8ba..0c21a941bbaa8d30f206b2eded4371c134f3a277 100644 (file)
@@ -10,11 +10,7 @@ import strutils
 import uri
 import xmltree
 
-# Supported video players in order of preference
-let supportedPlayers = ["mpv", "vlc"]
-
-# Only show these many results
-let limit = 10
+import preferences
 
 type SearchResult = tuple[title: string, url: string]
 
@@ -54,7 +50,7 @@ let searchResults = extractTitlesAndUrls(getYoutubePage(input))
 presentVideoOptions(searchResults)
 
 stdout.styledWrite(fgYellow, "Choose video number: ")
-let number: int = parseInt(readLine(stdin))
+let number = parseInt(readLine(stdin))
 
 styledEcho "\n", fgGreen, "Playing ", styleBright, fgMagenta, searchResults[number].title
 
diff --git a/preferences.nim b/preferences.nim
new file mode 100644 (file)
index 0000000..078ea9e
--- /dev/null
@@ -0,0 +1,9 @@
+# Your preferences here.
+
+# Supported video players in order of preference.
+# Should be able to play YouTube videos directly.
+let supportedPlayers* = ["mpv", "vlc"]
+
+# Only show these many results
+let limit* = 10
+