mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-05-04 07:46:32 +01:00
fixes #2904 - disabling transcoding for a user is not working
This commit is contained in:
@@ -7,22 +7,42 @@ using MediaBrowser.Model.Logging;
|
||||
using MediaBrowser.Model.Social;
|
||||
using SQLitePCL.pretty;
|
||||
using MediaBrowser.Model.Extensions;
|
||||
using MediaBrowser.Model.IO;
|
||||
|
||||
namespace Emby.Server.Implementations.Social
|
||||
{
|
||||
public class SharingRepository : BaseSqliteRepository, ISharingRepository
|
||||
{
|
||||
public SharingRepository(ILogger logger, IApplicationPaths appPaths)
|
||||
protected IFileSystem FileSystem { get; private set; }
|
||||
|
||||
public SharingRepository(ILogger logger, IApplicationPaths appPaths, IFileSystem fileSystem)
|
||||
: base(logger)
|
||||
{
|
||||
FileSystem = fileSystem;
|
||||
DbFilePath = Path.Combine(appPaths.DataPath, "shares.db");
|
||||
}
|
||||
|
||||
public void Initialize()
|
||||
{
|
||||
try
|
||||
{
|
||||
InitializeInternal();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.ErrorException("Error loading database file. Will reset and retry.", ex);
|
||||
|
||||
FileSystem.DeleteFile(DbFilePath);
|
||||
|
||||
InitializeInternal();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Opens the connection to the database
|
||||
/// </summary>
|
||||
/// <returns>Task.</returns>
|
||||
public void Initialize()
|
||||
private void InitializeInternal()
|
||||
{
|
||||
using (var connection = CreateConnection())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user