fix(services): check for possible None progress when moving folders

This commit is contained in:
Houkime 2024-02-19 00:10:13 +00:00 committed by Inex Code
parent 17a1e34c0d
commit c22802f693
2 changed files with 4 additions and 1 deletions

View file

@ -60,6 +60,9 @@ def move_folders_to_volume(
job: Job,
) -> None:
current_progress = job.progress
if current_progress is None:
current_progress = 0
folder_percentage = 50 // len(folders)
for folder in folders:
folder_name = get_foldername(folder)

View file

@ -311,8 +311,8 @@ class Service(ABC):
Only changes userdata
"""
service_id = cls.get_id()
with WriteUserData() as user_data:
service_id = cls.get_id()
if "modules" not in user_data:
user_data["modules"] = {}
if service_id not in user_data["modules"]: