mirror of
https://github.com/PredatH0r/ChanSort.git
synced 2026-05-07 00:36:53 +02:00
- fixed Nuget hell: (auto) binding redirects to prevent compiler warning flood and ensure unit tests to be runnable
- put file name in Sqlite connect string in quotes - improvements to Mediatek Philips 120+125/Sony serializer (physically reorder XML nodes, use flags stored in Java serialized blob) - selecting a RefList changed the current working directory, which prevented .ini files to be found by loaders
This commit is contained in:
@@ -1,25 +1,13 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Import Project="..\Solution.props" />
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net48</TargetFramework>
|
||||
<OutputType>Library</OutputType>
|
||||
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<OutputPath>..\Debug\</OutputPath>
|
||||
<LangVersion>latest</LangVersion>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<LangVersion>latest</LangVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
|
||||
<OutputPath>..\Debug\</OutputPath>
|
||||
<LangVersion>latest</LangVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
|
||||
<OutputPath>..\Release\</OutputPath>
|
||||
<LangVersion>latest</LangVersion>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Service Include="{94E38DFF-614B-4cbd-B67C-F211BB35CE8B}" />
|
||||
</ItemGroup>
|
||||
@@ -32,11 +20,7 @@
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.Data.Sqlite" Version="8.0.13" />
|
||||
<PackageReference Include="Microsoft.Data.Sqlite.Core" Version="8.0.13" />
|
||||
<PackageReference Include="System.Buffers" Version="4.6.0" />
|
||||
<PackageReference Include="System.Memory" Version="4.6.0" />
|
||||
<PackageReference Include="System.Numerics.Vectors" Version="4.6.0" />
|
||||
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="6.1.0" />
|
||||
<PackageReference Include="Microsoft.Data.Sqlite" Version="9.0.5" />
|
||||
<PackageReference Include="Microsoft.Data.Sqlite.Core" Version="9.0.5" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -1,4 +1,8 @@
|
||||
using System;
|
||||
// The NuGet packages Microsoft.Data.Sqlite 9.0.0-9.0.5 throw an AccessViolationException and terminate the program when reading a "string" column with GetBytes()
|
||||
// uncomment this #define when using Sqlite < 9.x or when MS fixed the error
|
||||
//#define NoAccessViolationInSQLitePCLRaw
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Data;
|
||||
@@ -200,8 +204,8 @@ namespace ChanSort.Loader.Panasonic
|
||||
/// </summary>
|
||||
private void ReadNamesWithEncodingDetection(IDataReader r, IDictionary<string, int> field, Encoding encoding)
|
||||
{
|
||||
#if true || NoAccessViolationInSQLitePCLRaw
|
||||
// The NuGet packages Microsoft.Data.Sqlite 9.0.0-9.0.2 throw an AccessViolationException and terminate the program when reading a "string" column with GetBytes()
|
||||
#if NoAccessViolationInSQLitePCLRaw
|
||||
// The NuGet packages Microsoft.Data.Sqlite 9.0.0-9.0.5 throw an AccessViolationException and terminate the program when reading a "string" column with GetBytes()
|
||||
byte[] buffer = new byte[300];
|
||||
int len = (int)r.GetBytes(field["sname"], 0, buffer, 0, buffer.Length/3);
|
||||
#else
|
||||
|
||||
@@ -167,7 +167,7 @@ internal class IdtvChannelSerializer : SerializerBase
|
||||
if (!File.Exists(binFile))
|
||||
throw LoaderException.Fail("expected file not found: " + binFile);
|
||||
|
||||
string connString = $"Data Source={this.dbFile};Pooling=False";
|
||||
string connString = $"Data Source=\"{this.dbFile}\";Pooling=False";
|
||||
using var db = new SqliteConnection(connString);
|
||||
db.Open();
|
||||
using var cmd = db.CreateCommand();
|
||||
@@ -590,7 +590,7 @@ internal class IdtvChannelSerializer : SerializerBase
|
||||
#region SaveTvDb()
|
||||
private void SaveTvDb(IDictionary<ushort, int> newChannelIndexMap)
|
||||
{
|
||||
string connString = $"Data Source={this.dbFile};Pooling=False";
|
||||
string connString = $"Data Source=\"{this.dbFile}\";Pooling=False";
|
||||
using var db = new SqliteConnection(connString);
|
||||
db.Open();
|
||||
|
||||
|
||||
@@ -78,7 +78,7 @@ namespace ChanSort.Loader.Panasonic
|
||||
|
||||
this.CreateDummySatellites();
|
||||
|
||||
string channelConnString = $"Data Source={this.workFile};Pooling=False";
|
||||
string channelConnString = $"Data Source=\"{this.workFile}\";Pooling=False";
|
||||
using var conn = new SqliteConnection(channelConnString);
|
||||
conn.Open();
|
||||
using var cmd = conn.CreateCommand();
|
||||
@@ -301,7 +301,7 @@ order by s.ntype,major_channel
|
||||
#region Save()
|
||||
public override void Save()
|
||||
{
|
||||
string channelConnString = $"Data Source={this.workFile};Pooling=False";
|
||||
string channelConnString = $"Data Source=\"{this.workFile}\";Pooling=False";
|
||||
using (var conn = new SqliteConnection(channelConnString))
|
||||
{
|
||||
conn.Open();
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
</configuration>
|
||||
Reference in New Issue
Block a user