parent
712908d53c
commit
5303445c9b
@ -0,0 +1,27 @@
|
||||
using System.Collections.Generic;
|
||||
using MediaBrowser.Controller.Entities;
|
||||
using MediaBrowser.Controller.Providers;
|
||||
using MediaBrowser.Model.Entities;
|
||||
|
||||
namespace MediaBrowser.Providers.Movies;
|
||||
|
||||
/// <summary>
|
||||
/// External URLs for IMDb.
|
||||
/// </summary>
|
||||
public class ImdbExternalUrlProvider : IExternalUrlProvider
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public string Name => "IMDb";
|
||||
|
||||
/// <inheritdoc/>
|
||||
public IEnumerable<string> GetExternalUrls(BaseItem item)
|
||||
{
|
||||
var baseUrl = "https://www.imdb.com/";
|
||||
var externalId = item.GetProviderId(MetadataProvider.Imdb);
|
||||
|
||||
if (!string.IsNullOrEmpty(externalId))
|
||||
{
|
||||
yield return baseUrl + $"title/{externalId}";
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,32 @@
|
||||
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 AudioDbAlbumExternalUrlProvider : IExternalUrlProvider
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public string Name => "TheAudioDb Album";
|
||||
|
||||
/// <inheritdoc/>
|
||||
public IEnumerable<string> GetExternalUrls(BaseItem item)
|
||||
{
|
||||
var externalId = item.GetProviderId(MetadataProvider.AudioDbAlbum);
|
||||
if (!string.IsNullOrEmpty(externalId))
|
||||
{
|
||||
var baseUrl = "https://www.theaudiodb.com/";
|
||||
switch (item)
|
||||
{
|
||||
case MusicAlbum:
|
||||
yield return baseUrl + $"album/{externalId}";
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
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.MusicBrainz;
|
||||
|
||||
/// <summary>
|
||||
/// External album artist URLs for MusicBrainz.
|
||||
/// </summary>
|
||||
public class MusicBrainzAlbumArtistExternalUrlProvider : IExternalUrlProvider
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public string Name => "MusicBrainz Album Artist";
|
||||
|
||||
/// <inheritdoc/>
|
||||
public IEnumerable<string> GetExternalUrls(BaseItem item)
|
||||
{
|
||||
if (item is MusicAlbum)
|
||||
{
|
||||
var externalId = item.GetProviderId(MetadataProvider.MusicBrainzAlbumArtist);
|
||||
if (!string.IsNullOrEmpty(externalId))
|
||||
{
|
||||
yield return Plugin.Instance!.Configuration.Server + $"/artist/{externalId}";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
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.MusicBrainz;
|
||||
|
||||
/// <summary>
|
||||
/// External album URLs for MusicBrainz.
|
||||
/// </summary>
|
||||
public class MusicBrainzAlbumExternalUrlProvider : IExternalUrlProvider
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public string Name => "MusicBrainz Album";
|
||||
|
||||
/// <inheritdoc/>
|
||||
public IEnumerable<string> GetExternalUrls(BaseItem item)
|
||||
{
|
||||
if (item is MusicAlbum)
|
||||
{
|
||||
var externalId = item.GetProviderId(MetadataProvider.MusicBrainzArtist);
|
||||
if (!string.IsNullOrEmpty(externalId))
|
||||
{
|
||||
yield return Plugin.Instance!.Configuration.Server + $"/release/{externalId}";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
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.MusicBrainz;
|
||||
|
||||
/// <summary>
|
||||
/// External artist URLs for MusicBrainz.
|
||||
/// </summary>
|
||||
public class MusicBrainzArtistExternalUrlProvider : IExternalUrlProvider
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public string Name => "MusicBrainz Artist";
|
||||
|
||||
/// <inheritdoc/>
|
||||
public IEnumerable<string> GetExternalUrls(BaseItem item)
|
||||
{
|
||||
var externalId = item.GetProviderId(MetadataProvider.MusicBrainzArtist);
|
||||
if (!string.IsNullOrEmpty(externalId))
|
||||
{
|
||||
switch (item)
|
||||
{
|
||||
case MusicAlbum:
|
||||
case Person:
|
||||
yield return Plugin.Instance!.Configuration.Server + $"/artist/{externalId}";
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
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.MusicBrainz;
|
||||
|
||||
/// <summary>
|
||||
/// External release group URLs for MusicBrainz.
|
||||
/// </summary>
|
||||
public class MusicBrainzReleaseGroupExternalUrlProvider : IExternalUrlProvider
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public string Name => "MusicBrainz Release Group";
|
||||
|
||||
/// <inheritdoc/>
|
||||
public IEnumerable<string> GetExternalUrls(BaseItem item)
|
||||
{
|
||||
if (item is MusicAlbum)
|
||||
{
|
||||
var externalId = item.GetProviderId(MetadataProvider.MusicBrainzReleaseGroup);
|
||||
if (!string.IsNullOrEmpty(externalId))
|
||||
{
|
||||
yield return Plugin.Instance!.Configuration.Server + $"/release-group/{externalId}";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
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.MusicBrainz;
|
||||
|
||||
/// <summary>
|
||||
/// External track URLs for MusicBrainz.
|
||||
/// </summary>
|
||||
public class MusicBrainzTrackExternalUrlProvider : IExternalUrlProvider
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public string Name => "MusicBrainz Track";
|
||||
|
||||
/// <inheritdoc/>
|
||||
public IEnumerable<string> GetExternalUrls(BaseItem item)
|
||||
{
|
||||
if (item is Audio)
|
||||
{
|
||||
var externalId = item.GetProviderId(MetadataProvider.MusicBrainzArtist);
|
||||
if (!string.IsNullOrEmpty(externalId))
|
||||
{
|
||||
yield return Plugin.Instance!.Configuration.Server + $"/track/{externalId}";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,101 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using MediaBrowser.Controller.Entities;
|
||||
using MediaBrowser.Controller.Entities.Movies;
|
||||
using MediaBrowser.Controller.Entities.TV;
|
||||
using MediaBrowser.Controller.Providers;
|
||||
using MediaBrowser.Model.Entities;
|
||||
using TMDbLib.Objects.TvShows;
|
||||
|
||||
namespace MediaBrowser.Providers.Plugins.Tmdb;
|
||||
|
||||
/// <summary>
|
||||
/// External URLs for TMDb.
|
||||
/// </summary>
|
||||
public class TmdbExternalUrlProvider : IExternalUrlProvider
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public string Name => "TMDB";
|
||||
|
||||
/// <inheritdoc/>
|
||||
public IEnumerable<string> GetExternalUrls(BaseItem item)
|
||||
{
|
||||
switch (item)
|
||||
{
|
||||
case Series:
|
||||
var externalId = item.GetProviderId(MetadataProvider.Tmdb);
|
||||
if (!string.IsNullOrEmpty(externalId))
|
||||
{
|
||||
yield return TmdbUtils.BaseTmdbUrl + $"tv/{externalId}";
|
||||
}
|
||||
|
||||
break;
|
||||
case Season season:
|
||||
var seriesExternalId = season.Series.GetProviderId(MetadataProvider.Tmdb);
|
||||
if (!string.IsNullOrEmpty(seriesExternalId))
|
||||
{
|
||||
var orderString = season.Series.DisplayOrder;
|
||||
if (string.IsNullOrEmpty(orderString))
|
||||
{
|
||||
// Default order is airdate
|
||||
yield return TmdbUtils.BaseTmdbUrl + $"tv/{seriesExternalId}/season/{season.IndexNumber}";
|
||||
}
|
||||
|
||||
if (Enum.TryParse<TvGroupType>(season.Series.DisplayOrder, out var order))
|
||||
{
|
||||
if (order.Equals(TvGroupType.OriginalAirDate))
|
||||
{
|
||||
yield return TmdbUtils.BaseTmdbUrl + $"tv/{seriesExternalId}/season/{season.IndexNumber}";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
case Episode episode:
|
||||
seriesExternalId = episode.Series.GetProviderId(MetadataProvider.Tmdb);
|
||||
if (!string.IsNullOrEmpty(seriesExternalId))
|
||||
{
|
||||
var orderString = episode.Series.DisplayOrder;
|
||||
if (string.IsNullOrEmpty(orderString))
|
||||
{
|
||||
// Default order is airdate
|
||||
yield return TmdbUtils.BaseTmdbUrl + $"tv/{seriesExternalId}/season/{episode.Season.IndexNumber}/episode/{episode.IndexNumber}";
|
||||
}
|
||||
|
||||
if (Enum.TryParse<TvGroupType>(orderString, out var order))
|
||||
{
|
||||
if (order.Equals(TvGroupType.OriginalAirDate))
|
||||
{
|
||||
yield return TmdbUtils.BaseTmdbUrl + $"tv/{seriesExternalId}/season/{episode.Season.IndexNumber}/episode/{episode.IndexNumber}";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
case Movie:
|
||||
externalId = item.GetProviderId(MetadataProvider.Tmdb);
|
||||
if (!string.IsNullOrEmpty(externalId))
|
||||
{
|
||||
yield return TmdbUtils.BaseTmdbUrl + $"movie/{externalId}";
|
||||
}
|
||||
|
||||
break;
|
||||
case Person:
|
||||
externalId = item.GetProviderId(MetadataProvider.Tmdb);
|
||||
if (!string.IsNullOrEmpty(externalId))
|
||||
{
|
||||
yield return TmdbUtils.BaseTmdbUrl + $"person/{externalId}";
|
||||
}
|
||||
|
||||
break;
|
||||
case BoxSet:
|
||||
externalId = item.GetProviderId(MetadataProvider.Tmdb);
|
||||
if (!string.IsNullOrEmpty(externalId))
|
||||
{
|
||||
yield return TmdbUtils.BaseTmdbUrl + $"collection/{externalId}";
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
using System.Collections.Generic;
|
||||
using MediaBrowser.Controller.Entities;
|
||||
using MediaBrowser.Controller.Providers;
|
||||
using MediaBrowser.Model.Entities;
|
||||
|
||||
namespace MediaBrowser.Providers.TV;
|
||||
|
||||
/// <summary>
|
||||
/// External URLs for TMDb.
|
||||
/// </summary>
|
||||
public class Zap2ItExternalUrlProvider : IExternalUrlProvider
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public string Name => "Zap2It";
|
||||
|
||||
/// <inheritdoc/>
|
||||
public IEnumerable<string> GetExternalUrls(BaseItem item)
|
||||
{
|
||||
var externalId = item.GetProviderId(MetadataProvider.Zap2It);
|
||||
if (!string.IsNullOrEmpty(externalId))
|
||||
{
|
||||
yield return $"http://tvlistings.zap2it.com/overview.html?programSeriesId={externalId}";
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in new issue