< 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
36%
Covered lines: 4
Uncovered lines: 7
Coverable lines: 11
Total lines: 69
Line coverage: 36.3%
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%
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>
 14public 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    {
 2126        _libraryManager = libraryManager;
 2127        _localization = localization;
 2128    }
 29
 30    /// <inheritdoc />
 2131    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.</retu
 55    public IEnumerable<TaskTriggerInfo> GetDefaultTriggers()
 56    {
 57        yield return new TaskTriggerInfo
 58        {
 59            Type = TaskTriggerInfoType.IntervalTrigger,
 60            IntervalTicks = TimeSpan.FromDays(7).Ticks
 61        };
 62    }
 63
 64    /// <inheritdoc />
 65    public Task ExecuteAsync(IProgress<double> progress, CancellationToken cancellationToken)
 66    {
 067        return _libraryManager.ValidatePeopleAsync(progress, cancellationToken);
 68    }
 69}