Fix warning: Type cast is redundant (#2149)
This commit is contained in:
parent
d45fcdd5af
commit
6cbfdea4c0
|
@ -137,7 +137,7 @@ namespace Jellyfin.Api.Controllers
|
|||
}
|
||||
|
||||
var existingDisplayPreferences = _displayPreferencesManager.GetDisplayPreferences(userId, itemId, client);
|
||||
existingDisplayPreferences.IndexBy = Enum.TryParse<IndexingKind>(displayPreferences.IndexBy, true, out var indexBy) ? indexBy : (IndexingKind?)null;
|
||||
existingDisplayPreferences.IndexBy = Enum.TryParse<IndexingKind>(displayPreferences.IndexBy, true, out var indexBy) ? indexBy : null;
|
||||
existingDisplayPreferences.ShowBackdrop = displayPreferences.ShowBackdrop;
|
||||
existingDisplayPreferences.ShowSidebar = displayPreferences.ShowSidebar;
|
||||
|
||||
|
|
|
@ -263,8 +263,8 @@ namespace Jellyfin.Api.Controllers
|
|||
item.DateCreated = NormalizeDateTime(request.DateCreated.Value);
|
||||
}
|
||||
|
||||
item.EndDate = request.EndDate.HasValue ? NormalizeDateTime(request.EndDate.Value) : (DateTime?)null;
|
||||
item.PremiereDate = request.PremiereDate.HasValue ? NormalizeDateTime(request.PremiereDate.Value) : (DateTime?)null;
|
||||
item.EndDate = request.EndDate.HasValue ? NormalizeDateTime(request.EndDate.Value) : null;
|
||||
item.PremiereDate = request.PremiereDate.HasValue ? NormalizeDateTime(request.PremiereDate.Value) : null;
|
||||
item.ProductionYear = request.ProductionYear;
|
||||
item.OfficialRating = string.IsNullOrWhiteSpace(request.OfficialRating) ? null : request.OfficialRating;
|
||||
item.CustomRating = request.CustomRating;
|
||||
|
|
|
@ -20,7 +20,7 @@ namespace Jellyfin.Api.Helpers
|
|||
var value = GetClaimValue(user, InternalClaimTypes.UserId);
|
||||
return string.IsNullOrEmpty(value)
|
||||
? null
|
||||
: (Guid?)Guid.Parse(value);
|
||||
: Guid.Parse(value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -120,7 +120,7 @@ namespace Jellyfin.Server.Migrations.Routines
|
|||
|
||||
var displayPreferences = new DisplayPreferences(dtoUserId, itemId, client)
|
||||
{
|
||||
IndexBy = Enum.TryParse<IndexingKind>(dto.IndexBy, true, out var indexBy) ? indexBy : (IndexingKind?)null,
|
||||
IndexBy = Enum.TryParse<IndexingKind>(dto.IndexBy, true, out var indexBy) ? indexBy : null,
|
||||
ShowBackdrop = dto.ShowBackdrop,
|
||||
ShowSidebar = dto.ShowSidebar,
|
||||
ScrollDirection = dto.ScrollDirection,
|
||||
|
|
|
@ -1229,7 +1229,7 @@ namespace MediaBrowser.Model.Dlna
|
|||
|
||||
bool result = IsAudioEligibleForDirectPlay(item, maxBitrate, playMethod);
|
||||
|
||||
return (result, result ? (TranscodeReason?)null : TranscodeReason.ContainerBitrateExceedsLimit);
|
||||
return (result, result ? null : TranscodeReason.ContainerBitrateExceedsLimit);
|
||||
}
|
||||
|
||||
public static SubtitleProfile GetSubtitleProfile(
|
||||
|
|
|
@ -513,7 +513,7 @@ namespace Rssdp.Infrastructure
|
|||
return TimeSpan.Zero;
|
||||
}
|
||||
|
||||
return (TimeSpan)(headerValue.MaxAge ?? headerValue.SharedMaxAge ?? TimeSpan.Zero);
|
||||
return headerValue.MaxAge ?? headerValue.SharedMaxAge ?? TimeSpan.Zero;
|
||||
}
|
||||
|
||||
private void RemoveExpiredDevicesFromCache()
|
||||
|
|
|
@ -20,7 +20,7 @@ namespace Jellyfin.Networking.Tests
|
|||
CallBase = true
|
||||
};
|
||||
configManager.Setup(x => x.GetConfiguration(It.IsAny<string>())).Returns(conf);
|
||||
return (IConfigurationManager)configManager.Object;
|
||||
return configManager.Object;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
Loading…
Reference in New Issue
Block a user