aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Providers/Plugins/ComicVine/ComicVineExternalUrlProvider.cs
blob: 9122399179a1fc63458f23b3fbbe3eaabc9a6380 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
using System.Collections.Generic;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Providers;
using MediaBrowser.Model.Entities;

namespace MediaBrowser.Providers.Plugins.ComicVine;

/// <inheritdoc/>
public class ComicVineExternalUrlProvider : IExternalUrlProvider
{
    /// <inheritdoc/>
    public string Name => "Comic Vine";

    /// <inheritdoc />
    public IEnumerable<string> GetExternalUrls(BaseItem item)
    {
        if (item.TryGetProviderId("ComicVine", out var externalId))
        {
            switch (item)
            {
                case Person:
                case Book:
                    yield return $"https://comicvine.gamespot.com/{externalId}";
                    break;
            }
        }
    }
}