k-mktr commited on
Commit
de0d65b
·
verified ·
1 Parent(s): 2a37e4a

Update release_notes.py

Browse files
Files changed (1) hide show
  1. release_notes.py +13 -9
release_notes.py CHANGED
@@ -8,15 +8,19 @@ LOCAL_CACHE_FILE = "release_notes.json"
8
  def load_release_notes():
9
  """Load release notes from Nextcloud with local file fallback."""
10
  try:
11
- with config.get_nextcloud_client_instance() as nc: # Use as context manager
12
- # Try to load from Nextcloud
13
- remote_data = nc.files.download(NEXTCLOUD_NOTES_PATH)
14
- if remote_data:
15
- notes = json.loads(remote_data.decode('utf-8'))
16
- # Update local cache
17
- with open(LOCAL_CACHE_FILE, 'w') as f:
18
- json.dump(notes, f, indent=2)
19
- return notes
 
 
 
 
20
  except Exception as e:
21
  print(f"Could not load release notes from Nextcloud: {e}")
22
 
 
8
  def load_release_notes():
9
  """Load release notes from Nextcloud with local file fallback."""
10
  try:
11
+ nc = Nextcloud(
12
+ nextcloud_url=config.NEXTCLOUD_URL,
13
+ nc_auth_user=config.NEXTCLOUD_USERNAME,
14
+ nc_auth_pass=config.NEXTCLOUD_PASSWORD
15
+ )
16
+ # Try to load from Nextcloud
17
+ remote_data = nc.files.download(NEXTCLOUD_NOTES_PATH)
18
+ if remote_data:
19
+ notes = json.loads(remote_data.decode('utf-8'))
20
+ # Update local cache
21
+ with open(LOCAL_CACHE_FILE, 'w') as f:
22
+ json.dump(notes, f, indent=2)
23
+ return notes
24
  except Exception as e:
25
  print(f"Could not load release notes from Nextcloud: {e}")
26