Skip to content

Commit

Permalink
Add support for Jellyfin 10.8 (#19113)
Browse files Browse the repository at this point in the history
  • Loading branch information
firecore committed Apr 12, 2022
1 parent 445fcde commit 6f6f75c
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 23 deletions.
4 changes: 2 additions & 2 deletions InfuseSync/InfuseSync.Emby.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<AssemblyVersion>1.4.1</AssemblyVersion>
<FileVersion>1.4.1</FileVersion>
<AssemblyVersion>1.4.2</AssemblyVersion>
<FileVersion>1.4.2</FileVersion>
<RootNamespace>InfuseSync</RootNamespace>
<AssemblyName>InfuseSync</AssemblyName>
<DefineConstants>EMBY</DefineConstants>
Expand Down
9 changes: 4 additions & 5 deletions InfuseSync/InfuseSync.Jellyfin.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
<Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" />

<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<AssemblyVersion>1.4.1</AssemblyVersion>
<FileVersion>1.4.1</FileVersion>
<TargetFramework>net6.0</TargetFramework>
<AssemblyVersion>1.4.2</AssemblyVersion>
<FileVersion>1.4.2</FileVersion>
<RootNamespace>InfuseSync</RootNamespace>
<AssemblyName>InfuseSync</AssemblyName>
<DefineConstants>JELLYFIN</DefineConstants>
Expand All @@ -18,8 +18,7 @@
<ItemGroup>
<PackageReference Include="Jellyfin.Controller" Version="10.*-*" />
<PackageReference Include="Jellyfin.Model" Version="10.*-*" />
<PackageReference Include="SQLitePCL.pretty.netstandard" Version="2.1.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.2.0" />
<PackageReference Include="SQLitePCL.pretty.netstandard" Version="3.1.0" />
</ItemGroup>

<ItemGroup>
Expand Down
5 changes: 2 additions & 3 deletions InfuseSync/Plugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,13 @@ public class Plugin: BasePlugin<PluginConfiguration>, IHasWebPages
public Plugin(
IApplicationPaths applicationPaths,
IXmlSerializer xmlSerializer,
ILogger logger,
IJsonSerializer serializer) : base(applicationPaths, xmlSerializer)
ILogger logger) : base(applicationPaths, xmlSerializer)
{
Instance = this;

logger.LogInformation("InfuseSync is starting.");

Db = new Db(applicationPaths.DataPath, logger, serializer);
Db = new Db(applicationPaths.DataPath, logger);
}

public Db Db { get; }
Expand Down
5 changes: 5 additions & 0 deletions InfuseSync/ScheduledTasks/HousekeepingTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ public Task Execute(CancellationToken cancellationToken, IProgress<double> progr
return Task.CompletedTask;
}

public Task ExecuteAsync(IProgress<double> progress, CancellationToken cancellationToken)
{
return Execute(cancellationToken, progress);
}

public string Name => "Remove Old Cached Data";
public string Category => "Infuse Sync";
public string Description => "Removes old sync records based on 'Delete unused cache data' setting.";
Expand Down
5 changes: 1 addition & 4 deletions InfuseSync/Storage/Db.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,8 @@ public class Db: BaseSqliteRepository, IDisposable
private const string ItemsTable = "items";
private const string UserInfoTable = "user_info";

private readonly IJsonSerializer _serializer;

public Db(string path, ILogger logger, IJsonSerializer jsonSerializer) : base(logger)
public Db(string path, ILogger logger) : base(logger)
{
_serializer = jsonSerializer;
Directory.CreateDirectory(path);
DbFilePath = Path.Combine(path, $"infuse_sync.db");
Initialize(File.Exists(DbFilePath));
Expand Down
4 changes: 2 additions & 2 deletions InfuseSync/Storage/ManagedConnection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ public T RunInTransaction<T>(Func<IDatabaseConnection, T> action, TransactionMod
return db.RunInTransaction(action, mode);
}

public IEnumerable<IReadOnlyList<IResultSetValue>> Query(string sql)
public IEnumerable<IReadOnlyList<ResultSetValue>> Query(string sql)
{
return db.Query(sql);
}

public IEnumerable<IReadOnlyList<IResultSetValue>> Query(string sql, params object[] values)
public IEnumerable<IReadOnlyList<ResultSetValue>> Query(string sql, params object[] values)
{
return db.Query(sql, values);
}
Expand Down
14 changes: 7 additions & 7 deletions InfuseSync/Storage/SqliteExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#if EMBY
using ResultSet = SQLitePCL.pretty.IResultSet;
#else
using ResultSet = System.Collections.Generic.IReadOnlyList<SQLitePCL.pretty.IResultSetValue>;
using ResultSet = System.Collections.Generic.IReadOnlyList<SQLitePCL.pretty.ResultSetValue>;
#endif

namespace InfuseSync.Storage
Expand Down Expand Up @@ -84,32 +84,32 @@ public static Guid GetGuid(this ResultSet result, int index)
}

#if JELLYFIN
public static bool IsDBNull(this IReadOnlyList<IResultSetValue> result, int index)
public static bool IsDBNull(this ResultSet result, int index)
{
return result[index].SQLiteType == SQLiteType.Null;
}

public static string GetString(this IReadOnlyList<IResultSetValue> result, int index)
public static string GetString(this ResultSet result, int index)
{
return result[index].ToString();
}

public static bool GetBoolean(this IReadOnlyList<IResultSetValue> result, int index)
public static bool GetBoolean(this ResultSet result, int index)
{
return result[index].ToBool();
}

public static int GetInt(this IReadOnlyList<IResultSetValue> result, int index)
public static int GetInt(this ResultSet result, int index)
{
return result[index].ToInt();
}

public static long GetInt64(this IReadOnlyList<IResultSetValue> result, int index)
public static long GetInt64(this ResultSet result, int index)
{
return result[index].ToInt64();
}

public static float GetFloat(this IReadOnlyList<IResultSetValue> result, int index)
public static float GetFloat(this ResultSet result, int index)
{
return result[index].ToFloat();
}
Expand Down

0 comments on commit 6f6f75c

Please sign in to comment.