mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-18 06:53:07 +03:00
completely remove sqlitepcl
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user