Spaces:
Running
Running
Update release_notes.py
Browse files- 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 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 |
|