mirror of
https://github.com/immich-app/immich.git
synced 2025-03-01 15:11:21 +01:00
Added explicit type for job count
This commit is contained in:
parent
46994c3355
commit
471a60dcb0
4 changed files with 21 additions and 26 deletions
|
@ -8,11 +8,11 @@ import 'package:openapi/api.dart';
|
||||||
## Properties
|
## Properties
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------ | ------------- | ------------- | -------------
|
------------ | ------------- | ------------- | -------------
|
||||||
**active** | **num** | |
|
**active** | **int** | |
|
||||||
**completed** | **num** | |
|
**completed** | **int** | |
|
||||||
**failed** | **num** | |
|
**failed** | **int** | |
|
||||||
**delayed** | **num** | |
|
**delayed** | **int** | |
|
||||||
**waiting** | **num** | |
|
**waiting** | **int** | |
|
||||||
|
|
||||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
|
|
@ -20,15 +20,15 @@ class JobCounts {
|
||||||
required this.waiting,
|
required this.waiting,
|
||||||
});
|
});
|
||||||
|
|
||||||
num active;
|
int active;
|
||||||
|
|
||||||
num completed;
|
int completed;
|
||||||
|
|
||||||
num failed;
|
int failed;
|
||||||
|
|
||||||
num delayed;
|
int delayed;
|
||||||
|
|
||||||
num waiting;
|
int waiting;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
bool operator ==(Object other) => identical(this, other) || other is JobCounts &&
|
bool operator ==(Object other) => identical(this, other) || other is JobCounts &&
|
||||||
|
@ -79,21 +79,11 @@ class JobCounts {
|
||||||
}());
|
}());
|
||||||
|
|
||||||
return JobCounts(
|
return JobCounts(
|
||||||
active: json[r'active'] == null
|
active: mapValueOfType<int>(json, r'active')!,
|
||||||
? null
|
completed: mapValueOfType<int>(json, r'completed')!,
|
||||||
: num.parse(json[r'active'].toString()),
|
failed: mapValueOfType<int>(json, r'failed')!,
|
||||||
completed: json[r'completed'] == null
|
delayed: mapValueOfType<int>(json, r'delayed')!,
|
||||||
? null
|
waiting: mapValueOfType<int>(json, r'waiting')!,
|
||||||
: num.parse(json[r'completed'].toString()),
|
|
||||||
failed: json[r'failed'] == null
|
|
||||||
? null
|
|
||||||
: num.parse(json[r'failed'].toString()),
|
|
||||||
delayed: json[r'delayed'] == null
|
|
||||||
? null
|
|
||||||
: num.parse(json[r'delayed'].toString()),
|
|
||||||
waiting: json[r'waiting'] == null
|
|
||||||
? null
|
|
||||||
: num.parse(json[r'waiting'].toString()),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
|
|
@ -1,10 +1,15 @@
|
||||||
import { ApiProperty } from '@nestjs/swagger';
|
import { ApiProperty } from '@nestjs/swagger';
|
||||||
|
|
||||||
export class JobCounts {
|
export class JobCounts {
|
||||||
|
@ApiProperty({ type: 'integer' })
|
||||||
active!: number;
|
active!: number;
|
||||||
|
@ApiProperty({ type: 'integer' })
|
||||||
completed!: number;
|
completed!: number;
|
||||||
|
@ApiProperty({ type: 'integer' })
|
||||||
failed!: number;
|
failed!: number;
|
||||||
|
@ApiProperty({ type: 'integer' })
|
||||||
delayed!: number;
|
delayed!: number;
|
||||||
|
@ApiProperty({ type: 'integer' })
|
||||||
waiting!: number;
|
waiting!: number;
|
||||||
}
|
}
|
||||||
export class AllJobStatusResponseDto {
|
export class AllJobStatusResponseDto {
|
||||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Add table
Reference in a new issue