mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-22 08:45:23 +03:00
34 lines
965 B
C#
34 lines
965 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)
|
||
|
|
{
|
||
|
|
var externalId = item.GetProviderId(MetadataProvider.AudioDbArtist);
|
||
|
|
if (!string.IsNullOrEmpty(externalId))
|
||
|
|
{
|
||
|
|
var baseUrl = "https://www.theaudiodb.com/";
|
||
|
|
switch (item)
|
||
|
|
{
|
||
|
|
case MusicAlbum:
|
||
|
|
case Person:
|
||
|
|
yield return baseUrl + $"artist/{externalId}";
|
||
|
|
break;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|