Address comments

This commit is contained in:
Bond_009 2020-04-01 19:05:41 +02:00
parent 787049f35f
commit 3ab50f5a3f
33 changed files with 13 additions and 44 deletions

View file

@ -1,6 +1,5 @@
#pragma warning disable CS1591
#pragma warning disable SA1402
#pragma warning disable SA1600
#pragma warning disable SA1649
using System;

View file

@ -1,5 +1,4 @@
#pragma warning disable CS1591
#pragma warning disable SA1600
using System;
using System.Collections.Generic;

View file

@ -1,5 +1,4 @@
#pragma warning disable CS1591
#pragma warning disable SA1600
using System.Collections.Generic;
using MediaBrowser.Common.Configuration;

View file

@ -1,5 +1,4 @@
#pragma warning disable CS1591
#pragma warning disable SA1600
using System;
using System.IO;

View file

@ -1,5 +1,4 @@
#pragma warning disable CS1591
#pragma warning disable SA1600
using System;
using System.Collections.Generic;

View file

@ -1,5 +1,4 @@
#pragma warning disable CS1591
#pragma warning disable SA1600
using System.Threading.Tasks;
using MediaBrowser.Controller.Plugins;

View file

@ -1,5 +1,4 @@
#pragma warning disable CS1591
#pragma warning disable SA1600
using System;
using System.Threading;

View file

@ -1,5 +1,4 @@
#pragma warning disable CS1591
#pragma warning disable SA1600
using System;
using System.Collections.Generic;

View file

@ -1,5 +1,4 @@
#pragma warning disable CS1591
#pragma warning disable SA1600
using System;
using System.Globalization;

View file

@ -1,5 +1,4 @@
#pragma warning disable CS1591
#pragma warning disable SA1600
using System;
using MediaBrowser.Controller.LiveTv;

View file

@ -1,5 +1,4 @@
#pragma warning disable CS1591
#pragma warning disable SA1600
using System;
using System.Collections.Concurrent;

View file

@ -1,5 +1,4 @@
#pragma warning disable CS1591
#pragma warning disable SA1600
using System;
using System.Collections.Concurrent;

View file

@ -1,5 +1,4 @@
#pragma warning disable CS1591
#pragma warning disable SA1600
using System;
using System.Collections.Generic;

View file

@ -1,5 +1,4 @@
#pragma warning disable CS1591
#pragma warning disable SA1600
using System.Collections.Generic;
using MediaBrowser.Common.Configuration;

View file

@ -1,5 +1,4 @@
#pragma warning disable CS1591
#pragma warning disable SA1600
using System;
using System.Globalization;

View file

@ -1,5 +1,4 @@
#pragma warning disable CS1591
#pragma warning disable SA1600
using System;
using System.Collections.Generic;

View file

@ -1,5 +1,4 @@
#pragma warning disable CS1591
#pragma warning disable SA1600
using System;
using System.Collections.Generic;

View file

@ -1,5 +1,4 @@
#pragma warning disable CS1591
#pragma warning disable SA1600
using System;
using System.Collections.Concurrent;

View file

@ -1,5 +1,4 @@
#pragma warning disable CS1591
#pragma warning disable SA1600
using System;
using System.Collections.Generic;

View file

@ -1,5 +1,4 @@
#pragma warning disable CS1591
#pragma warning disable SA1600
using System;
using System.Buffers;

View file

@ -1,5 +1,4 @@
#pragma warning disable CS1591
#pragma warning disable SA1600
using System;
using System.Collections.Generic;

View file

@ -1,5 +1,4 @@
#pragma warning disable CS1591
#pragma warning disable SA1600
using System;
using System.Collections.Generic;

View file

@ -1,5 +1,4 @@
#pragma warning disable CS1591
#pragma warning disable SA1600
using System;
using System.Collections.Generic;

View file

@ -1,5 +1,4 @@
#pragma warning disable CS1591
#pragma warning disable SA1600
using System;
using System.Collections.Generic;

View file

@ -1,5 +1,4 @@
#pragma warning disable CS1591
#pragma warning disable SA1600
using System;
using System.Collections.Generic;

View file

@ -155,7 +155,7 @@ namespace Emby.Server.Implementations.MediaEncoder
}
catch (IOException ex)
{
_logger.LogError(ex, "Error deleting {Path}", tempFile);
_logger.LogError(ex, "Error deleting temporary chapter image encoding file {Path}", tempFile);
}
chapter.ImagePath = path;

View file

@ -1,5 +1,4 @@
#pragma warning disable CS1591
#pragma warning disable SA1600
using System;
using System.Collections.Generic;

View file

@ -1,5 +1,4 @@
#pragma warning disable CS1591
#pragma warning disable SA1600
using System.Collections.Generic;
using System.Threading;

View file

@ -1,5 +1,4 @@
#pragma warning disable CS1591
#pragma warning disable SA1600
using System.Collections.Generic;
using System.Threading;

View file

@ -1,5 +1,4 @@
#pragma warning disable CS1591
#pragma warning disable SA1600
using System;
using System.Collections.Generic;

View file

@ -1,5 +1,4 @@
#pragma warning disable CS1591
#pragma warning disable SA1600
using System;
using System.Collections.Concurrent;
@ -976,10 +975,10 @@ namespace MediaBrowser.Providers.Manager
(_) => throw new Exception(
string.Format(
CultureInfo.InvariantCulture,
"Refresh for item {0} {1} is not in progress",
"Cannot update refresh progress of item '{0}' ({1}) because a refresh for this item is not running",
item.GetType().Name,
item.Id.ToString("N", CultureInfo.InvariantCulture))),
(_, _) => progress);
(_, __) => progress);
RefreshProgress?.Invoke(this, new GenericEventArgs<Tuple<BaseItem, double>>(new Tuple<BaseItem, double>(item, progress)));
}

View file

@ -22,7 +22,6 @@
<TargetFramework>netstandard2.1</TargetFramework>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<LangVersion>preview</LangVersion>
</PropertyGroup>
<!-- Code Analyzers-->

View file

@ -1,5 +1,4 @@
#pragma warning disable CS1591
#pragma warning disable SA1600
using System;
using System.Collections.Generic;
@ -47,9 +46,6 @@ namespace MediaBrowser.Providers.MediaInfo
private readonly ILibraryManager _libraryManager;
private readonly IMediaSourceManager _mediaSourceManager;
/// <summary>
/// The dummy chapter duration.
/// </summary>
private readonly long _dummyChapterDuration = TimeSpan.FromMinutes(5).Ticks;
public FFProbeVideoInfo(
@ -190,6 +186,7 @@ namespace MediaBrowser.Providers.MediaInfo
{
video.RunTimeTicks = mediaInfo.RunTimeTicks;
}
video.Size = mediaInfo.Size;
if (video.VideoType == VideoType.VideoFile)
@ -202,6 +199,7 @@ namespace MediaBrowser.Providers.MediaInfo
{
video.Container = null;
}
video.Container = mediaInfo.Container;
chapters = mediaInfo.Chapters == null ? Array.Empty<ChapterInfo>() : mediaInfo.Chapters;
@ -246,7 +244,7 @@ namespace MediaBrowser.Providers.MediaInfo
{
if (chapters.Length == 0 && mediaStreams.Any(i => i.Type == MediaStreamType.Video))
{
CreateDummyChapters(video, ref chapters);
chapters = CreateDummyChapters(video);
}
NormalizeChapterNames(chapters);
@ -563,11 +561,11 @@ namespace MediaBrowser.Providers.MediaInfo
}
/// <summary>
/// Adds the dummy chapters.
/// Creates dummy chapters.
/// </summary>
/// <param name="video">The video.</param>
/// <param name="chapters">The chapters.</param>
private void CreateDummyChapters(Video video, ref ChapterInfo[] chapters)
/// <return>An array of dummy chapters.</returns>
private ChapterInfo[] CreateDummyChapters(Video video)
{
var runtime = video.RunTimeTicks ?? 0;
@ -583,12 +581,12 @@ namespace MediaBrowser.Providers.MediaInfo
if (runtime < _dummyChapterDuration)
{
return;
return Array.Empty<ChapterInfo>();
}
// Limit to 100 chapters just in case there's some incorrect metadata here
int chapterCount = (int)Math.Min(runtime / _dummyChapterDuration, 100);
chapters = new ChapterInfo[chapterCount];
var chapters = new ChapterInfo[chapterCount];
long currentChapterTicks = 0;
for (int i = 0; i < chapterCount; i++)
@ -600,6 +598,8 @@ namespace MediaBrowser.Providers.MediaInfo
currentChapterTicks += _dummyChapterDuration;
}
return chapters;
}
private string[] FetchFromDvdLib(Video item)