-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStashExternalId.cs
More file actions
37 lines (31 loc) · 1.01 KB
/
Copy pathStashExternalId.cs
File metadata and controls
37 lines (31 loc) · 1.01 KB
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
29
30
31
32
33
34
35
36
37
using MediaBrowser.Controller.Entities.Movies;
using MediaBrowser.Controller.Providers;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Providers;
namespace Jellyfin.Plugin.StashSync.Providers;
/// <summary>
/// Registers "Stash" as an external ID type in Jellyfin.
/// This allows the Group ID to be displayed and linked on the movie's detail page.
/// </summary>
public class StashExternalId : IExternalId
{
/// <inheritdoc />
public string ProviderName => "Stash";
/// <inheritdoc />
public string Key => "Stash";
/// <inheritdoc />
public ExternalIdMediaType? Type => ExternalIdMediaType.Movie;
/// <inheritdoc />
public string? UrlFormatString
{
get
{
var baseUrl = Plugin.Instance?.Configuration.StashUrl;
return string.IsNullOrEmpty(baseUrl)
? null
: $"{baseUrl.TrimEnd('/')}/groups/{{0}}";
}
}
/// <inheritdoc />
public bool Supports(IHasProviderIds item) => item is Movie;
}