Add native Windows compatibility layer

This commit is contained in:
pewdiepie-archdaemon
2026-06-01 15:09:47 +09:00
parent ead7c01822
commit 0888a3b3e6
54 changed files with 1104 additions and 267 deletions

View File

@@ -178,7 +178,7 @@ class PersonalDocsManager:
"""Load the list of indexed directories from persistent storage."""
try:
if os.path.exists(self.directories_file):
with open(self.directories_file, 'r') as f:
with open(self.directories_file, 'r', encoding="utf-8") as f:
self.indexed_directories = json.load(f)
logger.info(f"Loaded {len(self.indexed_directories)} indexed directories")
else:
@@ -190,7 +190,7 @@ class PersonalDocsManager:
def save_directories(self):
"""Save the list of indexed directories to persistent storage."""
try:
with open(self.directories_file, 'w') as f:
with open(self.directories_file, 'w', encoding="utf-8") as f:
json.dump(self.indexed_directories, f, indent=2)
logger.info(f"Saved {len(self.indexed_directories)} indexed directories")
except Exception as e:
@@ -200,7 +200,7 @@ class PersonalDocsManager:
"""Load the set of excluded file paths from persistent storage."""
try:
if os.path.exists(self._excluded_file):
with open(self._excluded_file, 'r') as f:
with open(self._excluded_file, 'r', encoding="utf-8") as f:
self.excluded_files = set(json.load(f))
else:
self.excluded_files = set()
@@ -210,7 +210,7 @@ class PersonalDocsManager:
def _save_excluded(self):
try:
with open(self._excluded_file, 'w') as f:
with open(self._excluded_file, 'w', encoding="utf-8") as f:
json.dump(list(self.excluded_files), f)
except Exception as e:
logger.error(f"Error saving excluded files: {e}")