mirror of
https://github.com/rommapp/romm.git
synced 2026-06-28 14:56:01 +00:00
last bit of cleanup
This commit is contained in:
@@ -85,32 +85,32 @@ class BaseTaskStatusResponse(TaskExecutionResponse):
|
||||
|
||||
class ScanTaskStatusResponse(BaseTaskStatusResponse):
|
||||
task_type: Literal[TaskType.SCAN]
|
||||
meta: ScanTaskMeta | None
|
||||
meta: ScanTaskMeta
|
||||
|
||||
|
||||
class ConversionTaskStatusResponse(BaseTaskStatusResponse):
|
||||
task_type: Literal[TaskType.CONVERSION]
|
||||
meta: ConversionTaskMeta | None
|
||||
meta: ConversionTaskMeta
|
||||
|
||||
|
||||
class UpdateTaskStatusResponse(BaseTaskStatusResponse):
|
||||
task_type: Literal[TaskType.UPDATE]
|
||||
meta: UpdateTaskMeta | None
|
||||
meta: UpdateTaskMeta
|
||||
|
||||
|
||||
class CleanupTaskStatusResponse(BaseTaskStatusResponse):
|
||||
task_type: Literal[TaskType.CLEANUP]
|
||||
meta: CleanupTaskMeta | None
|
||||
meta: CleanupTaskMeta
|
||||
|
||||
|
||||
class WatcherTaskStatusResponse(BaseTaskStatusResponse):
|
||||
task_type: Literal[TaskType.WATCHER]
|
||||
meta: WatcherTaskMeta | None
|
||||
meta: WatcherTaskMeta
|
||||
|
||||
|
||||
class GenericTaskStatusResponse(BaseTaskStatusResponse):
|
||||
task_type: Literal[TaskType.GENERIC]
|
||||
meta: GenericTaskMeta | None
|
||||
meta: GenericTaskMeta
|
||||
|
||||
|
||||
TaskStatusResponse = Union[
|
||||
|
||||
@@ -488,11 +488,10 @@ async def scan_platforms(
|
||||
await socket_manager.emit("scan:done_ko", e.message)
|
||||
return scan_stats
|
||||
|
||||
# Precalculate total platforms and ROMs
|
||||
scan_stats.update(total_platforms=len(fs_platforms))
|
||||
|
||||
for platform in fs_platforms:
|
||||
pl = Platform(fs_slug=platform)
|
||||
fs_roms = await fs_rom_handler.get_roms(pl)
|
||||
for platform_slug in fs_platforms:
|
||||
fs_roms = await fs_rom_handler.get_roms(Platform(fs_slug=platform_slug))
|
||||
scan_stats.update(total_roms=scan_stats.total_roms + len(fs_roms))
|
||||
|
||||
async def stop_scan():
|
||||
|
||||
@@ -51,13 +51,10 @@ class CleanupOrphanedResourcesTask(Task):
|
||||
log.info(f"Starting {self.title} task...")
|
||||
|
||||
cleanup_stats = CleanupStats()
|
||||
cleanup_stats.update(cleanup_stats=cleanup_stats.to_dict())
|
||||
|
||||
roms_resources_path = os.path.join(RESOURCES_BASE_PATH, "roms")
|
||||
if not os.path.exists(roms_resources_path):
|
||||
cleanup_stats.update(
|
||||
total_platforms=0, total_roms=0, removed_platforms=0, removed_roms=0
|
||||
)
|
||||
cleanup_stats.update()
|
||||
log.info("Resources path does not exist, skipping cleanup")
|
||||
return cleanup_stats.to_dict()
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ class SyncRetroAchievementsProgressTask(PeriodicTask):
|
||||
for user in users:
|
||||
try:
|
||||
user_progression = await meta_ra_handler.get_user_progression(
|
||||
user.ra_username or "",
|
||||
user.ra_username, # type: ignore[union-attr]
|
||||
current_progression=cast(
|
||||
RAUserProgression | None, user.ra_progression
|
||||
),
|
||||
|
||||
@@ -12,6 +12,6 @@ export type CleanupTaskStatusResponse = {
|
||||
started_at: (string | null);
|
||||
ended_at: (string | null);
|
||||
task_type: "cleanup";
|
||||
meta: (CleanupTaskMeta | null);
|
||||
meta: CleanupTaskMeta;
|
||||
};
|
||||
|
||||
|
||||
@@ -12,6 +12,6 @@ export type ConversionTaskStatusResponse = {
|
||||
started_at: (string | null);
|
||||
ended_at: (string | null);
|
||||
task_type: "conversion";
|
||||
meta: (ConversionTaskMeta | null);
|
||||
meta: ConversionTaskMeta;
|
||||
};
|
||||
|
||||
|
||||
@@ -12,6 +12,6 @@ export type GenericTaskStatusResponse = {
|
||||
started_at: (string | null);
|
||||
ended_at: (string | null);
|
||||
task_type: "generic";
|
||||
meta: (GenericTaskMeta | null);
|
||||
meta: GenericTaskMeta;
|
||||
};
|
||||
|
||||
|
||||
@@ -12,6 +12,6 @@ export type ScanTaskStatusResponse = {
|
||||
started_at: (string | null);
|
||||
ended_at: (string | null);
|
||||
task_type: "scan";
|
||||
meta: (ScanTaskMeta | null);
|
||||
meta: ScanTaskMeta;
|
||||
};
|
||||
|
||||
|
||||
@@ -12,6 +12,6 @@ export type UpdateTaskStatusResponse = {
|
||||
started_at: (string | null);
|
||||
ended_at: (string | null);
|
||||
task_type: "update";
|
||||
meta: (UpdateTaskMeta | null);
|
||||
meta: UpdateTaskMeta;
|
||||
};
|
||||
|
||||
|
||||
@@ -12,6 +12,6 @@ export type WatcherTaskStatusResponse = {
|
||||
started_at: (string | null);
|
||||
ended_at: (string | null);
|
||||
task_type: "watcher";
|
||||
meta: (WatcherTaskMeta | null);
|
||||
meta: WatcherTaskMeta;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user