diff options
| author | Patrick Barron <18354464+barronpm@users.noreply.github.com> | 2020-04-22 13:44:20 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-04-22 13:44:20 +0000 |
| commit | 7586c6022428fd4e1296653a5c281d83b64c7f8e (patch) | |
| tree | 539c9ca4b74a8027d0e636f7a86c587bd74b05a3 /Emby.Server.Implementations/Activity/ActivityRepository.cs | |
| parent | f26f44acaf86bb35ff1d2be7cb37a57dee7a47cf (diff) | |
| parent | a85b1dcba663fe3bbb2441380cd8da382c92f2bd (diff) | |
Merge branch 'master' into warnings-cleanup1
Diffstat (limited to 'Emby.Server.Implementations/Activity/ActivityRepository.cs')
| -rw-r--r-- | Emby.Server.Implementations/Activity/ActivityRepository.cs | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/Emby.Server.Implementations/Activity/ActivityRepository.cs b/Emby.Server.Implementations/Activity/ActivityRepository.cs index 3aa1f0397..83471935d 100644 --- a/Emby.Server.Implementations/Activity/ActivityRepository.cs +++ b/Emby.Server.Implementations/Activity/ActivityRepository.cs @@ -18,17 +18,18 @@ namespace Emby.Server.Implementations.Activity /// </summary> public class ActivityRepository : BaseSqliteRepository, IActivityRepository { - private static readonly CultureInfo _usCulture = CultureInfo.ReadOnly(new CultureInfo("en-US")); + private const string BaseActivitySelectText = "select Id, Name, Overview, ShortOverview, Type, ItemId, UserId, DateCreated, LogSeverity from ActivityLog"; + private readonly IFileSystem _fileSystem; /// <summary> /// Initializes a new instance of the <see cref="ActivityRepository"/> class. /// </summary> - /// <param name="loggerFactory">The logger factory.</param> + /// <param name="logger">The logger.</param> /// <param name="appPaths">The server application paths.</param> /// <param name="fileSystem">The filesystem.</param> - public ActivityRepository(ILoggerFactory loggerFactory, IServerApplicationPaths appPaths, IFileSystem fileSystem) - : base(loggerFactory.CreateLogger(nameof(ActivityRepository))) + public ActivityRepository(ILogger<ActivityRepository> logger, IServerApplicationPaths appPaths, IFileSystem fileSystem) + : base(logger) { DbFilePath = Path.Combine(appPaths.DataPath, "activitylog.db"); _fileSystem = fileSystem; @@ -205,7 +206,7 @@ namespace Emby.Server.Implementations.Activity if (limit.HasValue) { - commandText += " LIMIT " + limit.Value.ToString(_usCulture); + commandText += " LIMIT " + limit.Value.ToString(CultureInfo.InvariantCulture); } var statementTexts = new[] @@ -300,7 +301,7 @@ namespace Emby.Server.Implementations.Activity index++; if (reader[index].SQLiteType != SQLiteType.Null) { - info.Severity = (LogLevel)Enum.Parse(typeof(LogLevel), reader[index].ToString(), true); + info.Severity = Enum.Parse<LogLevel>(reader[index].ToString(), true); } return info; |
