about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rwxr-xr-xPodWeb.py13
2 files changed, 11 insertions, 3 deletions
diff --git a/.gitignore b/.gitignore
index 95ca0ac..e7c06d4 100644
--- a/.gitignore
+++ b/.gitignore
@@ -115,6 +115,7 @@ celerybeat.pid
 # Environments
 .env
 .venv
+.wenv
 env/
 venv/
 ENV/
diff --git a/PodWeb.py b/PodWeb.py
index 9123348..e9c9a49 100755
--- a/PodWeb.py
+++ b/PodWeb.py
@@ -20,9 +20,12 @@ options = {
     "serverlist": os.path.normpath(
         os.path.join(os.path.expanduser("~/.config/podweb"), "serverlist")
     ),
-    "downloadlocation": os.path.expanduser("~/Podcasts"),
+    "downloadlocation": os.path.expanduser("~/Podcasts")
 }
 
+if os.name == "nt":
+    options.update({"serverlist": os.path.join(os.getenv('LOCALAPPDATA'), "podweb", "serverlist")})
+
 yaml = YAML()
 yaml.allow_duplicate_keys = True
 
@@ -79,9 +82,13 @@ class PodWeb:
                 self.config_path, "podcasts"
             )
         else:
-            self.config_path = os.path.normpath(os.path.expanduser("~/.config/podweb"))
+            if os.name == "nt":
+                self.config_path = os.path.join(os.getenv('LOCALAPPDATA'), "podweb")
+                self.db_path = os.path.join(self.config_path, "data")
+            else:
+                self.config_path = os.path.normpath(os.path.expanduser("~/.config/podweb"))
+                self.db_path = os.path.expanduser("~/.local/share/podweb")
             self.config_filepath = os.path.join(self.config_path, "config.yaml")
-            self.db_path = os.path.expanduser("~/.local/share/podweb")
             self.db_filepath = os.path.join(self.db_path, "podweb.db")
         if config:
             self.config_filepath = os.path.normpath(os.path.expanduser(config))