mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-09 03:04:24 -04:00
applied review comments
This commit is contained in:
parent
96e4d8ca78
commit
2f306358c0
@ -1,7 +1,8 @@
|
||||
#pragma warning disable RS0030 // Do not use banned APIs
|
||||
|
||||
using System;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
@ -17,7 +18,6 @@ using MediaBrowser.Model.Entities;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using AudioBook = MediaBrowser.Controller.Entities.AudioBook;
|
||||
using Book = MediaBrowser.Controller.Entities.Book;
|
||||
#pragma warning disable RS0030 // Do not use banned APIs
|
||||
|
||||
namespace Emby.Server.Implementations.Library
|
||||
{
|
||||
@ -100,7 +100,7 @@ namespace Emby.Server.Implementations.Library
|
||||
ArgumentNullException.ThrowIfNull(item);
|
||||
ArgumentNullException.ThrowIfNull(userDataDto);
|
||||
|
||||
var userData = GetUserData(user, item) ?? throw new InvalidOperationException("Did not expect UserData to be null.");
|
||||
var userData = GetUserData(user, item) ?? throw new InvalidOperationException("UserData should not be null.");
|
||||
|
||||
if (userDataDto.PlaybackPositionTicks.HasValue)
|
||||
{
|
||||
|
@ -1,11 +1,10 @@
|
||||
#pragma warning disable CA1027 // Mark enums with FlagsAttribute
|
||||
namespace Jellyfin.Data.Entities;
|
||||
|
||||
/// <summary>
|
||||
/// Provides the Value types for an <see cref="ItemValue"/>.
|
||||
/// </summary>
|
||||
#pragma warning disable CA1027 // Mark enums with FlagsAttribute
|
||||
public enum ItemValueType
|
||||
#pragma warning restore CA1027 // Mark enums with FlagsAttribute
|
||||
{
|
||||
/// <summary>
|
||||
/// Artists.
|
||||
|
@ -1,4 +1,4 @@
|
||||
#nullable disable
|
||||
#pragma warning disable CA1826 // CA1826 Do not use Enumerable methods on Indexable collections.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@ -80,12 +80,11 @@ namespace MediaBrowser.Providers.MediaInfo
|
||||
|
||||
if (!File.Exists(path))
|
||||
{
|
||||
Directory.CreateDirectory(Path.GetDirectoryName(path));
|
||||
#pragma warning disable CA1826
|
||||
var directoryName = Path.GetDirectoryName(path) ?? throw new InvalidOperationException($"Invalid path '{path}'");
|
||||
Directory.CreateDirectory(directoryName);
|
||||
var imageStream = imageStreams.FirstOrDefault(i => (i.Comment ?? string.Empty).Contains("front", StringComparison.OrdinalIgnoreCase)) ??
|
||||
imageStreams.FirstOrDefault(i => (i.Comment ?? string.Empty).Contains("cover", StringComparison.OrdinalIgnoreCase)) ??
|
||||
imageStreams.FirstOrDefault();
|
||||
#pragma warning restore CA1826
|
||||
var imageStreamIndex = imageStream?.Index;
|
||||
|
||||
var tempFile = await _mediaEncoder.ExtractAudioImage(item.Path, imageStreamIndex, cancellationToken).ConfigureAwait(false);
|
||||
|
@ -1,3 +1,5 @@
|
||||
#pragma warning disable CA1826 // CA1826 Do not use Enumerable methods on Indexable collections.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@ -88,7 +90,6 @@ namespace MediaBrowser.Providers.MediaInfo
|
||||
: TimeSpan.FromSeconds(10);
|
||||
|
||||
var query = new MediaStreamQuery { ItemId = item.Id, Index = item.DefaultVideoStreamIndex };
|
||||
#pragma warning disable CA1826
|
||||
var videoStream = _mediaSourceManager.GetMediaStreams(query).FirstOrDefault();
|
||||
if (videoStream is null)
|
||||
{
|
||||
@ -96,7 +97,6 @@ namespace MediaBrowser.Providers.MediaInfo
|
||||
query.Index = null;
|
||||
videoStream = _mediaSourceManager.GetMediaStreams(query).FirstOrDefault();
|
||||
}
|
||||
#pragma warning restore CA1826
|
||||
if (videoStream is null)
|
||||
{
|
||||
_logger.LogInformation("Skipping image extraction: no video stream found for {Path}.", item.Path ?? string.Empty);
|
||||
|
Loading…
x
Reference in New Issue
Block a user