diff --git a/src/NzbDrone.Common/Composition/AssemblyLoader.cs b/src/NzbDrone.Common/Composition/AssemblyLoader.cs index 0ff69fb0c..9d8a1afd5 100644 --- a/src/NzbDrone.Common/Composition/AssemblyLoader.cs +++ b/src/NzbDrone.Common/Composition/AssemblyLoader.cs @@ -63,7 +63,23 @@ public static void RegisterSQLiteResolver() private static IntPtr LoadSqliteNativeLib(string libraryName, Assembly assembly, DllImportSearchPath? dllImportSearchPath) { - var mappedName = OsInfo.IsLinux && libraryName == "sqlite3" ? "libsqlite3.so.0" : libraryName; + ArgumentException.ThrowIfNullOrWhiteSpace(libraryName); + + var mappedName = libraryName; + + if (libraryName is "sqlite3" or "e_sqlite3") + { + if (OsInfo.IsLinux) + { + if (NativeLibrary.TryLoad(libraryName, assembly, dllImportSearchPath, out var libHandle)) + { + return libHandle; + } + + mappedName = "libsqlite3.so.0"; + } + } + return NativeLibrary.Load(mappedName, assembly, dllImportSearchPath); } }