From 7ed4b8ae3ce8b3a288b038d7a954d0624d645f43 Mon Sep 17 00:00:00 2001 From: Jason Dove Date: Wed, 13 Oct 2021 13:30:26 -0500 Subject: [PATCH] fix startup bug (#426) --- CHANGELOG.md | 2 ++ ErsatzTV/Services/RunOnce/PlatformSettingsService.cs | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d1eeba33e..54b5ca1f1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## [Unreleased] +### Fixed +- Fix startup bug for linux/docker installations without a `/dev/dri` folder ## [0.1.2-alpha] - 2021-10-12 ### Added diff --git a/ErsatzTV/Services/RunOnce/PlatformSettingsService.cs b/ErsatzTV/Services/RunOnce/PlatformSettingsService.cs index c61d1d8f9..30c8a5850 100644 --- a/ErsatzTV/Services/RunOnce/PlatformSettingsService.cs +++ b/ErsatzTV/Services/RunOnce/PlatformSettingsService.cs @@ -1,5 +1,4 @@ -using System.Collections.Generic; -using System.Linq; +using System.Linq; using System.Runtime.InteropServices; using System.Threading; using System.Threading.Tasks; @@ -40,8 +39,9 @@ namespace ErsatzTV.Services.RunOnce IConfigElementRepository repo = scope.ServiceProvider.GetRequiredService(); await repo.Upsert(ConfigElementKey.FFmpegSaveReports, false); } - - if (runtimeInfo != null && runtimeInfo.IsOSPlatform(OSPlatform.Linux)) + + if (runtimeInfo != null && runtimeInfo.IsOSPlatform(OSPlatform.Linux) && + System.IO.Directory.Exists("/dev/dri")) { ILocalFileSystem localFileSystem = scope.ServiceProvider.GetRequiredService(); IMemoryCache memoryCache = scope.ServiceProvider.GetRequiredService();