< Summary - Jellyfin

Information
Class: MediaBrowser.Providers.Books.BookMetadataService
Assembly: MediaBrowser.Providers
File(s): /srv/git/jellyfin/MediaBrowser.Providers/Books/BookMetadataService.cs
Line coverage
33%
Covered lines: 2
Uncovered lines: 4
Coverable lines: 6
Total lines: 48
Line coverage: 33.3%
Branch coverage
0%
Covered branches: 0
Total branches: 4
Branch coverage: 0%
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%
MergeData(...)0%2040%

File(s)

/srv/git/jellyfin/MediaBrowser.Providers/Books/BookMetadataService.cs

#LineLine coverage
 1using MediaBrowser.Controller.Configuration;
 2using MediaBrowser.Controller.Entities;
 3using MediaBrowser.Controller.IO;
 4using MediaBrowser.Controller.Library;
 5using MediaBrowser.Controller.Providers;
 6using MediaBrowser.Model.Entities;
 7using MediaBrowser.Model.IO;
 8using MediaBrowser.Providers.Manager;
 9using Microsoft.Extensions.Logging;
 10
 11namespace MediaBrowser.Providers.Books;
 12
 13/// <summary>
 14/// Service to manage book metadata.
 15/// </summary>
 16public class BookMetadataService : MetadataService<Book, BookInfo>
 17{
 18    /// <summary>
 19    /// Initializes a new instance of the <see cref="BookMetadataService"/> class.
 20    /// </summary>
 21    /// <param name="serverConfigurationManager">Instance of the <see cref="IServerConfigurationManager"/>.</param>
 22    /// <param name="logger">Instance of the <see cref="ILogger"/> interface.</param>
 23    /// <param name="providerManager">Instance of the <see cref="IProviderManager"/> interface.</param>
 24    /// <param name="fileSystem">Instance of the <see cref="IFileSystem"/> interface.</param>
 25    /// <param name="libraryManager">Instance of the <see cref="ILibraryManager"/> interface.</param>
 26    /// <param name="externalDataManager">Instance of the <see cref="IExternalDataManager"/> interface.</param>
 27    public BookMetadataService(
 28        IServerConfigurationManager serverConfigurationManager,
 29        ILogger<BookMetadataService> logger,
 30        IProviderManager providerManager,
 31        IFileSystem fileSystem,
 32        ILibraryManager libraryManager,
 33        IExternalDataManager externalDataManager)
 2134        : base(serverConfigurationManager, logger, providerManager, fileSystem, libraryManager, externalDataManager)
 35    {
 2136    }
 37
 38    /// <inheritdoc />
 39    protected override void MergeData(MetadataResult<Book> source, MetadataResult<Book> target, MetadataField[] lockedFi
 40    {
 041        base.MergeData(source, target, lockedFields, replaceData, mergeMetadataSettings);
 42
 043        if (replaceData || string.IsNullOrEmpty(target.Item.SeriesName))
 44        {
 045            target.Item.SeriesName = source.Item.SeriesName;
 46        }
 047    }
 48}