mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-20 00:55:13 +01:00
support mcm episodes
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using MediaBrowser.Controller.Providers;
|
||||
using System.Linq;
|
||||
using MediaBrowser.Controller.Providers;
|
||||
using MediaBrowser.Model.Configuration;
|
||||
using System.Collections.Generic;
|
||||
|
||||
@@ -42,7 +43,18 @@ namespace MediaBrowser.Controller.Entities
|
||||
|
||||
public BookInfo GetLookupInfo()
|
||||
{
|
||||
return GetItemLookupInfo<BookInfo>();
|
||||
var info = GetItemLookupInfo<BookInfo>();
|
||||
|
||||
if (string.IsNullOrEmpty(SeriesName))
|
||||
{
|
||||
info.SeriesName = Parents.Select(i => i.Name).FirstOrDefault();
|
||||
}
|
||||
else
|
||||
{
|
||||
info.SeriesName = SeriesName;
|
||||
}
|
||||
|
||||
return info;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
using MediaBrowser.Controller.Entities;
|
||||
using MediaBrowser.Controller.Library;
|
||||
using MediaBrowser.Model.LiveTv;
|
||||
using System;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MediaBrowser.Controller.LiveTv
|
||||
{
|
||||
@@ -184,5 +187,12 @@ namespace MediaBrowser.Controller.LiveTv
|
||||
{
|
||||
return "Program";
|
||||
}
|
||||
|
||||
public override Task UpdateToRepository(ItemUpdateType updateReason, CancellationToken cancellationToken)
|
||||
{
|
||||
// Avoid library manager and keep out of in-memory cache
|
||||
// Not great that this class has to know about that, but we'll improve that later.
|
||||
return ItemRepository.SaveItem(this, cancellationToken);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System.Threading;
|
||||
using MediaBrowser.Controller.Entities;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using MediaBrowser.Controller.Entities;
|
||||
|
||||
namespace MediaBrowser.Controller.Providers
|
||||
{
|
||||
@@ -17,7 +18,7 @@ namespace MediaBrowser.Controller.Providers
|
||||
/// <param name="info">The information.</param>
|
||||
/// <param name="cancellationToken">The cancellation token.</param>
|
||||
/// <returns>Task{MetadataResult{`0}}.</returns>
|
||||
Task<MetadataResult<TItemType>> GetMetadata(ItemInfo info, CancellationToken cancellationToken);
|
||||
Task<LocalMetadataResult<TItemType>> GetMetadata(ItemInfo info, CancellationToken cancellationToken);
|
||||
}
|
||||
|
||||
public class ItemInfo
|
||||
@@ -26,4 +27,18 @@ namespace MediaBrowser.Controller.Providers
|
||||
|
||||
public bool IsInMixedFolder { get; set; }
|
||||
}
|
||||
|
||||
public class LocalMetadataResult<T>
|
||||
where T : IHasMetadata
|
||||
{
|
||||
public bool HasMetadata { get; set; }
|
||||
public T Item { get; set; }
|
||||
|
||||
public List<LocalImageInfo> Images { get; set; }
|
||||
|
||||
public LocalMetadataResult()
|
||||
{
|
||||
Images = new List<LocalImageInfo>();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -147,7 +147,7 @@ namespace MediaBrowser.Controller.Providers
|
||||
|
||||
public class BookInfo : ItemLookupInfo
|
||||
{
|
||||
|
||||
public string SeriesName { get; set; }
|
||||
}
|
||||
|
||||
public class SeasonInfo : ItemLookupInfo
|
||||
|
||||
Reference in New Issue
Block a user