mirror of
https://github.com/FoggedLens/deflock-app.git
synced 2026-08-14 15:10:36 +02:00
better builtin profiles
This commit is contained in:
@@ -19,7 +19,12 @@ class ProfileState extends ChangeNotifier {
|
||||
// Initialize profiles from built-in and custom sources
|
||||
Future<void> init() async {
|
||||
// Initialize profiles: built-in + custom
|
||||
_profiles.add(CameraProfile.alpr());
|
||||
_profiles.add(CameraProfile.genericAlpr());
|
||||
_profiles.add(CameraProfile.flock());
|
||||
_profiles.add(CameraProfile.motorola());
|
||||
_profiles.add(CameraProfile.genetec());
|
||||
_profiles.add(CameraProfile.leonardo());
|
||||
_profiles.add(CameraProfile.neology());
|
||||
_profiles.addAll(await ProfileService().load());
|
||||
|
||||
// Load enabled profile IDs from prefs
|
||||
|
||||
@@ -18,7 +18,11 @@ class SessionState extends ChangeNotifier {
|
||||
AddCameraSession? get session => _session;
|
||||
|
||||
void startAddSession(List<CameraProfile> enabledProfiles) {
|
||||
_session = AddCameraSession(profile: enabledProfiles.first);
|
||||
final submittableProfiles = enabledProfiles.where((p) => p.isSubmittable).toList();
|
||||
final defaultProfile = submittableProfiles.isNotEmpty
|
||||
? submittableProfiles.first
|
||||
: enabledProfiles.first; // Fallback to any enabled profile
|
||||
_session = AddCameraSession(profile: defaultProfile);
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user