mirror of https://github.com/jellyfin/jellyfin.git
Compare commits
6 Commits
ffdf63b707
...
fbbe333bb1
Author | SHA1 | Date |
---|---|---|
Bond-009 | fbbe333bb1 | |
Nyanmisaka | e2a22cec0e | |
queeup | 067962ae2a | |
Szilágyi Kristóf | 8a65d239b7 | |
HiPotionQ8 | 518404cd1d | |
Bond_009 | 8ca7a23580 |
|
@ -1,5 +1,3 @@
|
|||
#nullable disable
|
||||
|
||||
#pragma warning disable CS1591
|
||||
|
||||
using System;
|
||||
|
@ -83,12 +81,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)
|
||||
public IReadOnlyList<BaseItemDto> GetBaseItemDtos(IReadOnlyList<BaseItem> items, DtoOptions options, User? user = null, BaseItem? owner = null)
|
||||
{
|
||||
var accessibleItems = user is null ? items : items.Where(x => x.IsVisible(user)).ToList();
|
||||
var returnItems = new BaseItemDto[accessibleItems.Count];
|
||||
List<(BaseItem, BaseItemDto)> programTuples = null;
|
||||
List<(BaseItemDto, LiveTvChannel)> channelTuples = null;
|
||||
List<(BaseItem, BaseItemDto)>? programTuples = null;
|
||||
List<(BaseItemDto, LiveTvChannel)>? channelTuples = null;
|
||||
|
||||
for (int index = 0; index < accessibleItems.Count; index++)
|
||||
{
|
||||
|
@ -137,7 +135,7 @@ namespace Emby.Server.Implementations.Dto
|
|||
return returnItems;
|
||||
}
|
||||
|
||||
public BaseItemDto GetBaseItemDto(BaseItem item, DtoOptions options, User user = null, BaseItem owner = null)
|
||||
public BaseItemDto GetBaseItemDto(BaseItem item, DtoOptions options, User? user = null, BaseItem? owner = null)
|
||||
{
|
||||
var dto = GetBaseItemDtoInternal(item, options, user, owner);
|
||||
if (item is LiveTvChannel tvChannel)
|
||||
|
@ -167,7 +165,7 @@ namespace Emby.Server.Implementations.Dto
|
|||
return dto;
|
||||
}
|
||||
|
||||
private static IList<BaseItem> GetTaggedItems(IItemByName byName, User user, DtoOptions options)
|
||||
private static IList<BaseItem> GetTaggedItems(IItemByName byName, User? user, DtoOptions options)
|
||||
{
|
||||
return byName.GetTaggedItems(
|
||||
new InternalItemsQuery(user)
|
||||
|
@ -177,7 +175,7 @@ namespace Emby.Server.Implementations.Dto
|
|||
});
|
||||
}
|
||||
|
||||
private BaseItemDto GetBaseItemDtoInternal(BaseItem item, DtoOptions options, User user = null, BaseItem owner = null)
|
||||
private BaseItemDto GetBaseItemDtoInternal(BaseItem item, DtoOptions options, User? user = null, BaseItem? owner = null)
|
||||
{
|
||||
var dto = new BaseItemDto
|
||||
{
|
||||
|
@ -292,7 +290,7 @@ namespace Emby.Server.Implementations.Dto
|
|||
}
|
||||
|
||||
var path = mediaSource.Path;
|
||||
string fileExtensionContainer = null;
|
||||
string? fileExtensionContainer = null;
|
||||
|
||||
if (!string.IsNullOrEmpty(path))
|
||||
{
|
||||
|
@ -316,7 +314,8 @@ namespace Emby.Server.Implementations.Dto
|
|||
}
|
||||
}
|
||||
|
||||
public BaseItemDto GetItemByNameDto(BaseItem item, DtoOptions options, List<BaseItem> taggedItems, User user = null)
|
||||
/// <inheritdoc />
|
||||
public BaseItemDto GetItemByNameDto(BaseItem item, DtoOptions options, List<BaseItem>? taggedItems, User? user = null)
|
||||
{
|
||||
var dto = GetBaseItemDtoInternal(item, options, user);
|
||||
|
||||
|
@ -486,10 +485,10 @@ namespace Emby.Server.Implementations.Dto
|
|||
return images
|
||||
.Select(p => GetImageCacheTag(item, p))
|
||||
.Where(i => i is not null)
|
||||
.ToArray();
|
||||
.ToArray()!; // null values got filtered out
|
||||
}
|
||||
|
||||
private string GetImageCacheTag(BaseItem item, ItemImageInfo image)
|
||||
private string? GetImageCacheTag(BaseItem item, ItemImageInfo image)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
@ -508,7 +507,7 @@ namespace Emby.Server.Implementations.Dto
|
|||
/// <param name="dto">The dto.</param>
|
||||
/// <param name="item">The item.</param>
|
||||
/// <param name="user">The requesting user.</param>
|
||||
private void AttachPeople(BaseItemDto dto, BaseItem item, User user = null)
|
||||
private void AttachPeople(BaseItemDto dto, BaseItem item, User? user = null)
|
||||
{
|
||||
// Ordering by person type to ensure actors and artists are at the front.
|
||||
// This is taking advantage of the fact that they both begin with A
|
||||
|
@ -552,7 +551,7 @@ namespace Emby.Server.Implementations.Dto
|
|||
|
||||
var list = new List<BaseItemPerson>();
|
||||
|
||||
var dictionary = people.Select(p => p.Name)
|
||||
Dictionary<string, Person> dictionary = people.Select(p => p.Name)
|
||||
.Distinct(StringComparer.OrdinalIgnoreCase).Select(c =>
|
||||
{
|
||||
try
|
||||
|
@ -565,9 +564,9 @@ namespace Emby.Server.Implementations.Dto
|
|||
return null;
|
||||
}
|
||||
}).Where(i => i is not null)
|
||||
.Where(i => user is null || i.IsVisible(user))
|
||||
.DistinctBy(x => x.Name, StringComparer.OrdinalIgnoreCase)
|
||||
.ToDictionary(i => i.Name, StringComparer.OrdinalIgnoreCase);
|
||||
.Where(i => user is null || i!.IsVisible(user))
|
||||
.DistinctBy(x => x!.Name, StringComparer.OrdinalIgnoreCase)
|
||||
.ToDictionary(i => i!.Name, StringComparer.OrdinalIgnoreCase)!; // null values got filtered out
|
||||
|
||||
for (var i = 0; i < people.Count; i++)
|
||||
{
|
||||
|
@ -580,7 +579,7 @@ namespace Emby.Server.Implementations.Dto
|
|||
Type = person.Type
|
||||
};
|
||||
|
||||
if (dictionary.TryGetValue(person.Name, out Person entity))
|
||||
if (dictionary.TryGetValue(person.Name, out Person? entity))
|
||||
{
|
||||
baseItemPerson.PrimaryImageTag = GetTagAndFillBlurhash(dto, entity, ImageType.Primary);
|
||||
baseItemPerson.Id = entity.Id;
|
||||
|
@ -650,7 +649,7 @@ namespace Emby.Server.Implementations.Dto
|
|||
return _libraryManager.GetGenreId(name);
|
||||
}
|
||||
|
||||
private string GetTagAndFillBlurhash(BaseItemDto dto, BaseItem item, ImageType imageType, int imageIndex = 0)
|
||||
private string? GetTagAndFillBlurhash(BaseItemDto dto, BaseItem item, ImageType imageType, int imageIndex = 0)
|
||||
{
|
||||
var image = item.GetImageInfo(imageType, imageIndex);
|
||||
if (image is not null)
|
||||
|
@ -661,9 +660,14 @@ namespace Emby.Server.Implementations.Dto
|
|||
return null;
|
||||
}
|
||||
|
||||
private string GetTagAndFillBlurhash(BaseItemDto dto, BaseItem item, ItemImageInfo image)
|
||||
private string? GetTagAndFillBlurhash(BaseItemDto dto, BaseItem item, ItemImageInfo image)
|
||||
{
|
||||
var tag = GetImageCacheTag(item, image);
|
||||
if (tag is null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(image.BlurHash))
|
||||
{
|
||||
dto.ImageBlurHashes ??= new Dictionary<ImageType, Dictionary<string, string>>();
|
||||
|
@ -716,7 +720,7 @@ namespace Emby.Server.Implementations.Dto
|
|||
/// <param name="item">The item.</param>
|
||||
/// <param name="owner">The owner.</param>
|
||||
/// <param name="options">The options.</param>
|
||||
private void AttachBasicFields(BaseItemDto dto, BaseItem item, BaseItem owner, DtoOptions options)
|
||||
private void AttachBasicFields(BaseItemDto dto, BaseItem item, BaseItem? owner, DtoOptions options)
|
||||
{
|
||||
if (options.ContainsField(ItemFields.DateCreated))
|
||||
{
|
||||
|
@ -1097,7 +1101,7 @@ namespace Emby.Server.Implementations.Dto
|
|||
}
|
||||
}
|
||||
|
||||
BaseItem[] allExtras = null;
|
||||
BaseItem[]? allExtras = null;
|
||||
|
||||
if (options.ContainsField(ItemFields.SpecialFeatureCount))
|
||||
{
|
||||
|
@ -1134,7 +1138,7 @@ namespace Emby.Server.Implementations.Dto
|
|||
dto.SeasonId = episode.SeasonId;
|
||||
dto.SeriesId = episode.SeriesId;
|
||||
|
||||
Series episodeSeries = null;
|
||||
Series? episodeSeries = null;
|
||||
|
||||
// this block will add the series poster for episodes without a poster
|
||||
// TODO maybe remove the if statement entirely
|
||||
|
@ -1162,8 +1166,10 @@ namespace Emby.Server.Implementations.Dto
|
|||
}
|
||||
|
||||
// Add SeriesInfo
|
||||
if (item is Series series)
|
||||
Series? series;
|
||||
if (item is Series tmp)
|
||||
{
|
||||
series = tmp;
|
||||
dto.AirDays = series.AirDays;
|
||||
dto.AirTime = series.AirTime;
|
||||
dto.Status = series.Status?.ToString();
|
||||
|
@ -1264,7 +1270,7 @@ namespace Emby.Server.Implementations.Dto
|
|||
}
|
||||
}
|
||||
|
||||
private BaseItem GetImageDisplayParent(BaseItem currentItem, BaseItem originalItem)
|
||||
private BaseItem? GetImageDisplayParent(BaseItem currentItem, BaseItem originalItem)
|
||||
{
|
||||
if (currentItem is MusicAlbum musicAlbum)
|
||||
{
|
||||
|
@ -1285,7 +1291,7 @@ namespace Emby.Server.Implementations.Dto
|
|||
return parent;
|
||||
}
|
||||
|
||||
private void AddInheritedImages(BaseItemDto dto, BaseItem item, DtoOptions options, BaseItem owner)
|
||||
private void AddInheritedImages(BaseItemDto dto, BaseItem item, DtoOptions options, BaseItem? owner)
|
||||
{
|
||||
if (!item.SupportsInheritedParentImages)
|
||||
{
|
||||
|
@ -1305,7 +1311,7 @@ namespace Emby.Server.Implementations.Dto
|
|||
return;
|
||||
}
|
||||
|
||||
BaseItem parent = null;
|
||||
BaseItem? parent = null;
|
||||
var isFirst = true;
|
||||
|
||||
var imageTags = dto.ImageTags;
|
||||
|
@ -1378,7 +1384,7 @@ namespace Emby.Server.Implementations.Dto
|
|||
}
|
||||
}
|
||||
|
||||
private string GetMappedPath(BaseItem item, BaseItem ownerItem)
|
||||
private string GetMappedPath(BaseItem item, BaseItem? ownerItem)
|
||||
{
|
||||
var path = item.Path;
|
||||
|
||||
|
|
|
@ -128,5 +128,7 @@
|
|||
"TaskRefreshTrickplayImages": "توليد صور Trickplay",
|
||||
"TaskRefreshTrickplayImagesDescription": "يُنشئ معاينات Trickplay لمقاطع الفيديو في المكتبات المُمكّنة.",
|
||||
"TaskCleanCollectionsAndPlaylists": "حذف المجموعات وقوائم التشغيل",
|
||||
"TaskCleanCollectionsAndPlaylistsDescription": "حذف عناصر من المجموعات وقوائم التشغيل التي لم تعد موجودة."
|
||||
"TaskCleanCollectionsAndPlaylistsDescription": "حذف عناصر من المجموعات وقوائم التشغيل التي لم تعد موجودة.",
|
||||
"TaskAudioNormalization": "تطبيع الصوت",
|
||||
"TaskAudioNormalizationDescription": "مسح الملفات لتطبيع بيانات الصوت."
|
||||
}
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
{
|
||||
"Albums": "Albumok",
|
||||
"AppDeviceValues": "Program: {0}, eszköz: {1}",
|
||||
"AppDeviceValues": "Program: {0}, Eszköz: {1}",
|
||||
"Application": "Alkalmazás",
|
||||
"Artists": "Előadók",
|
||||
"AuthenticationSucceededWithUserName": "{0} sikeresen hitelesítve",
|
||||
"Books": "Könyvek",
|
||||
"CameraImageUploadedFrom": "Új kamerakép feltöltve innen: {0}",
|
||||
"CameraImageUploadedFrom": "Új kamerakép lett feltöltve innen: {0}",
|
||||
"Channels": "Csatornák",
|
||||
"ChapterNameValue": "{0}. jelenet",
|
||||
"ChapterNameValue": "Jelenet {0}",
|
||||
"Collections": "Gyűjtemények",
|
||||
"DeviceOfflineWithName": "{0} kijelentkezett",
|
||||
"DeviceOnlineWithName": "{0} belépett",
|
||||
|
@ -15,27 +15,27 @@
|
|||
"Favorites": "Kedvencek",
|
||||
"Folders": "Könyvtárak",
|
||||
"Genres": "Műfajok",
|
||||
"HeaderAlbumArtists": "Albumelőadók",
|
||||
"HeaderAlbumArtists": "Album előadók",
|
||||
"HeaderContinueWatching": "Megtekintés folytatása",
|
||||
"HeaderFavoriteAlbums": "Kedvenc albumok",
|
||||
"HeaderFavoriteAlbums": "Kedvenc Albumok",
|
||||
"HeaderFavoriteArtists": "Kedvenc előadók",
|
||||
"HeaderFavoriteEpisodes": "Kedvenc epizódok",
|
||||
"HeaderFavoriteShows": "Kedvenc sorozatok",
|
||||
"HeaderFavoriteSongs": "Kedvenc számok",
|
||||
"HeaderFavoriteSongs": "Kedvenc dalok",
|
||||
"HeaderLiveTV": "Élő TV",
|
||||
"HeaderNextUp": "Következik",
|
||||
"HeaderRecordingGroups": "Felvételi csoportok",
|
||||
"HomeVideos": "Házi videók",
|
||||
"HomeVideos": "Otthoni videók",
|
||||
"Inherit": "Örökölt",
|
||||
"ItemAddedWithName": "{0} hozzáadva a könyvtárhoz",
|
||||
"ItemRemovedWithName": "{0} eltávolítva a könyvtárból",
|
||||
"LabelIpAddressValue": "IP-cím: {0}",
|
||||
"LabelRunningTimeValue": "Lejátszási idő: {0}",
|
||||
"Latest": "Legújabb",
|
||||
"MessageApplicationUpdated": "A Jellyfin kiszolgáló frissítve",
|
||||
"MessageApplicationUpdated": "A Jellyfin kiszolgáló frissítve lett",
|
||||
"MessageApplicationUpdatedTo": "A Jellyfin kiszolgáló frissítve lett a következőre: {0}",
|
||||
"MessageNamedServerConfigurationUpdatedWithValue": "A kiszolgálókonfigurációs rész frissítve: {0}",
|
||||
"MessageServerConfigurationUpdated": "Kiszolgálókonfiguráció frissítve",
|
||||
"MessageNamedServerConfigurationUpdatedWithValue": "A kiszolgálókonfigurációs rész frissítve lett: {0}",
|
||||
"MessageServerConfigurationUpdated": "Kiszolgálókonfiguráció frissítve lett",
|
||||
"MixedContent": "Vegyes tartalom",
|
||||
"Movies": "Filmek",
|
||||
"Music": "Zenék",
|
||||
|
@ -46,7 +46,7 @@
|
|||
"NewVersionIsAvailable": "Letölthető a Jellyfin kiszolgáló új verziója.",
|
||||
"NotificationOptionApplicationUpdateAvailable": "Frissítés érhető el az alkalmazáshoz",
|
||||
"NotificationOptionApplicationUpdateInstalled": "Alkalmazásfrissítés telepítve",
|
||||
"NotificationOptionAudioPlayback": "Hanglejátszás elkezdve",
|
||||
"NotificationOptionAudioPlayback": "Hanglejátszás elkezdődött",
|
||||
"NotificationOptionAudioPlaybackStopped": "Hanglejátszás leállítva",
|
||||
"NotificationOptionCameraImageUploaded": "Kamerakép feltöltve",
|
||||
"NotificationOptionInstallationFailed": "Telepítési hiba",
|
||||
|
@ -126,5 +126,9 @@
|
|||
"External": "Külső",
|
||||
"HearingImpaired": "Hallássérült",
|
||||
"TaskRefreshTrickplayImages": "Trickplay képek generálása",
|
||||
"TaskRefreshTrickplayImagesDescription": "Trickplay előnézetet készít az engedélyezett könyvtárakban lévő videókhoz."
|
||||
"TaskRefreshTrickplayImagesDescription": "Trickplay előnézetet készít az engedélyezett könyvtárakban lévő videókhoz.",
|
||||
"TaskAudioNormalization": "Hangerő Normalizáció",
|
||||
"TaskCleanCollectionsAndPlaylistsDescription": "Nem létező elemek törlése a gyűjteményekből és lejátszási listákról.",
|
||||
"TaskAudioNormalizationDescription": "Hangerő normalizációs adatok keresése.",
|
||||
"TaskCleanCollectionsAndPlaylists": "Gyűjtemények és lejátszási listák optimalizálása"
|
||||
}
|
||||
|
|
|
@ -128,5 +128,7 @@
|
|||
"TaskRefreshTrickplayImages": "Trickplay Görselleri Oluştur",
|
||||
"TaskRefreshTrickplayImagesDescription": "Etkin kütüphanelerdeki videolar için trickplay önizlemeleri oluşturur.",
|
||||
"TaskCleanCollectionsAndPlaylistsDescription": "Artık var olmayan koleksiyon ve çalma listelerindeki ögeleri kaldırır.",
|
||||
"TaskCleanCollectionsAndPlaylists": "Koleksiyonları ve çalma listelerini temizleyin"
|
||||
"TaskCleanCollectionsAndPlaylists": "Koleksiyonları ve çalma listelerini temizleyin",
|
||||
"TaskAudioNormalizationDescription": "Ses normalleştirme verileri için dosyaları tarar.",
|
||||
"TaskAudioNormalization": "Ses Normalleştirme"
|
||||
}
|
||||
|
|
|
@ -128,5 +128,7 @@
|
|||
"TaskRefreshTrickplayImages": "生成时间轴缩略图",
|
||||
"TaskRefreshTrickplayImagesDescription": "为启用的媒体库中的视频生成时间轴缩略图。",
|
||||
"TaskCleanCollectionsAndPlaylists": "清理合集和播放列表",
|
||||
"TaskCleanCollectionsAndPlaylistsDescription": "清理合集和播放列表中已不存在的项目。"
|
||||
"TaskCleanCollectionsAndPlaylistsDescription": "清理合集和播放列表中已不存在的项目。",
|
||||
"TaskAudioNormalization": "音频标准化",
|
||||
"TaskAudioNormalizationDescription": "扫描文件以寻找音频标准化数据。"
|
||||
}
|
||||
|
|
|
@ -26,8 +26,6 @@ public static class DtoExtensions
|
|||
internal static DtoOptions AddClientFields(
|
||||
this DtoOptions dtoOptions, ClaimsPrincipal user)
|
||||
{
|
||||
dtoOptions.Fields ??= Array.Empty<ItemFields>();
|
||||
|
||||
string? client = user.GetClient();
|
||||
|
||||
// No client in claim
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
#nullable disable
|
||||
|
||||
#pragma warning disable CS1591
|
||||
|
||||
using System;
|
||||
|
|
Loading…
Reference in New Issue