< Summary - Jellyfin

Information
Class: MediaBrowser.Providers.Movies.ImdbExternalUrlProvider
Assembly: MediaBrowser.Providers
File(s): /srv/git/jellyfin/MediaBrowser.Providers/Movies/ImdbExternalUrlProvider.cs
Line coverage
100%
Covered lines: 1
Uncovered lines: 0
Coverable lines: 1
Total lines: 32
Line coverage: 100%
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
get_Name()100%11100%

File(s)

/srv/git/jellyfin/MediaBrowser.Providers/Movies/ImdbExternalUrlProvider.cs

#LineLine coverage
 1using System.Collections.Generic;
 2using MediaBrowser.Controller.Entities;
 3using MediaBrowser.Controller.Providers;
 4using MediaBrowser.Model.Entities;
 5
 6namespace MediaBrowser.Providers.Movies;
 7
 8/// <summary>
 9/// External URLs for IMDb.
 10/// </summary>
 11public class ImdbExternalUrlProvider : IExternalUrlProvider
 12{
 13    /// <inheritdoc/>
 2114    public string Name => "IMDb";
 15
 16    /// <inheritdoc/>
 17    public IEnumerable<string> GetExternalUrls(BaseItem item)
 18    {
 19        var baseUrl = "https://www.imdb.com/";
 20        if (item.TryGetProviderId(MetadataProvider.Imdb, out var externalId))
 21        {
 22            if (item is Person)
 23            {
 24                yield return baseUrl + $"name/{externalId}";
 25            }
 26            else
 27            {
 28                yield return baseUrl + $"title/{externalId}";
 29            }
 30        }
 31    }
 32}

Methods/Properties

get_Name()