some code cleanup and dependency updates
All checks were successful
Build and Push Multi-Arch Docker Image / build-and-push (push) Successful in 15m32s
All checks were successful
Build and Push Multi-Arch Docker Image / build-and-push (push) Successful in 15m32s
Signed-off-by: Peter Siegmund <developer@mars3142.org>
This commit was merged in pull request #21.
This commit is contained in:
@@ -12,5 +12,5 @@ enum PosterFormat {
|
||||
enum PosterOutput {
|
||||
image,
|
||||
lvgl,
|
||||
lvglBinary,
|
||||
lvgl9Binary,
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'package:cinema/common/image_resizer.dart';
|
||||
import 'package:cinema/feature/poster/domain/poster.enums.dart';
|
||||
import 'package:zard/zard.dart';
|
||||
|
||||
@@ -6,25 +7,25 @@ final _formats = PosterFormat.values.map((e) => e.name);
|
||||
final _outputs = PosterOutput.values.map((e) => e.name);
|
||||
|
||||
final posterSchema = z.map({
|
||||
'width': z.int().min(1, message: "'width' must be at least 1").max(4000, message: "'width' must be at most 4000"),
|
||||
'height': z.int().min(1, message: "'height' must be at least 1").max(4000, message: "'height' must be a most 4000"),
|
||||
'count': z.int().min(1, message: "'count' must be at least 1").max(20, message: "'count' must be at most 20"),
|
||||
'width': z.int().min(1, message: "'width' must be at least 1").max(4000, message: "'width' must be at most 4000").$default(ImageResizer.maxWidth),
|
||||
'height': z.int().min(1, message: "'height' must be at least 1").max(4000, message: "'height' must be a most 4000").$default(ImageResizer.maxHeight),
|
||||
'count': z.int().min(1, message: "'count' must be at least 1").max(20, message: "'count' must be at most 20").$default(4),
|
||||
'orientation': z.string().refine(
|
||||
(value) => _orientations.contains(value),
|
||||
message: "'orientation' must be either ${_orientations.join(', ')}",
|
||||
),
|
||||
'shuffle': z.bool(message: "'shuffle' must be a boolean value"),
|
||||
'language': z.string(message: "'language' must be a string").transform((value) => value.trim()),
|
||||
).$default(PosterOrientation.horizontal.name),
|
||||
'shuffle': z.bool(message: "'shuffle' must be a boolean value").$default(true),
|
||||
'language': z.string(message: "'language' must be a string").transform((value) => value.trim()).$default("de"),
|
||||
'backgroundColor': z.string().regex(
|
||||
RegExp(r'^#([a-fA-F0-9]{3}|[a-fA-F0-9]{6})$'),
|
||||
message: "The 'backgroundColor' must be a valid hexadecimal color code (e.g., #000 or #FF0000)",
|
||||
),
|
||||
).$default("#000000"),
|
||||
'format': z.string().refine(
|
||||
(value) => _formats.contains(value),
|
||||
message: "'format' must be either ${_formats.join(', ')}",
|
||||
),
|
||||
).$default(PosterFormat.jpeg.name),
|
||||
'output': z.string().refine(
|
||||
(value) => _outputs.contains(value),
|
||||
message: "'output' must be either ${_outputs.join(', ')}",
|
||||
),
|
||||
).$default(PosterOutput.lvgl9Binary.name),
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user