aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/Data/SqliteDisplayPreferencesRepository.cs
diff options
context:
space:
mode:
authorAndrew Rabert <6550543+nvllsvm@users.noreply.github.com>2019-01-22 18:13:47 -0500
committerGitHub <noreply@github.com>2019-01-22 18:13:47 -0500
commit28483bdb54be96ae83e0fded097f534d7e26ba1e (patch)
treee7f4b92326417ebf55eecdf68a01d2c3b9e660d7 /Emby.Server.Implementations/Data/SqliteDisplayPreferencesRepository.cs
parent920c39454c05e979eabe81877269cd4517a03ccf (diff)
parent8106c8393b711a7e1d40487e3caf2b014decbe28 (diff)
Merge pull request #651 from jellyfin/release-10.1.0
Release 10.1.0
Diffstat (limited to 'Emby.Server.Implementations/Data/SqliteDisplayPreferencesRepository.cs')
-rw-r--r--Emby.Server.Implementations/Data/SqliteDisplayPreferencesRepository.cs32
1 files changed, 13 insertions, 19 deletions
diff --git a/Emby.Server.Implementations/Data/SqliteDisplayPreferencesRepository.cs b/Emby.Server.Implementations/Data/SqliteDisplayPreferencesRepository.cs
index 00e1956cf..3d60925da 100644
--- a/Emby.Server.Implementations/Data/SqliteDisplayPreferencesRepository.cs
+++ b/Emby.Server.Implementations/Data/SqliteDisplayPreferencesRepository.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using System.Collections.Generic;
using System.IO;
using System.Threading;
@@ -7,8 +7,8 @@ using MediaBrowser.Common.Extensions;
using MediaBrowser.Controller.Persistence;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.IO;
-using Microsoft.Extensions.Logging;
using MediaBrowser.Model.Serialization;
+using Microsoft.Extensions.Logging;
using SQLitePCL.pretty;
namespace Emby.Server.Implementations.Data
@@ -20,8 +20,8 @@ namespace Emby.Server.Implementations.Data
{
protected IFileSystem FileSystem { get; private set; }
- public SqliteDisplayPreferencesRepository(ILogger logger, IJsonSerializer jsonSerializer, IApplicationPaths appPaths, IFileSystem fileSystem)
- : base(logger)
+ public SqliteDisplayPreferencesRepository(ILoggerFactory loggerFactory, IJsonSerializer jsonSerializer, IApplicationPaths appPaths, IFileSystem fileSystem)
+ : base(loggerFactory.CreateLogger(nameof(SqliteDisplayPreferencesRepository)))
{
_jsonSerializer = jsonSerializer;
FileSystem = fileSystem;
@@ -32,13 +32,7 @@ namespace Emby.Server.Implementations.Data
/// Gets the name of the repository
/// </summary>
/// <value>The name.</value>
- public string Name
- {
- get
- {
- return "SQLite";
- }
- }
+ public string Name => "SQLite";
/// <summary>
/// The _json serializer
@@ -89,16 +83,16 @@ namespace Emby.Server.Implementations.Data
/// <param name="client">The client.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task.</returns>
- /// <exception cref="System.ArgumentNullException">item</exception>
+ /// <exception cref="ArgumentNullException">item</exception>
public void SaveDisplayPreferences(DisplayPreferences displayPreferences, Guid userId, string client, CancellationToken cancellationToken)
{
if (displayPreferences == null)
{
- throw new ArgumentNullException("displayPreferences");
+ throw new ArgumentNullException(nameof(displayPreferences));
}
if (string.IsNullOrEmpty(displayPreferences.Id))
{
- throw new ArgumentNullException("displayPreferences.Id");
+ throw new ArgumentNullException(nameof(displayPreferences.Id));
}
cancellationToken.ThrowIfCancellationRequested();
@@ -137,12 +131,12 @@ namespace Emby.Server.Implementations.Data
/// <param name="userId">The user id.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task.</returns>
- /// <exception cref="System.ArgumentNullException">item</exception>
+ /// <exception cref="ArgumentNullException">item</exception>
public void SaveAllDisplayPreferences(IEnumerable<DisplayPreferences> displayPreferences, Guid userId, CancellationToken cancellationToken)
{
if (displayPreferences == null)
{
- throw new ArgumentNullException("displayPreferences");
+ throw new ArgumentNullException(nameof(displayPreferences));
}
cancellationToken.ThrowIfCancellationRequested();
@@ -169,12 +163,12 @@ namespace Emby.Server.Implementations.Data
/// <param name="userId">The user id.</param>
/// <param name="client">The client.</param>
/// <returns>Task{DisplayPreferences}.</returns>
- /// <exception cref="System.ArgumentNullException">item</exception>
+ /// <exception cref="ArgumentNullException">item</exception>
public DisplayPreferences GetDisplayPreferences(string displayPreferencesId, Guid userId, string client)
{
if (string.IsNullOrEmpty(displayPreferencesId))
{
- throw new ArgumentNullException("displayPreferencesId");
+ throw new ArgumentNullException(nameof(displayPreferencesId));
}
var guidId = displayPreferencesId.GetMD5();
@@ -208,7 +202,7 @@ namespace Emby.Server.Implementations.Data
/// </summary>
/// <param name="userId">The user id.</param>
/// <returns>Task{DisplayPreferences}.</returns>
- /// <exception cref="System.ArgumentNullException">item</exception>
+ /// <exception cref="ArgumentNullException">item</exception>
public IEnumerable<DisplayPreferences> GetAllDisplayPreferences(Guid userId)
{
var list = new List<DisplayPreferences>();