mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-05-31 04:48:27 +01:00
Cleanup external item data cleanup (#14072)
This commit is contained in:
@@ -1436,7 +1436,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
return info.LastWriteTimeUtc != DateModified;
|
||||
}
|
||||
|
||||
return info.LastWriteTimeUtc != DateModified && info.Length != (Size ?? 0);
|
||||
return info.LastWriteTimeUtc != DateModified;
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
@@ -7,12 +7,14 @@ using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Text.Json.Serialization;
|
||||
using System.Threading;
|
||||
using Jellyfin.Data.Enums;
|
||||
using Jellyfin.Extensions;
|
||||
using MediaBrowser.Controller.MediaEncoding;
|
||||
using MediaBrowser.Controller.Providers;
|
||||
using MediaBrowser.Model.Dlna;
|
||||
using MediaBrowser.Model.Entities;
|
||||
using MediaBrowser.Model.IO;
|
||||
using MediaBrowser.Model.Providers;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace MediaBrowser.Controller.Entities.TV
|
||||
@@ -22,6 +24,8 @@ namespace MediaBrowser.Controller.Entities.TV
|
||||
/// </summary>
|
||||
public class Episode : Video, IHasTrailers, IHasLookupInfo<EpisodeInfo>, IHasSeries
|
||||
{
|
||||
public static IMediaEncoder MediaEncoder { get; set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
[JsonIgnore]
|
||||
public IReadOnlyList<BaseItem> LocalTrailers => GetExtras()
|
||||
@@ -325,6 +329,39 @@ namespace MediaBrowser.Controller.Entities.TV
|
||||
{
|
||||
if (SourceType == SourceType.Library || SourceType == SourceType.LiveTV)
|
||||
{
|
||||
var libraryOptions = LibraryManager.GetLibraryOptions(this);
|
||||
if (libraryOptions.EnableEmbeddedEpisodeInfos && string.Equals(Container, "mp4", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
try
|
||||
{
|
||||
var mediaInfo = MediaEncoder.GetMediaInfo(
|
||||
new MediaInfoRequest
|
||||
{
|
||||
MediaSource = GetMediaSources(false)[0],
|
||||
MediaType = DlnaProfileType.Video
|
||||
},
|
||||
CancellationToken.None).GetAwaiter().GetResult();
|
||||
if (mediaInfo.ParentIndexNumber > 0)
|
||||
{
|
||||
ParentIndexNumber = mediaInfo.ParentIndexNumber;
|
||||
}
|
||||
|
||||
if (mediaInfo.IndexNumber > 0)
|
||||
{
|
||||
IndexNumber = mediaInfo.IndexNumber;
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(mediaInfo.ShowName))
|
||||
{
|
||||
SeriesName = mediaInfo.ShowName;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.LogError(ex, "Error reading the episode information with ffprobe. Episode: {EpisodeInfo}", Path);
|
||||
}
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
if (LibraryManager.FillMissingEpisodeNumbersFromPath(this, replaceAllMetadata))
|
||||
|
||||
Reference in New Issue
Block a user