mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-07-19 04:34:18 +01:00
Use ArgumentException.ThrowIfNullOrEmpty
This commit is contained in:
@@ -87,10 +87,7 @@ namespace MediaBrowser.Providers.Manager
|
||||
|
||||
public async Task SaveImage(BaseItem item, Stream source, string mimeType, ImageType type, int? imageIndex, bool? saveLocallyWithMedia, CancellationToken cancellationToken)
|
||||
{
|
||||
if (string.IsNullOrEmpty(mimeType))
|
||||
{
|
||||
throw new ArgumentNullException(nameof(mimeType));
|
||||
}
|
||||
ArgumentException.ThrowIfNullOrEmpty(mimeType);
|
||||
|
||||
var saveLocally = item.SupportsLocalMetadata && item.IsSaveLocalMetadataEnabled() && !item.ExtraType.HasValue && item is not Audio;
|
||||
|
||||
|
||||
@@ -918,15 +918,8 @@ namespace MediaBrowser.Providers.Manager
|
||||
var source = sourceResult.Item;
|
||||
var target = targetResult.Item;
|
||||
|
||||
if (source is null)
|
||||
{
|
||||
throw new ArgumentException("Item cannot be null.", nameof(sourceResult));
|
||||
}
|
||||
|
||||
if (target is null)
|
||||
{
|
||||
throw new ArgumentException("Item cannot be null.", nameof(targetResult));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(sourceResult);
|
||||
ArgumentNullException.ThrowIfNull(targetResult);
|
||||
|
||||
if (!lockedFields.Contains(MetadataField.Name))
|
||||
{
|
||||
|
||||
@@ -365,10 +365,7 @@ namespace MediaBrowser.Providers.Plugins.Omdb
|
||||
|
||||
internal string GetDataFilePath(string imdbId)
|
||||
{
|
||||
if (string.IsNullOrEmpty(imdbId))
|
||||
{
|
||||
throw new ArgumentNullException(nameof(imdbId));
|
||||
}
|
||||
ArgumentException.ThrowIfNullOrEmpty(imdbId);
|
||||
|
||||
var dataPath = Path.Combine(_configurationManager.ApplicationPaths.CachePath, "omdb");
|
||||
|
||||
@@ -379,10 +376,7 @@ namespace MediaBrowser.Providers.Plugins.Omdb
|
||||
|
||||
internal string GetSeasonFilePath(string imdbId, int seasonId)
|
||||
{
|
||||
if (string.IsNullOrEmpty(imdbId))
|
||||
{
|
||||
throw new ArgumentNullException(nameof(imdbId));
|
||||
}
|
||||
ArgumentException.ThrowIfNullOrEmpty(imdbId);
|
||||
|
||||
var dataPath = Path.Combine(_configurationManager.ApplicationPaths.CachePath, "omdb");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user