use correct namespace

This commit is contained in:
Kilian von Pflugk 2024-08-31 18:56:48 +02:00
parent 88003edb21
commit 25fd56d83c
40 changed files with 63 additions and 33 deletions

View File

@ -6,6 +6,8 @@ using System;
using System.Collections.Generic;
using Xunit;
using Microsoft.Extensions.Logging;
using ConfusedPolarBear.Plugin.IntroSkipper.Analyzers;
using ConfusedPolarBear.Plugin.IntroSkipper.Data;
namespace ConfusedPolarBear.Plugin.IntroSkipper.Tests;

View File

@ -2,6 +2,8 @@ namespace ConfusedPolarBear.Plugin.IntroSkipper.Tests;
using System;
using System.Collections.Generic;
using ConfusedPolarBear.Plugin.IntroSkipper.Analyzers;
using ConfusedPolarBear.Plugin.IntroSkipper.Data;
using Microsoft.Extensions.Logging;
using Xunit;

View File

@ -3,6 +3,8 @@ namespace ConfusedPolarBear.Plugin.IntroSkipper.Tests;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using ConfusedPolarBear.Plugin.IntroSkipper.Analyzers;
using ConfusedPolarBear.Plugin.IntroSkipper.Data;
using MediaBrowser.Model.Entities;
using Microsoft.Extensions.Logging;
using Xunit;

View File

@ -1,3 +1,4 @@
using ConfusedPolarBear.Plugin.IntroSkipper.Data;
using Xunit;
namespace ConfusedPolarBear.Plugin.IntroSkipper.Tests;

View File

@ -1,4 +1,5 @@
using System;
using ConfusedPolarBear.Plugin.IntroSkipper.Data;
using Xunit;
namespace ConfusedPolarBear.Plugin.IntroSkipper.Tests;

View File

@ -1,5 +1,6 @@
namespace ConfusedPolarBear.Plugin.IntroSkipper.Tests;
using ConfusedPolarBear.Plugin.IntroSkipper.Data;
using Xunit;
public class TestFlags

View File

@ -4,9 +4,10 @@ using System.Collections.ObjectModel;
using System.Linq;
using System.Threading;
using ConfusedPolarBear.Plugin.IntroSkipper.Configuration;
using ConfusedPolarBear.Plugin.IntroSkipper.Data;
using Microsoft.Extensions.Logging;
namespace ConfusedPolarBear.Plugin.IntroSkipper;
namespace ConfusedPolarBear.Plugin.IntroSkipper.Analyzers;
/// <summary>
/// Media file analyzer used to detect end credits that consist of text overlaid on a black background.
@ -30,7 +31,7 @@ public class BlackFrameAnalyzer : IMediaFileAnalyzer
/// <param name="logger">Logger.</param>
public BlackFrameAnalyzer(ILogger<BlackFrameAnalyzer> logger)
{
var config = Plugin.Instance?.Configuration ?? new Configuration.PluginConfiguration();
var config = Plugin.Instance?.Configuration ?? new PluginConfiguration();
minimumCreditsDuration = config.MinimumCreditsDuration;
maximumCreditsDuration = 2 * config.MaximumCreditsDuration;
blackFrameMinimumPercentage = config.BlackFrameMinimumPercentage;

View File

@ -6,10 +6,11 @@ using System.Linq;
using System.Text.RegularExpressions;
using System.Threading;
using ConfusedPolarBear.Plugin.IntroSkipper.Configuration;
using ConfusedPolarBear.Plugin.IntroSkipper.Data;
using MediaBrowser.Model.Entities;
using Microsoft.Extensions.Logging;
namespace ConfusedPolarBear.Plugin.IntroSkipper;
namespace ConfusedPolarBear.Plugin.IntroSkipper.Analyzers;
/// <summary>
/// Chapter name analyzer.

View File

@ -6,9 +6,10 @@ using System.Linq;
using System.Numerics;
using System.Threading;
using ConfusedPolarBear.Plugin.IntroSkipper.Configuration;
using ConfusedPolarBear.Plugin.IntroSkipper.Data;
using Microsoft.Extensions.Logging;
namespace ConfusedPolarBear.Plugin.IntroSkipper;
namespace ConfusedPolarBear.Plugin.IntroSkipper.Analyzers;
/// <summary>
/// Chromaprint audio analyzer.
@ -69,7 +70,7 @@ public class ChromaprintAnalyzer : IMediaFileAnalyzer
// Episodes that were analyzed and do not have an introduction.
var episodesWithoutIntros = episodeAnalysisQueue.Where(e => !e.State.IsAnalyzed(mode)).ToList();
this._analysisMode = mode;
_analysisMode = mode;
if (episodesWithoutIntros.Count == 0 || episodeAnalysisQueue.Count <= 1)
{
@ -142,7 +143,7 @@ public class ChromaprintAnalyzer : IMediaFileAnalyzer
// - the introduction exceeds the configured limit
if (
!remainingIntro.Valid ||
(this._analysisMode == AnalysisMode.Introduction && remainingIntro.Duration > Plugin.Instance!.Configuration.MaximumIntroDuration))
(_analysisMode == AnalysisMode.Introduction && remainingIntro.Duration > Plugin.Instance!.Configuration.MaximumIntroDuration))
{
continue;
}
@ -156,7 +157,7 @@ public class ChromaprintAnalyzer : IMediaFileAnalyzer
* To fix this, the starting and ending times need to be switched, as they were previously reversed
* and subtracted from the episode duration to get the reported time range.
*/
if (this._analysisMode == AnalysisMode.Credits)
if (_analysisMode == AnalysisMode.Credits)
{
// Calculate new values for the current intro
double currentOriginalIntroStart = currentIntro.IntroStart;
@ -203,13 +204,13 @@ public class ChromaprintAnalyzer : IMediaFileAnalyzer
return analysisQueue;
}
if (this._analysisMode == AnalysisMode.Introduction)
if (_analysisMode == AnalysisMode.Introduction)
{
// Adjust all introduction end times so that they end at silence.
seasonIntros = AdjustIntroEndTimes(analysisQueue, seasonIntros);
}
Plugin.Instance!.UpdateTimestamps(seasonIntros, this._analysisMode);
Plugin.Instance!.UpdateTimestamps(seasonIntros, _analysisMode);
return episodeAnalysisQueue.AsReadOnly();
}
@ -301,8 +302,8 @@ public class ChromaprintAnalyzer : IMediaFileAnalyzer
var rhsRanges = new List<TimeRange>();
// Generate inverted indexes for the left and right episodes.
var lhsIndex = FFmpegWrapper.CreateInvertedIndex(lhsId, lhsPoints, this._analysisMode);
var rhsIndex = FFmpegWrapper.CreateInvertedIndex(rhsId, rhsPoints, this._analysisMode);
var lhsIndex = FFmpegWrapper.CreateInvertedIndex(lhsId, lhsPoints, _analysisMode);
var rhsIndex = FFmpegWrapper.CreateInvertedIndex(rhsId, rhsPoints, _analysisMode);
var indexShifts = new HashSet<int>();
// For all audio points in the left episode, check if the right episode has a point which matches exactly.
@ -402,7 +403,7 @@ public class ChromaprintAnalyzer : IMediaFileAnalyzer
// Since LHS had a contiguous time range, RHS must have one also.
var rContiguous = TimeRangeHelpers.FindContiguous(rhsTimes.ToArray(), maximumTimeSkip)!;
if (this._analysisMode == AnalysisMode.Introduction)
if (_analysisMode == AnalysisMode.Introduction)
{
// Tweak the end timestamps just a bit to ensure as little content as possible is skipped over.
// TODO: remove this

View File

@ -1,7 +1,8 @@
using System.Collections.ObjectModel;
using System.Threading;
using ConfusedPolarBear.Plugin.IntroSkipper.Data;
namespace ConfusedPolarBear.Plugin.IntroSkipper;
namespace ConfusedPolarBear.Plugin.IntroSkipper.Analyzers;
/// <summary>
/// Media file analyzer interface.

View File

@ -1,8 +1,9 @@
using System.Collections.ObjectModel;
using System.Threading;
using ConfusedPolarBear.Plugin.IntroSkipper.Data;
using Microsoft.Extensions.Logging;
namespace ConfusedPolarBear.Plugin.IntroSkipper;
namespace ConfusedPolarBear.Plugin.IntroSkipper.Analyzers;
/// <summary>
/// Chapter name analyzer.

View File

@ -4,6 +4,7 @@ using System.Threading;
using System.Threading.Tasks;
using System.Timers;
using ConfusedPolarBear.Plugin.IntroSkipper.Configuration;
using ConfusedPolarBear.Plugin.IntroSkipper.Data;
using MediaBrowser.Common.Extensions;
using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.Session;

View File

@ -4,6 +4,7 @@ using System.Threading;
using System.Threading.Tasks;
using System.Timers;
using ConfusedPolarBear.Plugin.IntroSkipper.Configuration;
using ConfusedPolarBear.Plugin.IntroSkipper.Data;
using MediaBrowser.Common.Extensions;
using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.Session;

View File

@ -1,5 +1,6 @@
using System.Collections.Generic;
using System.Diagnostics;
using ConfusedPolarBear.Plugin.IntroSkipper.Data;
using MediaBrowser.Model.Plugins;
namespace ConfusedPolarBear.Plugin.IntroSkipper.Configuration;

View File

@ -3,6 +3,7 @@ using System.Globalization;
using System.IO;
using System.Net.Mime;
using System.Text;
using ConfusedPolarBear.Plugin.IntroSkipper.Data;
using MediaBrowser.Common;
using MediaBrowser.Common.Api;
using MediaBrowser.Controller.Library;

View File

@ -1,4 +1,4 @@
namespace ConfusedPolarBear.Plugin.IntroSkipper;
namespace ConfusedPolarBear.Plugin.IntroSkipper.Data;
/// <summary>
/// Type of media file analysis to perform.

View File

@ -1,4 +1,4 @@
namespace ConfusedPolarBear.Plugin.IntroSkipper;
namespace ConfusedPolarBear.Plugin.IntroSkipper.Data;
/// <summary>
/// A frame of video that partially (or entirely) consists of black pixels.

View File

@ -1,4 +1,4 @@
namespace ConfusedPolarBear.Plugin.IntroSkipper;
namespace ConfusedPolarBear.Plugin.IntroSkipper.Data;
/// <summary>
/// Taken from https://kodi.wiki/view/Edit_decision_list#MPlayer_EDL.

View File

@ -1,6 +1,6 @@
using System;
namespace ConfusedPolarBear.Plugin.IntroSkipper;
namespace ConfusedPolarBear.Plugin.IntroSkipper.Data;
/// <summary>
/// Represents the state of an episode regarding analysis and blacklist status.

View File

@ -1,6 +1,6 @@
using System;
namespace ConfusedPolarBear.Plugin.IntroSkipper;
namespace ConfusedPolarBear.Plugin.IntroSkipper.Data;
/// <summary>
/// Episode name and internal ID as returned by the visualization controller.

View File

@ -1,6 +1,6 @@
using System;
namespace ConfusedPolarBear.Plugin.IntroSkipper;
namespace ConfusedPolarBear.Plugin.IntroSkipper.Data;
/// <summary>
/// Exception raised when an error is encountered analyzing audio.

View File

@ -2,7 +2,7 @@ using System;
using System.Globalization;
using System.Text.Json.Serialization;
namespace ConfusedPolarBear.Plugin.IntroSkipper;
namespace ConfusedPolarBear.Plugin.IntroSkipper.Data;
/// <summary>
/// Result of fingerprinting and analyzing two episodes in a season.

View File

@ -1,4 +1,4 @@
namespace ConfusedPolarBear.Plugin.IntroSkipper;
namespace ConfusedPolarBear.Plugin.IntroSkipper.Data;
/// <summary>
/// An Intro class with episode metadata. Only used in end to end testing programs.

View File

@ -1,6 +1,6 @@
using System;
namespace ConfusedPolarBear.Plugin.IntroSkipper;
namespace ConfusedPolarBear.Plugin.IntroSkipper.Data;
/// <summary>
/// Support bundle warning.

View File

@ -1,6 +1,6 @@
using System;
namespace ConfusedPolarBear.Plugin.IntroSkipper;
namespace ConfusedPolarBear.Plugin.IntroSkipper.Data;
/// <summary>
/// Episode queued for analysis.

View File

@ -1,6 +1,6 @@
using System;
namespace ConfusedPolarBear.Plugin.IntroSkipper;
namespace ConfusedPolarBear.Plugin.IntroSkipper.Data;
#pragma warning disable CA1036 // Override methods on comparable types

View File

@ -1,7 +1,7 @@
using System;
using System.Collections.Generic;
namespace ConfusedPolarBear.Plugin.IntroSkipper;
namespace ConfusedPolarBear.Plugin.IntroSkipper.Data;
#pragma warning restore CA1036
/// <summary>

View File

@ -1,4 +1,4 @@
namespace ConfusedPolarBear.Plugin.IntroSkipper;
namespace ConfusedPolarBear.Plugin.IntroSkipper.Data;
/// <summary>
/// Warning manager.

View File

@ -1,6 +1,7 @@
using System;
using System.Collections.ObjectModel;
using System.IO;
using ConfusedPolarBear.Plugin.IntroSkipper.Data;
using Microsoft.Extensions.Logging;
namespace ConfusedPolarBear.Plugin.IntroSkipper;

View File

@ -3,6 +3,8 @@ using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Threading;
using System.Threading.Tasks;
using ConfusedPolarBear.Plugin.IntroSkipper.Data;
using ConfusedPolarBear.Plugin.IntroSkipper.ScheduledTasks;
using MediaBrowser.Controller.Entities.TV;
using MediaBrowser.Controller.Library;
using MediaBrowser.Model.Entities;

View File

@ -6,6 +6,7 @@ using System.Globalization;
using System.IO;
using System.Text;
using System.Text.RegularExpressions;
using ConfusedPolarBear.Plugin.IntroSkipper.Data;
using Microsoft.Extensions.Logging;
namespace ConfusedPolarBear.Plugin.IntroSkipper;

View File

@ -4,6 +4,7 @@ using System.Collections.Generic;
using System.IO;
using System.Text.RegularExpressions;
using ConfusedPolarBear.Plugin.IntroSkipper.Configuration;
using ConfusedPolarBear.Plugin.IntroSkipper.Data;
using MediaBrowser.Common.Configuration;
using MediaBrowser.Common.Plugins;
using MediaBrowser.Controller.Configuration;

View File

@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.IO;
using System.Linq;
using ConfusedPolarBear.Plugin.IntroSkipper.Data;
using Jellyfin.Data.Enums;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Entities.TV;

View File

@ -4,10 +4,12 @@ using System.Collections.ObjectModel;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using ConfusedPolarBear.Plugin.IntroSkipper.Analyzers;
using ConfusedPolarBear.Plugin.IntroSkipper.Data;
using MediaBrowser.Controller.Library;
using Microsoft.Extensions.Logging;
namespace ConfusedPolarBear.Plugin.IntroSkipper;
namespace ConfusedPolarBear.Plugin.IntroSkipper.ScheduledTasks;
/// <summary>
/// Common code shared by all media item analyzer tasks.

View File

@ -8,7 +8,7 @@ using MediaBrowser.Controller.Library;
using MediaBrowser.Model.Tasks;
using Microsoft.Extensions.Logging;
namespace ConfusedPolarBear.Plugin.IntroSkipper;
namespace ConfusedPolarBear.Plugin.IntroSkipper.ScheduledTasks;
/// <summary>
/// Analyze all television episodes for introduction sequences.

View File

@ -3,11 +3,12 @@ using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Threading;
using System.Threading.Tasks;
using ConfusedPolarBear.Plugin.IntroSkipper.Data;
using MediaBrowser.Controller.Library;
using MediaBrowser.Model.Tasks;
using Microsoft.Extensions.Logging;
namespace ConfusedPolarBear.Plugin.IntroSkipper;
namespace ConfusedPolarBear.Plugin.IntroSkipper.ScheduledTasks;
/// <summary>
/// Analyze all television episodes for credits.

View File

@ -3,11 +3,12 @@ using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Threading;
using System.Threading.Tasks;
using ConfusedPolarBear.Plugin.IntroSkipper.Data;
using MediaBrowser.Controller.Library;
using MediaBrowser.Model.Tasks;
using Microsoft.Extensions.Logging;
namespace ConfusedPolarBear.Plugin.IntroSkipper;
namespace ConfusedPolarBear.Plugin.IntroSkipper.ScheduledTasks;
/// <summary>
/// Analyze all television episodes for introduction sequences.

View File

@ -3,11 +3,12 @@ using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Threading;
using System.Threading.Tasks;
using ConfusedPolarBear.Plugin.IntroSkipper.Data;
using MediaBrowser.Controller.Library;
using MediaBrowser.Model.Tasks;
using Microsoft.Extensions.Logging;
namespace ConfusedPolarBear.Plugin.IntroSkipper;
namespace ConfusedPolarBear.Plugin.IntroSkipper.ScheduledTasks;
/// <summary>
/// Analyze all television episodes for introduction sequences.

View File

@ -1,7 +1,7 @@
using System;
using System.Threading;
namespace ConfusedPolarBear.Plugin.IntroSkipper;
namespace ConfusedPolarBear.Plugin.IntroSkipper.ScheduledTasks;
internal sealed class ScheduledTaskSemaphore : IDisposable
{

View File

@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.IO;
using System.Runtime.Serialization;
using System.Xml;
using ConfusedPolarBear.Plugin.IntroSkipper.Data;
namespace ConfusedPolarBear.Plugin.IntroSkipper
{