From 49c3443b0cdf09b84aa644fe0438f6384aeb5623 Mon Sep 17 00:00:00 2001 From: theguymadmax Date: Fri, 10 Oct 2025 18:34:37 -0400 Subject: Prevent PlaylistsFolder deletion during library removal --- MediaBrowser.Controller/Entities/Folder.cs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'MediaBrowser.Controller') diff --git a/MediaBrowser.Controller/Entities/Folder.cs b/MediaBrowser.Controller/Entities/Folder.cs index e62004510f..e9a3836902 100644 --- a/MediaBrowser.Controller/Entities/Folder.cs +++ b/MediaBrowser.Controller/Entities/Folder.cs @@ -457,6 +457,12 @@ namespace MediaBrowser.Controller.Entities { foreach (var item in itemsRemoved) { + if (!item.CanDelete()) + { + Logger.LogDebug("Item marked as non-removable, skipping: {Path}", item.Path ?? item.Name); + continue; + } + if (item.IsFileProtocol) { Logger.LogDebug("Removed item: {Path}", item.Path); -- cgit v1.2.3 From 5c519270b84cc07928bd45a14f38f9b1add24d01 Mon Sep 17 00:00:00 2001 From: Tim Eisele Date: Mon, 13 Oct 2025 20:32:41 +0200 Subject: Remove chapters on file change (#14984) --- .../Chapters/ChapterManager.cs | 19 ++----------------- .../Library/ExternalDataManager.cs | 6 ++++++ .../Item/ChapterRepository.cs | 13 +++++++++---- MediaBrowser.Controller/Chapters/IChapterManager.cs | 8 +++++--- .../Persistence/IChapterRepository.cs | 6 +++++- 5 files changed, 27 insertions(+), 25 deletions(-) (limited to 'MediaBrowser.Controller') diff --git a/Emby.Server.Implementations/Chapters/ChapterManager.cs b/Emby.Server.Implementations/Chapters/ChapterManager.cs index b4daa2a143..fea05931d7 100644 --- a/Emby.Server.Implementations/Chapters/ChapterManager.cs +++ b/Emby.Server.Implementations/Chapters/ChapterManager.cs @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using System.Globalization; using System.IO; using System.Linq; using System.Threading; @@ -251,23 +250,9 @@ public class ChapterManager : IChapterManager } /// - public void DeleteChapterImages(Video video) + public async Task DeleteChapterDataAsync(Guid itemId, CancellationToken cancellationToken) { - var path = _pathManager.GetChapterImageFolderPath(video); - try - { - if (Directory.Exists(path)) - { - _logger.LogInformation("Removing chapter images for {Name} [{Id}]", video.Name, video.Id); - Directory.Delete(path, true); - } - } - catch (Exception ex) - { - _logger.LogWarning("Failed to remove chapter image folder for {Item}: {Exception}", video.Id, ex); - } - - _chapterRepository.DeleteChapters(video.Id); + await _chapterRepository.DeleteChaptersAsync(itemId, cancellationToken).ConfigureAwait(false); } private IReadOnlyList GetSavedChapterImages(Video video, IDirectoryService directoryService) diff --git a/Emby.Server.Implementations/Library/ExternalDataManager.cs b/Emby.Server.Implementations/Library/ExternalDataManager.cs index d3cfa1d256..4ad0f999bf 100644 --- a/Emby.Server.Implementations/Library/ExternalDataManager.cs +++ b/Emby.Server.Implementations/Library/ExternalDataManager.cs @@ -3,6 +3,7 @@ using System.IO; using System.Linq; using System.Threading; using System.Threading.Tasks; +using MediaBrowser.Controller.Chapters; using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.IO; using MediaBrowser.Controller.MediaSegments; @@ -20,6 +21,7 @@ public class ExternalDataManager : IExternalDataManager private readonly IMediaSegmentManager _mediaSegmentManager; private readonly IPathManager _pathManager; private readonly ITrickplayManager _trickplayManager; + private readonly IChapterManager _chapterManager; private readonly ILogger _logger; /// @@ -29,18 +31,21 @@ public class ExternalDataManager : IExternalDataManager /// The media segment manager. /// The path manager. /// The trickplay manager. + /// The chapter manager. /// The logger. public ExternalDataManager( IKeyframeManager keyframeManager, IMediaSegmentManager mediaSegmentManager, IPathManager pathManager, ITrickplayManager trickplayManager, + IChapterManager chapterManager, ILogger logger) { _keyframeManager = keyframeManager; _mediaSegmentManager = mediaSegmentManager; _pathManager = pathManager; _trickplayManager = trickplayManager; + _chapterManager = chapterManager; _logger = logger; } @@ -67,5 +72,6 @@ public class ExternalDataManager : IExternalDataManager await _keyframeManager.DeleteKeyframeDataAsync(itemId, cancellationToken).ConfigureAwait(false); await _mediaSegmentManager.DeleteSegmentsAsync(itemId, cancellationToken).ConfigureAwait(false); await _trickplayManager.DeleteTrickplayDataAsync(itemId, cancellationToken).ConfigureAwait(false); + await _chapterManager.DeleteChapterDataAsync(itemId, cancellationToken).ConfigureAwait(false); } } diff --git a/Jellyfin.Server.Implementations/Item/ChapterRepository.cs b/Jellyfin.Server.Implementations/Item/ChapterRepository.cs index e0d23a2613..98700f3224 100644 --- a/Jellyfin.Server.Implementations/Item/ChapterRepository.cs +++ b/Jellyfin.Server.Implementations/Item/ChapterRepository.cs @@ -1,6 +1,8 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Threading; +using System.Threading.Tasks; using Jellyfin.Database.Implementations; using Jellyfin.Database.Implementations.Entities; using MediaBrowser.Controller.Drawing; @@ -82,11 +84,14 @@ public class ChapterRepository : IChapterRepository } /// - public void DeleteChapters(Guid itemId) + public async Task DeleteChaptersAsync(Guid itemId, CancellationToken cancellationToken) { - using var context = _dbProvider.CreateDbContext(); - context.Chapters.Where(c => c.ItemId.Equals(itemId)).ExecuteDelete(); - context.SaveChanges(); + var dbContext = await _dbProvider.CreateDbContextAsync(cancellationToken).ConfigureAwait(false); + await using (dbContext.ConfigureAwait(false)) + { + await dbContext.Chapters.Where(c => c.ItemId.Equals(itemId)).ExecuteDeleteAsync(cancellationToken).ConfigureAwait(false); + await dbContext.SaveChangesAsync(cancellationToken).ConfigureAwait(false); + } } private Chapter Map(ChapterInfo chapterInfo, int index, Guid itemId) diff --git a/MediaBrowser.Controller/Chapters/IChapterManager.cs b/MediaBrowser.Controller/Chapters/IChapterManager.cs index 7532e56c60..25656fd625 100644 --- a/MediaBrowser.Controller/Chapters/IChapterManager.cs +++ b/MediaBrowser.Controller/Chapters/IChapterManager.cs @@ -48,8 +48,10 @@ public interface IChapterManager Task RefreshChapterImages(Video video, IDirectoryService directoryService, IReadOnlyList chapters, bool extractImages, bool saveChapters, CancellationToken cancellationToken); /// - /// Deletes the chapter images. + /// Deletes the chapter data. /// - /// Video to use. - void DeleteChapterImages(Video video); + /// The item id. + /// The cancellation token. + /// Task. + Task DeleteChapterDataAsync(Guid itemId, CancellationToken cancellationToken); } diff --git a/MediaBrowser.Controller/Persistence/IChapterRepository.cs b/MediaBrowser.Controller/Persistence/IChapterRepository.cs index 0844ddb364..64b90fd638 100644 --- a/MediaBrowser.Controller/Persistence/IChapterRepository.cs +++ b/MediaBrowser.Controller/Persistence/IChapterRepository.cs @@ -1,5 +1,7 @@ using System; using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; using MediaBrowser.Model.Entities; namespace MediaBrowser.Controller.Persistence; @@ -13,7 +15,9 @@ public interface IChapterRepository /// Deletes the chapters. /// /// The item. - void DeleteChapters(Guid itemId); + /// The cancellation token. + /// Task. + Task DeleteChaptersAsync(Guid itemId, CancellationToken cancellationToken); /// /// Saves the chapters. -- cgit v1.2.3 From c274336563fa2f9c7e7b7df0126e815c812e528e Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Sun, 26 Oct 2025 21:52:03 -0400 Subject: Bump version to 10.12.0 (for real this time) --- Emby.Naming/Emby.Naming.csproj | 2 +- Jellyfin.Data/Jellyfin.Data.csproj | 2 +- MediaBrowser.Common/MediaBrowser.Common.csproj | 2 +- MediaBrowser.Controller/MediaBrowser.Controller.csproj | 2 +- MediaBrowser.Model/MediaBrowser.Model.csproj | 2 +- SharedVersion.cs | 4 ++-- src/Jellyfin.Extensions/Jellyfin.Extensions.csproj | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) (limited to 'MediaBrowser.Controller') diff --git a/Emby.Naming/Emby.Naming.csproj b/Emby.Naming/Emby.Naming.csproj index 20b32f3a62..b84c961165 100644 --- a/Emby.Naming/Emby.Naming.csproj +++ b/Emby.Naming/Emby.Naming.csproj @@ -36,7 +36,7 @@ Jellyfin Contributors Jellyfin.Naming - 10.11.0 + 10.12.0 https://github.com/jellyfin/jellyfin GPL-3.0-only diff --git a/Jellyfin.Data/Jellyfin.Data.csproj b/Jellyfin.Data/Jellyfin.Data.csproj index 45374c22f7..fd852ece93 100644 --- a/Jellyfin.Data/Jellyfin.Data.csproj +++ b/Jellyfin.Data/Jellyfin.Data.csproj @@ -18,7 +18,7 @@ Jellyfin Contributors Jellyfin.Data - 10.11.0 + 10.12.0 https://github.com/jellyfin/jellyfin GPL-3.0-only diff --git a/MediaBrowser.Common/MediaBrowser.Common.csproj b/MediaBrowser.Common/MediaBrowser.Common.csproj index de6be4707e..9af13b0a72 100644 --- a/MediaBrowser.Common/MediaBrowser.Common.csproj +++ b/MediaBrowser.Common/MediaBrowser.Common.csproj @@ -8,7 +8,7 @@ Jellyfin Contributors Jellyfin.Common - 10.11.0 + 10.12.0 https://github.com/jellyfin/jellyfin GPL-3.0-only diff --git a/MediaBrowser.Controller/MediaBrowser.Controller.csproj b/MediaBrowser.Controller/MediaBrowser.Controller.csproj index 3353ad63f1..b5d14e94b1 100644 --- a/MediaBrowser.Controller/MediaBrowser.Controller.csproj +++ b/MediaBrowser.Controller/MediaBrowser.Controller.csproj @@ -8,7 +8,7 @@ Jellyfin Contributors Jellyfin.Controller - 10.11.0 + 10.12.0 https://github.com/jellyfin/jellyfin GPL-3.0-only diff --git a/MediaBrowser.Model/MediaBrowser.Model.csproj b/MediaBrowser.Model/MediaBrowser.Model.csproj index e9dab6bc8a..ef025d02dc 100644 --- a/MediaBrowser.Model/MediaBrowser.Model.csproj +++ b/MediaBrowser.Model/MediaBrowser.Model.csproj @@ -8,7 +8,7 @@ Jellyfin Contributors Jellyfin.Model - 10.11.0 + 10.12.0 https://github.com/jellyfin/jellyfin GPL-3.0-only diff --git a/SharedVersion.cs b/SharedVersion.cs index d26eb31aec..3b394d28b2 100644 --- a/SharedVersion.cs +++ b/SharedVersion.cs @@ -1,4 +1,4 @@ using System.Reflection; -[assembly: AssemblyVersion("10.11.0")] -[assembly: AssemblyFileVersion("10.11.0")] +[assembly: AssemblyVersion("10.12.0")] +[assembly: AssemblyFileVersion("10.12.0")] diff --git a/src/Jellyfin.Extensions/Jellyfin.Extensions.csproj b/src/Jellyfin.Extensions/Jellyfin.Extensions.csproj index 1613d83bc3..f52fd014da 100644 --- a/src/Jellyfin.Extensions/Jellyfin.Extensions.csproj +++ b/src/Jellyfin.Extensions/Jellyfin.Extensions.csproj @@ -15,7 +15,7 @@ Jellyfin Contributors Jellyfin.Extensions - 10.11.0 + 10.12.0 https://github.com/jellyfin/jellyfin GPL-3.0-only -- cgit v1.2.3 From 348b2992d7027138a57d35362100b1b93d68cc9a Mon Sep 17 00:00:00 2001 From: nyanmisaka Date: Mon, 27 Oct 2025 15:43:08 -0400 Subject: Backport pull request #15072 from jellyfin/release-10.11.z Reject stream copy of HDR10+ video if the client does not support HDR10 Original-merge: a725220c219d98ea69bc01d2664e68d58d0230f0 Merged-by: crobibero Backported-by: Bond_009 --- MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'MediaBrowser.Controller') diff --git a/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs b/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs index c81e639a22..a1d8915353 100644 --- a/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs +++ b/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs @@ -2390,8 +2390,8 @@ namespace MediaBrowser.Controller.MediaEncoding || (requestHasSDR && videoStream.VideoRangeType == VideoRangeType.DOVIWithSDR) || (requestHasHDR10 && videoStream.VideoRangeType == VideoRangeType.HDR10Plus))) { - // If the video stream is in a static HDR format, don't allow copy if the client does not support HDR10 or HLG. - if (videoStream.VideoRangeType is VideoRangeType.HDR10 or VideoRangeType.HLG) + // If the video stream is in HDR10+ or a static HDR format, don't allow copy if the client does not support HDR10 or HLG. + if (videoStream.VideoRangeType is VideoRangeType.HDR10Plus or VideoRangeType.HDR10 or VideoRangeType.HLG) { return false; } -- cgit v1.2.3 From 08fd175f5aa3a921d44934a11ccb8bcbd3956120 Mon Sep 17 00:00:00 2001 From: Shadowghost Date: Mon, 27 Oct 2025 15:43:23 -0400 Subject: Backport pull request #15187 from jellyfin/release-10.11.z Fix pagination and sorting for folders Original-merge: 7d1824ea27093322d5e8316ee38f375129f40386 Merged-by: crobibero Backported-by: Bond_009 --- MediaBrowser.Controller/Entities/Folder.cs | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'MediaBrowser.Controller') diff --git a/MediaBrowser.Controller/Entities/Folder.cs b/MediaBrowser.Controller/Entities/Folder.cs index e9a3836902..03ee447088 100644 --- a/MediaBrowser.Controller/Entities/Folder.cs +++ b/MediaBrowser.Controller/Entities/Folder.cs @@ -715,9 +715,18 @@ namespace MediaBrowser.Controller.Entities } else { - items = GetRecursiveChildren(user, query, out totalCount); + // Save pagination params before clearing them to prevent pagination from happening + // before sorting. PostFilterAndSort will apply pagination after sorting. + var limit = query.Limit; + var startIndex = query.StartIndex; query.Limit = null; - query.StartIndex = null; // override these here as they have already been applied + query.StartIndex = null; + + items = GetRecursiveChildren(user, query, out totalCount); + + // Restore pagination params so PostFilterAndSort can apply them after sorting + query.Limit = limit; + query.StartIndex = startIndex; } var result = PostFilterAndSort(items, query); @@ -980,20 +989,16 @@ namespace MediaBrowser.Controller.Entities else { // need to pass this param to the children. + // Note: Don't pass Limit/StartIndex here as pagination should happen after sorting in PostFilterAndSort var childQuery = new InternalItemsQuery { DisplayAlbumFolders = query.DisplayAlbumFolders, - Limit = query.Limit, - StartIndex = query.StartIndex, NameStartsWith = query.NameStartsWith, NameStartsWithOrGreater = query.NameStartsWithOrGreater, NameLessThan = query.NameLessThan }; items = GetChildren(user, true, out totalItemCount, childQuery).Where(filter); - - query.Limit = null; - query.StartIndex = null; } var result = PostFilterAndSort(items, query); -- cgit v1.2.3