mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-11 15:56:05 -07:00
Small change with the return value in the batch insert
This commit is contained in:
parent
2608e53399
commit
94f8cee015
1 changed files with 3 additions and 2 deletions
|
@ -277,7 +277,8 @@ namespace PlexRequests.Store.Repository
|
|||
public bool BatchInsert(IEnumerable<T> entities, string tableName, params string[] values)
|
||||
{
|
||||
// If we have nothing to update, then it didn't fail...
|
||||
if (!entities.Any())
|
||||
var enumerable = entities as T[] ?? entities.ToArray();
|
||||
if (!enumerable.Any())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
@ -291,7 +292,7 @@ namespace PlexRequests.Store.Repository
|
|||
var format = values.AddPrefix("@", ",");
|
||||
var processQuery = $"INSERT INTO {tableName} VALUES ({format})";
|
||||
var result = db.Execute(processQuery, entities);
|
||||
return result == values.Length;
|
||||
return result == enumerable.Length;
|
||||
}
|
||||
}
|
||||
catch (SqliteException e) when (e.ErrorCode == SQLiteErrorCode.Corrupt)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue