mirror of
https://github.com/Radarr/Radarr
synced 2025-12-30 20:24:06 +01:00
Simplify DatabaseType logic
(cherry picked from commit c5baded3d63a9e77e180023559758108c1ced782)
This commit is contained in:
parent
dc2759ddcb
commit
066d9dd1d4
1 changed files with 4 additions and 11 deletions
|
|
@ -1,6 +1,7 @@
|
|||
using System;
|
||||
using System.Data;
|
||||
using System.Data.Common;
|
||||
using System.Data.SQLite;
|
||||
using System.Text.RegularExpressions;
|
||||
using Dapper;
|
||||
using NLog;
|
||||
|
|
@ -39,17 +40,9 @@ public DatabaseType DatabaseType
|
|||
{
|
||||
get
|
||||
{
|
||||
using (var db = _datamapperFactory())
|
||||
{
|
||||
if (db.ConnectionString.Contains(".db"))
|
||||
{
|
||||
return DatabaseType.SQLite;
|
||||
}
|
||||
else
|
||||
{
|
||||
return DatabaseType.PostgreSQL;
|
||||
}
|
||||
}
|
||||
using var db = _datamapperFactory();
|
||||
|
||||
return db is SQLiteConnection ? DatabaseType.SQLite : DatabaseType.PostgreSQL;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue