mirror of
https://github.com/metatube-community/jellyfin-plugin-metatube.git
synced 2026-02-02 18:21:48 +08:00
Fix: Emby collections feature (#460)
This commit is contained in:
@@ -8,6 +8,7 @@ using MediaBrowser.Controller.Entities.Movies;
|
||||
using MediaBrowser.Controller.Providers;
|
||||
using MediaBrowser.Model.Entities;
|
||||
using MediaBrowser.Model.Providers;
|
||||
using MediaBrowser.Model.Configuration;
|
||||
using MovieInfo = MediaBrowser.Controller.Providers.MovieInfo;
|
||||
#if __EMBY__
|
||||
using MediaBrowser.Model.Logging;
|
||||
@@ -19,7 +20,7 @@ using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace Jellyfin.Plugin.MetaTube.Providers;
|
||||
|
||||
public class MovieProvider : BaseProvider, IRemoteMetadataProvider<Movie, MovieInfo>, IHasOrder
|
||||
public class MovieProvider : BaseProvider, IRemoteMetadataProvider<Movie, MovieInfo>, IHasOrder, IHasMetadataFeatures
|
||||
{
|
||||
private const string AvBase = "AVBASE";
|
||||
private const string Gfriends = "Gfriends";
|
||||
@@ -35,6 +36,8 @@ public class MovieProvider : BaseProvider, IRemoteMetadataProvider<Movie, MovieI
|
||||
{
|
||||
}
|
||||
|
||||
public MetadataFeatures[] Features => new[] { MetadataFeatures.Collections, MetadataFeatures.Adult, MetadataFeatures.RequiredSetup };
|
||||
|
||||
public async Task<MetadataResult<Movie>> GetMetadata(MovieInfo info,
|
||||
CancellationToken cancellationToken)
|
||||
{
|
||||
@@ -134,8 +137,12 @@ public class MovieProvider : BaseProvider, IRemoteMetadataProvider<Movie, MovieI
|
||||
result.Item.CommunityRating = m.Score > 0 ? (float)Math.Round(m.Score * 2, 1) : null;
|
||||
|
||||
// Add collection.
|
||||
if (Configuration.EnableCollections && !string.IsNullOrWhiteSpace(m.Series))
|
||||
if (Configuration.EnableCollections && !string.IsNullOrWhiteSpace(m.Series))
|
||||
{
|
||||
result.Item.AddCollection(m.Series);
|
||||
Logger.Info("Add Collection for movie {0} [{1}]", pid.ToString(), m.Series);
|
||||
}
|
||||
|
||||
|
||||
// Add studio.
|
||||
if (!string.IsNullOrWhiteSpace(m.Maker))
|
||||
|
||||
Reference in New Issue
Block a user