feat: Implement API handlers for live and VOD streaming and create database module.

This commit is contained in:
Michael committed 2026-01-01 20:13:56 +01:00
1 parent 72e28a398a
commit ce82b9e824
3 files changed
+47 -11

No files matched your search

+23
View File
@@ -373,6 +373,29 @@ class AppDatabase {
);
}
/// Check if NVIDIA GPU is enabled in any user's settings
/// This is a server-wide setting that applies to all streaming
bool isNvidiaGpuEnabled() {
try {
// Check all user settings for enable_nvidia_gpu
final result = _db.select(
'SELECT settings_json FROM user_settings ORDER BY updated_at DESC LIMIT 1',
);
if (result.isEmpty) return false;
final settingsJson = result.first['settings_json'] as String;
// Parse JSON to check the setting
// Settings key: enable_nvidia_gpu
if (settingsJson.contains('"enable_nvidia_gpu":true')) {
return true;
}
} catch (e) {
print('[Database] Error checking GPU setting: $e');
}
return false;
}
/// Close database connection
void close() {
_db.dispose();