diff options
| author | Shadowghost <Ghost_of_Stone@web.de> | 2026-04-01 18:01:25 +0200 |
|---|---|---|
| committer | Shadowghost <Ghost_of_Stone@web.de> | 2026-04-01 18:01:25 +0200 |
| commit | 99ad70fbc81c128f5859081a3b51da8db2d78726 (patch) | |
| tree | d929a9e3525703f3794c0b742645af436ac50440 /Emby.Server.Implementations | |
| parent | 6fdfc6a61b705191a23cf05d6648ace5607ab197 (diff) | |
Wrap method parameters
Diffstat (limited to 'Emby.Server.Implementations')
| -rw-r--r-- | Emby.Server.Implementations/Dto/DtoService.cs | 48 | ||||
| -rw-r--r-- | Emby.Server.Implementations/Library/LibraryManager.cs | 6 |
2 files changed, 47 insertions, 7 deletions
diff --git a/Emby.Server.Implementations/Dto/DtoService.cs b/Emby.Server.Implementations/Dto/DtoService.cs index 07938d172f..919733d2ad 100644 --- a/Emby.Server.Implementations/Dto/DtoService.cs +++ b/Emby.Server.Implementations/Dto/DtoService.cs @@ -153,7 +153,12 @@ namespace Emby.Server.Implementations.Dto private ILiveTvManager LivetvManager => _livetvManagerFactory.Value; /// <inheritdoc /> - public IReadOnlyList<BaseItemDto> GetBaseItemDtos(IReadOnlyList<BaseItem> items, DtoOptions options, User? user = null, BaseItem? owner = null, bool skipVisibilityCheck = false) + public IReadOnlyList<BaseItemDto> GetBaseItemDtos( + IReadOnlyList<BaseItem> items, + DtoOptions options, + User? user = null, + BaseItem? owner = null, + bool skipVisibilityCheck = false) { var accessibleItems = skipVisibilityCheck || user is null ? items : items.Where(x => x.IsVisible(user)).ToList(); var returnItems = new BaseItemDto[accessibleItems.Count]; @@ -201,7 +206,15 @@ namespace Emby.Server.Implementations.Dto for (int index = 0; index < accessibleItems.Count; index++) { var item = accessibleItems[index]; - var dto = GetBaseItemDtoInternal(item, options, user, owner, userDataBatch?.GetValueOrDefault(item.Id), allCollectionFolders, childCountBatch, playedCountBatch); + var dto = GetBaseItemDtoInternal( + item, + options, + user, + owner, + userDataBatch?.GetValueOrDefault(item.Id), + allCollectionFolders, + childCountBatch, + playedCountBatch); if (item is LiveTvChannel tvChannel) { @@ -253,7 +266,15 @@ namespace Emby.Server.Implementations.Dto return dto; } - private BaseItemDto GetBaseItemDtoInternal(BaseItem item, DtoOptions options, User? user = null, BaseItem? owner = null, UserItemData? userData = null, List<Folder>? allCollectionFolders = null, Dictionary<Guid, int>? childCountBatch = null, Dictionary<Guid, (int Played, int Total)>? playedCountBatch = null) + private BaseItemDto GetBaseItemDtoInternal( + BaseItem item, + DtoOptions options, + User? user = null, + BaseItem? owner = null, + UserItemData? userData = null, + List<Folder>? allCollectionFolders = null, + Dictionary<Guid, int>? childCountBatch = null, + Dictionary<Guid, (int Played, int Total)>? playedCountBatch = null) { var dto = new BaseItemDto { @@ -290,7 +311,14 @@ namespace Emby.Server.Implementations.Dto if (user is not null) { - AttachUserSpecificInfo(dto, item, user, options, userData, childCountBatch, playedCountBatch); + AttachUserSpecificInfo( + dto, + item, + user, + options, + userData, + childCountBatch, + playedCountBatch); } if (item is IHasMediaSources @@ -468,7 +496,14 @@ namespace Emby.Server.Implementations.Dto /// <summary> /// Attaches the user specific info. /// </summary> - private void AttachUserSpecificInfo(BaseItemDto dto, BaseItem item, User user, DtoOptions options, UserItemData? userData = null, Dictionary<Guid, int>? childCountBatch = null, Dictionary<Guid, (int Played, int Total)>? playedCountBatch = null) + private void AttachUserSpecificInfo( + BaseItemDto dto, + BaseItem item, + User user, + DtoOptions options, + UserItemData? userData = null, + Dictionary<Guid, int>? childCountBatch = null, + Dictionary<Guid, (int Played, int Total)>? playedCountBatch = null) { if (item.IsFolder) { @@ -480,7 +515,8 @@ namespace Emby.Server.Implementations.Dto { // Use pre-fetched user data dto.UserData = GetUserItemDataDto(userData, item.Id); - (int Played, int Total)? precomputed = playedCountBatch is not null && playedCountBatch.TryGetValue(item.Id, out var counts) ? counts : null; + (int Played, int Total)? precomputed = playedCountBatch is not null + && playedCountBatch.TryGetValue(item.Id, out var counts) ? counts : null; item.FillUserDataDtoValues(dto.UserData, userData, dto, user, options, precomputed); } else diff --git a/Emby.Server.Implementations/Library/LibraryManager.cs b/Emby.Server.Implementations/Library/LibraryManager.cs index 57db845cb2..5d24bffa2f 100644 --- a/Emby.Server.Implementations/Library/LibraryManager.cs +++ b/Emby.Server.Implementations/Library/LibraryManager.cs @@ -774,7 +774,11 @@ namespace Emby.Server.Implementations.Library return key.GetMD5(); } - public BaseItem? ResolvePath(FileSystemMetadata fileInfo, Folder? parent = null, IDirectoryService? directoryService = null, CollectionType? collectionType = null) + public BaseItem? ResolvePath( + FileSystemMetadata fileInfo, + Folder? parent = null, + IDirectoryService? directoryService = null, + CollectionType? collectionType = null) => ResolvePath(fileInfo, directoryService ?? new DirectoryService(_fileSystem), null, parent, collectionType); /// <inheritdoc /> |
