mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-05-24 02:02:29 -04:00
33 lines
928 B
C#
33 lines
928 B
C#
using System.Collections.Generic;
|
|
using MediaBrowser.Controller.Entities;
|
|
using MediaBrowser.Controller.Entities.Audio;
|
|
using MediaBrowser.Controller.Providers;
|
|
using MediaBrowser.Model.Entities;
|
|
|
|
namespace MediaBrowser.Providers.Plugins.AudioDb;
|
|
|
|
/// <summary>
|
|
/// External artist URLs for AudioDb.
|
|
/// </summary>
|
|
public class AudioDbArtistExternalUrlProvider : IExternalUrlProvider
|
|
{
|
|
/// <inheritdoc/>
|
|
public string Name => "TheAudioDb Artist";
|
|
|
|
/// <inheritdoc/>
|
|
public IEnumerable<string> GetExternalUrls(BaseItem item)
|
|
{
|
|
if (item.TryGetProviderId(MetadataProvider.AudioDbArtist, out var externalId))
|
|
{
|
|
var baseUrl = "https://www.theaudiodb.com/";
|
|
switch (item)
|
|
{
|
|
case MusicAlbum:
|
|
case Person:
|
|
yield return baseUrl + $"artist/{externalId}";
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|