completely remove sqlitepcl

This commit is contained in:
cvium
2023-08-21 15:31:02 +02:00
parent 061d79c113
commit d223f5b518
9 changed files with 66 additions and 534 deletions

View File

@@ -1,10 +1,11 @@
using System;
using System.Globalization;
using System.IO;
using System.Linq;
using Emby.Server.Implementations.Data;
using MediaBrowser.Controller;
using Microsoft.Data.Sqlite;
using Microsoft.Extensions.Logging;
using SQLitePCL.pretty;
namespace Jellyfin.Server.Migrations.Routines
{
@@ -37,14 +38,12 @@ namespace Jellyfin.Server.Migrations.Routines
{
var dataPath = _paths.DataPath;
var dbPath = Path.Combine(dataPath, DbFilename);
using (var connection = SQLite3.Open(
dbPath,
ConnectionFlags.ReadWrite,
null))
using (var connection = new SqliteConnection($"Filename={dbPath}"))
{
// Query the database for the ids of duplicate extras
var queryResult = connection.Query("SELECT t1.Path FROM TypedBaseItems AS t1, TypedBaseItems AS t2 WHERE t1.Path=t2.Path AND t1.Type!=t2.Type AND t1.Type='MediaBrowser.Controller.Entities.Video'");
var bads = string.Join(", ", queryResult.SelectScalarString());
// TODO does this LINQ execute before the reader is disposed?
var bads = string.Join(", ", queryResult.Select(x => x.GetString(0)).ToList());
// Do nothing if no duplicate extras were detected
if (bads.Length == 0)