mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-07-03 04:42:52 +01:00
Added item identity providers and converters
This commit is contained in:
43
MediaBrowser.Controller/Providers/ItemIdentities.cs
Normal file
43
MediaBrowser.Controller/Providers/ItemIdentities.cs
Normal file
@@ -0,0 +1,43 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MediaBrowser.Controller.Providers
|
||||
{
|
||||
public interface IItemIdentity
|
||||
{
|
||||
string Type { get; }
|
||||
}
|
||||
|
||||
public interface IHasIdentities<out TIdentity>
|
||||
where TIdentity : IItemIdentity
|
||||
{
|
||||
IEnumerable<TIdentity> Identities { get; }
|
||||
|
||||
Task FindIdentities(IProviderManager providerManager, CancellationToken cancellationToken);
|
||||
}
|
||||
|
||||
public interface IItemIdentityProvider : IHasOrder { }
|
||||
|
||||
public interface IItemIdentityProvider<in TLookupInfo, TIdentity> : IItemIdentityProvider
|
||||
where TLookupInfo : ItemLookupInfo
|
||||
where TIdentity : IItemIdentity
|
||||
{
|
||||
Task<TIdentity> FindIdentity(TLookupInfo info);
|
||||
}
|
||||
|
||||
public interface IItemIdentityConverter : IHasOrder { }
|
||||
|
||||
public interface IItemIdentityConverter<TIdentity> : IItemIdentityConverter
|
||||
where TIdentity : IItemIdentity
|
||||
{
|
||||
Task<TIdentity> Convert(TIdentity identity);
|
||||
|
||||
string SourceType { get; }
|
||||
|
||||
string ResultType { get; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user