mirror of
https://github.com/seanmorley15/AdventureLog.git
synced 2025-07-28 09:19:37 +02:00
Import and Export Functionality (#698)
* feat(backup): add BackupViewSet for data export and import functionality * Fixed frontend returning corrupt binary data * feat(import): enhance import functionality with confirmation check and improved city/region/country handling * Potential fix for code scanning alert no. 29: Information exposure through an exception Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> * Refactor response handling to use arrayBuffer instead of bytes * Refactor image cleanup command to use LocationImage model and update import/export view to include backup and restore functionality * Update backup export versioning and improve data restore warning message * Enhance image navigation and localization support in modal components * Refactor location handling in Immich integration components for consistency * Enhance backup and restore functionality with improved localization and error handling * Improve accessibility by adding 'for' attribute to backup file input label --------- Co-authored-by: Christian Zäske <blitzdose@gmail.com> Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
This commit is contained in:
parent
493a13995c
commit
c461f7b105
31 changed files with 2843 additions and 1114 deletions
|
@ -1,7 +1,7 @@
|
|||
import os
|
||||
from django.core.management.base import BaseCommand
|
||||
from django.conf import settings
|
||||
from adventures.models import AdventureImage, Attachment
|
||||
from adventures.models import LocationImage, Attachment
|
||||
from users.models import CustomUser
|
||||
|
||||
|
||||
|
@ -21,8 +21,8 @@ class Command(BaseCommand):
|
|||
# Get all image and attachment file paths from database
|
||||
used_files = set()
|
||||
|
||||
# Get AdventureImage file paths
|
||||
for img in AdventureImage.objects.all():
|
||||
# Get LocationImage file paths
|
||||
for img in LocationImage.objects.all():
|
||||
if img.image and img.image.name:
|
||||
used_files.add(os.path.join(settings.MEDIA_ROOT, img.image.name))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue