From 14096a796c748c3861ad74ea199c349ad762faf0 Mon Sep 17 00:00:00 2001
From: Magnus Walbeck <mw@mwalbeck.org>
Date: Sat, 30 Jan 2021 13:22:27 +0100
Subject: [PATCH] Fix names in config file

---
 .vscode/settings.json |  5 ++++-
 README.md             | 14 +++++++-------
 podweasel/__init__.py |  8 ++++----
 3 files changed, 15 insertions(+), 12 deletions(-)

diff --git a/.vscode/settings.json b/.vscode/settings.json
index b202003..4f063db 100644
--- a/.vscode/settings.json
+++ b/.vscode/settings.json
@@ -4,5 +4,8 @@
   "[python]": {
     "editor.tabSize": 4,
     "editor.rulers": [88]
-  }
+  },
+  "python.formatting.provider": "black",
+  "python.linting.flake8Enabled": true,
+  "python.linting.enabled": true,
 }
diff --git a/README.md b/README.md
index 0af32b8..ae04b98 100644
--- a/README.md
+++ b/README.md
@@ -10,14 +10,14 @@ Podweasels main configuration file is called `.podweasel.json` and should be loc
 
 ```
 {
-    "podcast-directory"     : "/home/<USER>/podcasts",
+    "podcast_directory"     : "/home/<USER>/podcasts",
     "maxnum"                : 5,
-    "cover-image"           : true,
-    "cover-image-name"      : "folder",
-    "rename-episodes"       : true,
-    "date-format"           : "%Y-%m-%d",
-    "connection-timeout"    : 10,
-    "conncetion-retries"    : 3
+    "cover_image"           : true,
+    "cover_image_name"      : "folder",
+    "rename_episodes"       : true,
+    "date_format"           : "%Y-%m-%d",
+    "connection_timeout"    : 10,
+    "conncetion_retries"    : 3
 }
 ```
 
diff --git a/podweasel/__init__.py b/podweasel/__init__.py
index 8d1f836..6372360 100755
--- a/podweasel/__init__.py
+++ b/podweasel/__init__.py
@@ -66,7 +66,7 @@ def print_green(s):
 
 
 def get_folder(shortname):
-    base = CONFIGURATION["podcast-directory"]
+    base = CONFIGURATION["podcast_directory"]
     return os.path.join(base, shortname)
 
 
@@ -306,7 +306,7 @@ def get_original_filename(url):
 
 
 def file_exists(shortname, filename):
-    base = CONFIGURATION["podcast-directory"]
+    base = CONFIGURATION["podcast_directory"]
     if os.path.exists(os.path.join(base, shortname, filename)):
         return True
 
@@ -350,7 +350,7 @@ def download_multiple(feed, maxnum):
 
 def download_single(folder, url, filename):
     print(url)
-    base = CONFIGURATION["podcast-directory"]
+    base = CONFIGURATION["podcast_directory"]
 
     if "connection_timeout" in CONFIGURATION:
         connection_timeout = CONFIGURATION["connection_timeout"]
@@ -415,7 +415,7 @@ def available_feeds():
     contain a json configuration file describing which elements
     have been downloaded already, and how many will be kept.
     """
-    base = CONFIGURATION["podcast-directory"]
+    base = CONFIGURATION["podcast_directory"]
     paths = [
         p
         for p in os.listdir(base)