< Summary - Jellyfin

Information
Class: Emby.Server.Implementations.ScheduledTasks.Tasks.PeopleValidationTask
Assembly: Emby.Server.Implementations
File(s): /srv/git/jellyfin/Emby.Server.Implementations/ScheduledTasks/Tasks/PeopleValidationTask.cs
Line coverage
63%
Covered lines: 12
Uncovered lines: 7
Coverable lines: 19
Total lines: 73
Line coverage: 63.1%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Coverage history

Coverage history 0 25 50 75 100

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor(...)100%11100%
get_Name()100%11100%
get_Description()100%210%
get_Category()100%210%
get_Key()100%210%
get_IsHidden()100%210%
get_IsEnabled()100%210%
get_IsLogged()100%210%
GetDefaultTriggers()100%11100%
ExecuteAsync(...)100%210%

File(s)

/srv/git/jellyfin/Emby.Server.Implementations/ScheduledTasks/Tasks/PeopleValidationTask.cs

#LineLine coverage
 1using System;
 2using System.Collections.Generic;
 3using System.Threading;
 4using System.Threading.Tasks;
 5using MediaBrowser.Controller.Library;
 6using MediaBrowser.Model.Globalization;
 7using MediaBrowser.Model.Tasks;
 8
 9namespace Emby.Server.Implementations.ScheduledTasks.Tasks
 10{
 11    /// <summary>
 12    /// Class PeopleValidationTask.
 13    /// </summary>
 14    public class PeopleValidationTask : IScheduledTask, IConfigurableScheduledTask
 15    {
 16        private readonly ILibraryManager _libraryManager;
 17        private readonly ILocalizationManager _localization;
 18
 19        /// <summary>
 20        /// Initializes a new instance of the <see cref="PeopleValidationTask" /> class.
 21        /// </summary>
 22        /// <param name="libraryManager">Instance of the <see cref="ILibraryManager"/> interface.</param>
 23        /// <param name="localization">Instance of the <see cref="ILocalizationManager"/> interface.</param>
 24        public PeopleValidationTask(ILibraryManager libraryManager, ILocalizationManager localization)
 25        {
 2226            _libraryManager = libraryManager;
 2227            _localization = localization;
 2228        }
 29
 30        /// <inheritdoc />
 2231        public string Name => _localization.GetLocalizedString("TaskRefreshPeople");
 32
 33        /// <inheritdoc />
 034        public string Description => _localization.GetLocalizedString("TaskRefreshPeopleDescription");
 35
 36        /// <inheritdoc />
 037        public string Category => _localization.GetLocalizedString("TasksLibraryCategory");
 38
 39        /// <inheritdoc />
 040        public string Key => "RefreshPeople";
 41
 42        /// <inheritdoc />
 043        public bool IsHidden => false;
 44
 45        /// <inheritdoc />
 046        public bool IsEnabled => true;
 47
 48        /// <inheritdoc />
 049        public bool IsLogged => true;
 50
 51        /// <summary>
 52        /// Creates the triggers that define when the task will run.
 53        /// </summary>
 54        /// <returns>An <see cref="IEnumerable{TaskTriggerInfo}"/> containing the default trigger infos for this task.</
 55        public IEnumerable<TaskTriggerInfo> GetDefaultTriggers()
 56        {
 2257            return new[]
 2258            {
 2259                new TaskTriggerInfo
 2260                {
 2261                    Type = TaskTriggerInfo.TriggerInterval,
 2262                    IntervalTicks = TimeSpan.FromDays(7).Ticks
 2263                }
 2264            };
 65        }
 66
 67        /// <inheritdoc />
 68        public Task ExecuteAsync(IProgress<double> progress, CancellationToken cancellationToken)
 69        {
 070            return _libraryManager.ValidatePeopleAsync(progress, cancellationToken);
 71        }
 72    }
 73}