remove external dependencies (bugsnag, trakt) (#2840)
* remove bugsnag * remove trakt client id (that will expire)
This commit is contained in:
@@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file.
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
||||
|
||||
## [Unreleased]
|
||||
### Changed
|
||||
- Remove BugSnag error reporting integration
|
||||
- Remove developer's personal Trakt API key
|
||||
- Users who want to continue to use Trakt must create an API app and set the `Client ID` as the environment variable `TRAKT__CLIENTID`
|
||||
|
||||
### Fixed
|
||||
- Support adding trakt lists using `app.trakt.tv` domain (instead of just `trakt.tv`)
|
||||
|
||||
## [26.3.0] - 2026-02-24
|
||||
### Added
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Bugsnag" Version="4.1.0" />
|
||||
<PackageReference Include="CliWrap" Version="3.10.0" />
|
||||
<PackageReference Include="Humanizer.Core" Version="3.0.1" />
|
||||
<PackageReference Include="MediatR" Version="[12.5.0]" />
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using Bugsnag;
|
||||
using ErsatzTV.Core;
|
||||
using ErsatzTV.Core;
|
||||
using ErsatzTV.Core.Interfaces.Repositories;
|
||||
using ErsatzTV.Core.Interfaces.Search;
|
||||
using ErsatzTV.Core.Search;
|
||||
@@ -8,16 +7,13 @@ namespace ErsatzTV.Application.Maintenance;
|
||||
|
||||
public class EmptyTrashHandler : IRequestHandler<EmptyTrash, Either<BaseError, Unit>>
|
||||
{
|
||||
private readonly IClient _client;
|
||||
private readonly IMediaItemRepository _mediaItemRepository;
|
||||
private readonly ISearchIndex _searchIndex;
|
||||
|
||||
public EmptyTrashHandler(
|
||||
IClient client,
|
||||
IMediaItemRepository mediaItemRepository,
|
||||
ISearchIndex searchIndex)
|
||||
{
|
||||
_client = client;
|
||||
_mediaItemRepository = mediaItemRepository;
|
||||
_searchIndex = searchIndex;
|
||||
}
|
||||
@@ -27,7 +23,6 @@ public class EmptyTrashHandler : IRequestHandler<EmptyTrash, Either<BaseError, U
|
||||
CancellationToken cancellationToken)
|
||||
{
|
||||
SearchResult result = await _searchIndex.Search(
|
||||
_client,
|
||||
"state:FileNotFound",
|
||||
string.Empty,
|
||||
0,
|
||||
|
||||
@@ -110,10 +110,10 @@ public partial class AddTraktListHandler : TraktCommandBase, IRequestHandler<Add
|
||||
return maybeList.Map(_ => Unit.Default);
|
||||
}
|
||||
|
||||
[GeneratedRegex(@"https:\/\/trakt\.tv\/users\/([\w\-_]+)\/(?:lists\/)?([\w\-_]+)")]
|
||||
[GeneratedRegex(@"https:\/\/(?:app\.)?trakt\.tv\/users\/([\w\-_]+)\/(?:lists\/)?([\w\-_]+)")]
|
||||
private static partial Regex UriTraktListRegex();
|
||||
|
||||
[GeneratedRegex(@"https:\/\/trakt\.tv\/lists\/([\w\-_]+)\/([\w\-_]+)")]
|
||||
[GeneratedRegex(@"https:\/\/(?:app\.)?trakt\.tv\/lists\/([\w\-_]+)\/([\w\-_]+)")]
|
||||
private static partial Regex UriTraktListRegex2();
|
||||
|
||||
[GeneratedRegex(@"([\w\-_]+)\/(?:lists\/)?([\w\-_]+)")]
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System.Threading.Channels;
|
||||
using Bugsnag;
|
||||
using EFCore.BulkExtensions;
|
||||
using ErsatzTV.Application.Channels;
|
||||
using ErsatzTV.Application.Subtitles;
|
||||
@@ -22,7 +21,6 @@ public class BuildPlayoutHandler : IRequestHandler<BuildPlayout, Either<BaseErro
|
||||
{
|
||||
private readonly IBlockPlayoutBuilder _blockPlayoutBuilder;
|
||||
private readonly IBlockPlayoutFillerBuilder _blockPlayoutFillerBuilder;
|
||||
private readonly IClient _client;
|
||||
private readonly IDbContextFactory<TvContext> _dbContextFactory;
|
||||
private readonly IEntityLocker _entityLocker;
|
||||
private readonly IExternalJsonPlayoutBuilder _externalJsonPlayoutBuilder;
|
||||
@@ -35,7 +33,6 @@ public class BuildPlayoutHandler : IRequestHandler<BuildPlayout, Either<BaseErro
|
||||
private readonly IScriptedPlayoutBuilder _scriptedPlayoutBuilder;
|
||||
|
||||
public BuildPlayoutHandler(
|
||||
IClient client,
|
||||
IDbContextFactory<TvContext> dbContextFactory,
|
||||
IPlayoutBuilder playoutBuilder,
|
||||
IBlockPlayoutBuilder blockPlayoutBuilder,
|
||||
@@ -49,7 +46,6 @@ public class BuildPlayoutHandler : IRequestHandler<BuildPlayout, Either<BaseErro
|
||||
ChannelWriter<IBackgroundServiceRequest> workerChannel,
|
||||
ILogger<BuildPlayoutHandler> logger)
|
||||
{
|
||||
_client = client;
|
||||
_dbContextFactory = dbContextFactory;
|
||||
_playoutBuilder = playoutBuilder;
|
||||
_blockPlayoutBuilder = blockPlayoutBuilder;
|
||||
@@ -348,7 +344,6 @@ public class BuildPlayoutHandler : IRequestHandler<BuildPlayout, Either<BaseErro
|
||||
newBuildStatus.Success = false;
|
||||
newBuildStatus.Message = $"Timeout building playout for channel {channelName}";
|
||||
|
||||
_client.Notify(ex);
|
||||
return BaseError.New(
|
||||
$"Timeout building playout for channel {channelName}; this may be a bug!");
|
||||
}
|
||||
@@ -359,7 +354,6 @@ public class BuildPlayoutHandler : IRequestHandler<BuildPlayout, Either<BaseErro
|
||||
newBuildStatus.Success = false;
|
||||
newBuildStatus.Message = $"Unexpected error building playout for channel {channelName}: {ex}";
|
||||
|
||||
_client.Notify(ex);
|
||||
return BaseError.New(
|
||||
$"Unexpected error building playout for channel {channelName}: {ex.Message}");
|
||||
}
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
using Bugsnag;
|
||||
using ErsatzTV.Core.Interfaces.Search;
|
||||
using ErsatzTV.Core.Interfaces.Search;
|
||||
using ErsatzTV.Infrastructure.Search;
|
||||
|
||||
namespace ErsatzTV.Application.Search;
|
||||
|
||||
public class QuerySearchIndexAllItemsHandler(IClient client, ISearchIndex searchIndex)
|
||||
public class QuerySearchIndexAllItemsHandler(ISearchIndex searchIndex)
|
||||
: IRequestHandler<QuerySearchIndexAllItems, SearchResultAllItemsViewModel>
|
||||
{
|
||||
public async Task<SearchResultAllItemsViewModel> Handle(
|
||||
@@ -23,7 +22,7 @@ public class QuerySearchIndexAllItemsHandler(IClient client, ISearchIndex search
|
||||
await GetIds(LuceneSearchIndex.RemoteStreamType, request.Query, cancellationToken));
|
||||
|
||||
private async Task<List<int>> GetIds(string type, string query, CancellationToken cancellationToken) =>
|
||||
(await searchIndex.Search(client, $"type:{type} AND ({query})", string.Empty, 0, 0, cancellationToken)).Items
|
||||
(await searchIndex.Search($"type:{type} AND ({query})", string.Empty, 0, 0, cancellationToken)).Items
|
||||
.Map(i => i.Id)
|
||||
.ToList();
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using Bugsnag;
|
||||
using ErsatzTV.Application.MediaCards;
|
||||
using ErsatzTV.Application.MediaCards;
|
||||
using ErsatzTV.Core.Interfaces.Search;
|
||||
using ErsatzTV.Core.Search;
|
||||
using ErsatzTV.Infrastructure.Data;
|
||||
@@ -9,7 +8,6 @@ using static ErsatzTV.Application.MediaCards.Mapper;
|
||||
namespace ErsatzTV.Application.Search;
|
||||
|
||||
public class QuerySearchIndexArtistsHandler(
|
||||
IClient client,
|
||||
ISearchIndex searchIndex,
|
||||
IDbContextFactory<TvContext> dbContextFactory)
|
||||
: IRequestHandler<QuerySearchIndexArtists, ArtistCardResultsViewModel>
|
||||
@@ -19,7 +17,6 @@ public class QuerySearchIndexArtistsHandler(
|
||||
CancellationToken cancellationToken)
|
||||
{
|
||||
SearchResult searchResult = await searchIndex.Search(
|
||||
client,
|
||||
request.Query,
|
||||
string.Empty,
|
||||
(request.PageNumber - 1) * request.PageSize,
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using Bugsnag;
|
||||
using ErsatzTV.Application.MediaCards;
|
||||
using ErsatzTV.Application.MediaCards;
|
||||
using ErsatzTV.Core.Domain;
|
||||
using ErsatzTV.Core.Extensions;
|
||||
using ErsatzTV.Core.Interfaces.Emby;
|
||||
@@ -17,7 +16,6 @@ namespace ErsatzTV.Application.Search;
|
||||
|
||||
public class
|
||||
QuerySearchIndexEpisodesHandler(
|
||||
IClient client,
|
||||
ISearchIndex searchIndex,
|
||||
IPlexPathReplacementService plexPathReplacementService,
|
||||
IJellyfinPathReplacementService jellyfinPathReplacementService,
|
||||
@@ -31,7 +29,6 @@ public class
|
||||
CancellationToken cancellationToken)
|
||||
{
|
||||
SearchResult searchResult = await searchIndex.Search(
|
||||
client,
|
||||
request.Query,
|
||||
string.Empty,
|
||||
(request.PageNumber - 1) * request.PageSize,
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using Bugsnag;
|
||||
using ErsatzTV.Application.MediaCards;
|
||||
using ErsatzTV.Application.MediaCards;
|
||||
using ErsatzTV.Core.Interfaces.Search;
|
||||
using ErsatzTV.Core.Search;
|
||||
using ErsatzTV.Infrastructure.Data;
|
||||
@@ -9,7 +8,6 @@ using static ErsatzTV.Application.MediaCards.Mapper;
|
||||
namespace ErsatzTV.Application.Search;
|
||||
|
||||
public class QuerySearchIndexImagesHandler(
|
||||
IClient client,
|
||||
ISearchIndex searchIndex,
|
||||
IDbContextFactory<TvContext> dbContextFactory)
|
||||
: IRequestHandler<QuerySearchIndexImages, ImageCardResultsViewModel>
|
||||
@@ -19,7 +17,6 @@ public class QuerySearchIndexImagesHandler(
|
||||
CancellationToken cancellationToken)
|
||||
{
|
||||
SearchResult searchResult = await searchIndex.Search(
|
||||
client,
|
||||
request.Query,
|
||||
string.Empty,
|
||||
(request.PageNumber - 1) * request.PageSize,
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using Bugsnag;
|
||||
using ErsatzTV.Application.MediaCards;
|
||||
using ErsatzTV.Application.MediaCards;
|
||||
using ErsatzTV.Core.Domain;
|
||||
using ErsatzTV.Core.Interfaces.Search;
|
||||
using ErsatzTV.Core.Search;
|
||||
@@ -10,7 +9,6 @@ using static ErsatzTV.Application.MediaCards.Mapper;
|
||||
namespace ErsatzTV.Application.Search;
|
||||
|
||||
public class QuerySearchIndexMoviesHandler(
|
||||
IClient client,
|
||||
ISearchIndex searchIndex,
|
||||
IDbContextFactory<TvContext> dbContextFactory)
|
||||
: QuerySearchIndexHandlerBase, IRequestHandler<QuerySearchIndexMovies, MovieCardResultsViewModel>
|
||||
@@ -20,7 +18,6 @@ public class QuerySearchIndexMoviesHandler(
|
||||
CancellationToken cancellationToken)
|
||||
{
|
||||
SearchResult searchResult = await searchIndex.Search(
|
||||
client,
|
||||
request.Query,
|
||||
string.Empty,
|
||||
(request.PageNumber - 1) * request.PageSize,
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using Bugsnag;
|
||||
using ErsatzTV.Application.MediaCards;
|
||||
using ErsatzTV.Application.MediaCards;
|
||||
using ErsatzTV.Core.Domain;
|
||||
using ErsatzTV.Core.Extensions;
|
||||
using ErsatzTV.Core.Interfaces.Emby;
|
||||
@@ -15,7 +14,6 @@ namespace ErsatzTV.Application.Search;
|
||||
|
||||
public class
|
||||
QuerySearchIndexMusicVideosHandler(
|
||||
IClient client,
|
||||
ISearchIndex searchIndex,
|
||||
IPlexPathReplacementService plexPathReplacementService,
|
||||
IJellyfinPathReplacementService jellyfinPathReplacementService,
|
||||
@@ -28,7 +26,6 @@ public class
|
||||
CancellationToken cancellationToken)
|
||||
{
|
||||
SearchResult searchResult = await searchIndex.Search(
|
||||
client,
|
||||
request.Query,
|
||||
string.Empty,
|
||||
(request.PageNumber - 1) * request.PageSize,
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using Bugsnag;
|
||||
using ErsatzTV.Application.MediaCards;
|
||||
using ErsatzTV.Application.MediaCards;
|
||||
using ErsatzTV.Core.Interfaces.Search;
|
||||
using ErsatzTV.Core.Search;
|
||||
using ErsatzTV.Infrastructure.Data;
|
||||
@@ -10,7 +9,6 @@ namespace ErsatzTV.Application.Search;
|
||||
|
||||
public class
|
||||
QuerySearchIndexOtherVideosHandler(
|
||||
IClient client,
|
||||
ISearchIndex searchIndex,
|
||||
IDbContextFactory<TvContext> dbContextFactory)
|
||||
: IRequestHandler<QuerySearchIndexOtherVideos, OtherVideoCardResultsViewModel>
|
||||
@@ -20,7 +18,6 @@ public class
|
||||
CancellationToken cancellationToken)
|
||||
{
|
||||
SearchResult searchResult = await searchIndex.Search(
|
||||
client,
|
||||
request.Query,
|
||||
string.Empty,
|
||||
(request.PageNumber - 1) * request.PageSize,
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using Bugsnag;
|
||||
using ErsatzTV.Application.MediaCards;
|
||||
using ErsatzTV.Application.MediaCards;
|
||||
using ErsatzTV.Core.Interfaces.Search;
|
||||
using ErsatzTV.Core.Search;
|
||||
using ErsatzTV.Infrastructure.Data;
|
||||
@@ -9,7 +8,6 @@ using static ErsatzTV.Application.MediaCards.Mapper;
|
||||
namespace ErsatzTV.Application.Search;
|
||||
|
||||
public class QuerySearchIndexRemoteStreamsHandler(
|
||||
IClient client,
|
||||
ISearchIndex searchIndex,
|
||||
IDbContextFactory<TvContext> dbContextFactory)
|
||||
: IRequestHandler<QuerySearchIndexRemoteStreams, RemoteStreamCardResultsViewModel>
|
||||
@@ -19,7 +17,6 @@ public class QuerySearchIndexRemoteStreamsHandler(
|
||||
CancellationToken cancellationToken)
|
||||
{
|
||||
SearchResult searchResult = await searchIndex.Search(
|
||||
client,
|
||||
request.Query,
|
||||
string.Empty,
|
||||
(request.PageNumber - 1) * request.PageSize,
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using Bugsnag;
|
||||
using ErsatzTV.Application.MediaCards;
|
||||
using ErsatzTV.Application.MediaCards;
|
||||
using ErsatzTV.Core.Domain;
|
||||
using ErsatzTV.Core.Interfaces.Search;
|
||||
using ErsatzTV.Core.Search;
|
||||
@@ -11,7 +10,6 @@ namespace ErsatzTV.Application.Search;
|
||||
|
||||
public class
|
||||
QuerySearchIndexSeasonsHandler(
|
||||
IClient client,
|
||||
ISearchIndex searchIndex,
|
||||
IDbContextFactory<TvContext> dbContextFactory)
|
||||
: QuerySearchIndexHandlerBase, IRequestHandler<QuerySearchIndexSeasons, TelevisionSeasonCardResultsViewModel>
|
||||
@@ -21,7 +19,6 @@ public class
|
||||
CancellationToken cancellationToken)
|
||||
{
|
||||
SearchResult searchResult = await searchIndex.Search(
|
||||
client,
|
||||
request.Query,
|
||||
string.Empty,
|
||||
(request.PageNumber - 1) * request.PageSize,
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using Bugsnag;
|
||||
using ErsatzTV.Application.MediaCards;
|
||||
using ErsatzTV.Application.MediaCards;
|
||||
using ErsatzTV.Core.Domain;
|
||||
using ErsatzTV.Core.Interfaces.Search;
|
||||
using ErsatzTV.Core.Search;
|
||||
@@ -11,7 +10,6 @@ namespace ErsatzTV.Application.Search;
|
||||
|
||||
public class
|
||||
QuerySearchIndexShowsHandler(
|
||||
IClient client,
|
||||
ISearchIndex searchIndex,
|
||||
IDbContextFactory<TvContext> dbContextFactory)
|
||||
: QuerySearchIndexHandlerBase, IRequestHandler<QuerySearchIndexShows, TelevisionShowCardResultsViewModel>
|
||||
@@ -21,7 +19,6 @@ public class
|
||||
CancellationToken cancellationToken)
|
||||
{
|
||||
SearchResult searchResult = await searchIndex.Search(
|
||||
client,
|
||||
request.Query,
|
||||
string.Empty,
|
||||
(request.PageNumber - 1) * request.PageSize,
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using Bugsnag;
|
||||
using ErsatzTV.Application.MediaCards;
|
||||
using ErsatzTV.Application.MediaCards;
|
||||
using ErsatzTV.Core.Interfaces.Search;
|
||||
using ErsatzTV.Core.Search;
|
||||
using ErsatzTV.Infrastructure.Data;
|
||||
@@ -8,7 +7,7 @@ using static ErsatzTV.Application.MediaCards.Mapper;
|
||||
|
||||
namespace ErsatzTV.Application.Search;
|
||||
|
||||
public class QuerySearchIndexSongsHandler(IClient client, ISearchIndex searchIndex, IDbContextFactory<TvContext> dbContextFactory)
|
||||
public class QuerySearchIndexSongsHandler(ISearchIndex searchIndex, IDbContextFactory<TvContext> dbContextFactory)
|
||||
: IRequestHandler<QuerySearchIndexSongs, SongCardResultsViewModel>
|
||||
{
|
||||
public async Task<SongCardResultsViewModel> Handle(
|
||||
@@ -16,7 +15,6 @@ public class QuerySearchIndexSongsHandler(IClient client, ISearchIndex searchInd
|
||||
CancellationToken cancellationToken)
|
||||
{
|
||||
SearchResult searchResult = await searchIndex.Search(
|
||||
client,
|
||||
request.Query,
|
||||
string.Empty,
|
||||
(request.PageNumber - 1) * request.PageSize,
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using System.Collections.Immutable;
|
||||
using System.Globalization;
|
||||
using Bugsnag;
|
||||
using ErsatzTV.Application.MediaItems;
|
||||
using ErsatzTV.Core.Domain;
|
||||
using ErsatzTV.Core.Interfaces.Search;
|
||||
@@ -11,10 +10,9 @@ using Microsoft.EntityFrameworkCore;
|
||||
namespace ErsatzTV.Application.Search;
|
||||
|
||||
public class SearchMoviesHandler(
|
||||
IClient client,
|
||||
ISearchIndex searchIndex,
|
||||
IDbContextFactory<TvContext> dbContextFactory)
|
||||
: SearchUsingSearchIndexHandler(client, searchIndex), IRequestHandler<SearchMovies, List<NamedMediaItemViewModel>>
|
||||
: SearchUsingSearchIndexHandler(searchIndex), IRequestHandler<SearchMovies, List<NamedMediaItemViewModel>>
|
||||
{
|
||||
public async Task<List<NamedMediaItemViewModel>> Handle(SearchMovies request, CancellationToken cancellationToken)
|
||||
{
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using System.Collections.Immutable;
|
||||
using System.Globalization;
|
||||
using Bugsnag;
|
||||
using ErsatzTV.Application.MediaItems;
|
||||
using ErsatzTV.Core.Interfaces.Search;
|
||||
using ErsatzTV.Infrastructure.Data;
|
||||
@@ -10,10 +9,9 @@ using Microsoft.EntityFrameworkCore;
|
||||
namespace ErsatzTV.Application.Search;
|
||||
|
||||
public class SearchTelevisionSeasonsHandler(
|
||||
IClient client,
|
||||
ISearchIndex searchIndex,
|
||||
IDbContextFactory<TvContext> dbContextFactory)
|
||||
: SearchUsingSearchIndexHandler(client, searchIndex),
|
||||
: SearchUsingSearchIndexHandler(searchIndex),
|
||||
IRequestHandler<SearchTelevisionSeasons, List<NamedMediaItemViewModel>>
|
||||
{
|
||||
public async Task<List<NamedMediaItemViewModel>> Handle(
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using System.Collections.Immutable;
|
||||
using System.Globalization;
|
||||
using Bugsnag;
|
||||
using ErsatzTV.Application.MediaItems;
|
||||
using ErsatzTV.Core.Domain;
|
||||
using ErsatzTV.Core.Interfaces.Search;
|
||||
@@ -11,10 +10,9 @@ using Microsoft.EntityFrameworkCore;
|
||||
namespace ErsatzTV.Application.Search;
|
||||
|
||||
public class SearchTelevisionShowsHandler(
|
||||
IClient client,
|
||||
ISearchIndex searchIndex,
|
||||
IDbContextFactory<TvContext> dbContextFactory)
|
||||
: SearchUsingSearchIndexHandler(client, searchIndex),
|
||||
: SearchUsingSearchIndexHandler(searchIndex),
|
||||
IRequestHandler<SearchTelevisionShows, List<NamedMediaItemViewModel>>
|
||||
{
|
||||
public async Task<List<NamedMediaItemViewModel>> Handle(
|
||||
|
||||
@@ -1,18 +1,16 @@
|
||||
using System.Collections.Immutable;
|
||||
using Bugsnag;
|
||||
using ErsatzTV.Core.Interfaces.Search;
|
||||
using ErsatzTV.Infrastructure.Search;
|
||||
|
||||
namespace ErsatzTV.Application.Search;
|
||||
|
||||
public abstract class SearchUsingSearchIndexHandler(IClient client, ISearchIndex searchIndex)
|
||||
public abstract class SearchUsingSearchIndexHandler(ISearchIndex searchIndex)
|
||||
{
|
||||
private const int PageSize = 10;
|
||||
|
||||
protected async Task<ImmutableHashSet<int>> Search(string type, string query, CancellationToken cancellationToken)
|
||||
{
|
||||
var searchResult = await searchIndex.Search(
|
||||
client,
|
||||
$"type:{type} AND *{query.Replace(" ", @"\ ")}*",
|
||||
string.Empty,
|
||||
0,
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using System.IO.Abstractions;
|
||||
using System.Threading.Channels;
|
||||
using Bugsnag;
|
||||
using ErsatzTV.Application.Channels;
|
||||
using ErsatzTV.Application.Graphics;
|
||||
using ErsatzTV.Application.Maintenance;
|
||||
@@ -22,7 +21,6 @@ namespace ErsatzTV.Application.Streaming;
|
||||
|
||||
public class StartFFmpegSessionHandler : IRequestHandler<StartFFmpegSession, Either<BaseError, Unit>>
|
||||
{
|
||||
private readonly IClient _client;
|
||||
private readonly IFileSystem _fileSystem;
|
||||
private readonly IConfigElementRepository _configElementRepository;
|
||||
private readonly IFFmpegSegmenterService _ffmpegSegmenterService;
|
||||
@@ -42,7 +40,6 @@ public class StartFFmpegSessionHandler : IRequestHandler<StartFFmpegSession, Eit
|
||||
IHlsInitSegmentCache hlsInitSegmentCache,
|
||||
IServiceScopeFactory serviceScopeFactory,
|
||||
IMediator mediator,
|
||||
IClient client,
|
||||
IFileSystem fileSystem,
|
||||
ILocalFileSystem localFileSystem,
|
||||
ILogger<StartFFmpegSessionHandler> logger,
|
||||
@@ -57,7 +54,6 @@ public class StartFFmpegSessionHandler : IRequestHandler<StartFFmpegSession, Eit
|
||||
_hlsInitSegmentCache = hlsInitSegmentCache;
|
||||
_serviceScopeFactory = serviceScopeFactory;
|
||||
_mediator = mediator;
|
||||
_client = client;
|
||||
_fileSystem = fileSystem;
|
||||
_localFileSystem = localFileSystem;
|
||||
_logger = logger;
|
||||
@@ -129,7 +125,6 @@ public class StartFFmpegSessionHandler : IRequestHandler<StartFFmpegSession, Eit
|
||||
_ => new HlsSessionWorker(
|
||||
_serviceScopeFactory,
|
||||
_graphicsEngine,
|
||||
_client,
|
||||
OutputFormatKind.Hls,
|
||||
_hlsPlaylistFilter,
|
||||
_hlsInitSegmentCache,
|
||||
|
||||
@@ -5,7 +5,6 @@ using System.IO.Abstractions;
|
||||
using System.IO.Pipelines;
|
||||
using System.Text;
|
||||
using System.Timers;
|
||||
using Bugsnag;
|
||||
using CliWrap;
|
||||
using CliWrap.Buffered;
|
||||
using ErsatzTV.Application.Channels;
|
||||
@@ -28,7 +27,6 @@ namespace ErsatzTV.Application.Streaming;
|
||||
public class HlsSessionWorker : IHlsSessionWorker
|
||||
{
|
||||
private static int _workAheadCount;
|
||||
private readonly IClient _client;
|
||||
private readonly OutputFormatKind _outputFormatKind;
|
||||
private readonly IHlsInitSegmentCache _hlsInitSegmentCache;
|
||||
private readonly Dictionary<long, int> _discontinuityMap = [];
|
||||
@@ -60,7 +58,6 @@ public class HlsSessionWorker : IHlsSessionWorker
|
||||
public HlsSessionWorker(
|
||||
IServiceScopeFactory serviceScopeFactory,
|
||||
IGraphicsEngine graphicsEngine,
|
||||
IClient client,
|
||||
OutputFormatKind outputFormatKind,
|
||||
IHlsPlaylistFilter hlsPlaylistFilter,
|
||||
IHlsInitSegmentCache hlsInitSegmentCache,
|
||||
@@ -73,7 +70,6 @@ public class HlsSessionWorker : IHlsSessionWorker
|
||||
_serviceScope = serviceScopeFactory.CreateScope();
|
||||
_mediator = _serviceScope.ServiceProvider.GetRequiredService<IMediator>();
|
||||
_graphicsEngine = graphicsEngine;
|
||||
_client = client;
|
||||
_outputFormatKind = outputFormatKind;
|
||||
_hlsInitSegmentCache = hlsInitSegmentCache;
|
||||
_hlsPlaylistFilter = hlsPlaylistFilter;
|
||||
@@ -660,15 +656,6 @@ public class HlsSessionWorker : IHlsSessionWorker
|
||||
{
|
||||
_logger.LogError(ex, "Error transcoding channel {Channel} - {Message}", _channelNumber, ex.Message);
|
||||
|
||||
try
|
||||
{
|
||||
_client.Notify(ex);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
finally
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using System.IO.Abstractions;
|
||||
using System.Text;
|
||||
using Bugsnag;
|
||||
using CliWrap;
|
||||
using ErsatzTV.Core;
|
||||
using ErsatzTV.Core.Domain;
|
||||
@@ -13,7 +12,6 @@ using Newtonsoft.Json;
|
||||
namespace ErsatzTV.Application.Streaming;
|
||||
|
||||
public class GetLastPtsTimeHandler(
|
||||
IClient client,
|
||||
IFileSystem fileSystem,
|
||||
ITempFilePool tempFilePool,
|
||||
IConfigElementRepository configElementRepository,
|
||||
@@ -181,9 +179,9 @@ public class GetLastPtsTimeHandler(
|
||||
|
||||
logger.LogWarning("Transcode folder is in bad state; troubleshooting info saved to {File}", file);
|
||||
}
|
||||
catch (Exception ex)
|
||||
catch (Exception)
|
||||
{
|
||||
client.Notify(ex);
|
||||
// do nothing
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Bugsnag" Version="4.1.0" />
|
||||
<PackageReference Include="CliWrap" Version="3.10.0" />
|
||||
<PackageReference Include="LanguageExt.Core" Version="4.4.9" />
|
||||
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="10.0.2" />
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
using Bugsnag;
|
||||
using ErsatzTV.Core.Domain;
|
||||
using ErsatzTV.Core.Domain;
|
||||
using ErsatzTV.Core.Metadata;
|
||||
using NSubstitute;
|
||||
using NUnit.Framework;
|
||||
using Shouldly;
|
||||
|
||||
@@ -11,7 +9,7 @@ namespace ErsatzTV.Core.Tests.Metadata;
|
||||
public class FallbackMetadataProviderTests
|
||||
{
|
||||
[SetUp]
|
||||
public void SetUp() => _fallbackMetadataProvider = new FallbackMetadataProvider(Substitute.For<IClient>());
|
||||
public void SetUp() => _fallbackMetadataProvider = new FallbackMetadataProvider();
|
||||
|
||||
private FallbackMetadataProvider _fallbackMetadataProvider;
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
using Bugsnag;
|
||||
using Dapper;
|
||||
using Destructurama;
|
||||
using ErsatzTV.Core.Domain;
|
||||
@@ -93,8 +92,6 @@ public class ScheduleIntegrationTests
|
||||
services.AddSingleton<ISearchIndex, LuceneSearchIndex>();
|
||||
services.AddSingleton<ILanguageCodeCache, LanguageCodeCache>();
|
||||
|
||||
services.AddSingleton(_ => Substitute.For<IClient>());
|
||||
|
||||
ServiceProvider provider = services.BuildServiceProvider();
|
||||
|
||||
IDbContextFactory<TvContext> factory = provider.GetRequiredService<IDbContextFactory<TvContext>>();
|
||||
@@ -110,7 +107,6 @@ public class ScheduleIntegrationTests
|
||||
await searchIndex.Initialize(
|
||||
new LocalFileSystem(
|
||||
new MockFileSystem(),
|
||||
provider.GetRequiredService<IClient>(),
|
||||
provider.GetRequiredService<ILogger<LocalFileSystem>>()),
|
||||
provider.GetRequiredService<IConfigElementRepository>(),
|
||||
_cancellationToken);
|
||||
@@ -123,7 +119,7 @@ public class ScheduleIntegrationTests
|
||||
|
||||
var builder = new PlayoutBuilder(
|
||||
new ConfigElementRepository(factory),
|
||||
new MediaCollectionRepository(Substitute.For<IClient>(), searchIndex, factory),
|
||||
new MediaCollectionRepository(searchIndex, factory),
|
||||
new TelevisionRepository(factory, provider.GetRequiredService<ILogger<TelevisionRepository>>()),
|
||||
new ArtistRepository(factory),
|
||||
Substitute.For<IMultiEpisodeShuffleCollectionEnumeratorFactory>(),
|
||||
@@ -319,7 +315,7 @@ public class ScheduleIntegrationTests
|
||||
|
||||
var builder = new PlayoutBuilder(
|
||||
new ConfigElementRepository(factory),
|
||||
new MediaCollectionRepository(Substitute.For<IClient>(), Substitute.For<ISearchIndex>(), factory),
|
||||
new MediaCollectionRepository(Substitute.For<ISearchIndex>(), factory),
|
||||
new TelevisionRepository(factory, provider.GetRequiredService<ILogger<TelevisionRepository>>()),
|
||||
new ArtistRepository(factory),
|
||||
Substitute.For<IMultiEpisodeShuffleCollectionEnumeratorFactory>(),
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Bugsnag" Version="4.1.0" />
|
||||
<PackageReference Include="Destructurama.Attributed" Version="5.2.0" />
|
||||
<PackageReference Include="Flurl" Version="4.0.0" />
|
||||
<PackageReference Include="Humanizer.Core" Version="3.0.1" />
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System.Diagnostics;
|
||||
using Bugsnag;
|
||||
using CliWrap;
|
||||
using ErsatzTV.Core.Domain;
|
||||
using ErsatzTV.Core.Interfaces.FFmpeg;
|
||||
@@ -12,7 +11,6 @@ namespace ErsatzTV.Core.FFmpeg;
|
||||
|
||||
public class FFmpegProcessService
|
||||
{
|
||||
private readonly IClient _client;
|
||||
private readonly IFFmpegStreamSelector _ffmpegStreamSelector;
|
||||
private readonly ILogger<FFmpegProcessService> _logger;
|
||||
private readonly ITempFilePool _tempFilePool;
|
||||
@@ -20,12 +18,10 @@ public class FFmpegProcessService
|
||||
public FFmpegProcessService(
|
||||
IFFmpegStreamSelector ffmpegStreamSelector,
|
||||
ITempFilePool tempFilePool,
|
||||
IClient client,
|
||||
ILogger<FFmpegProcessService> logger)
|
||||
{
|
||||
_ffmpegStreamSelector = ffmpegStreamSelector;
|
||||
_tempFilePool = tempFilePool;
|
||||
_client = client;
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
@@ -131,7 +127,6 @@ public class FFmpegProcessService
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogWarning(ex, "Error generating song image");
|
||||
_client.Notify(ex);
|
||||
return Left(BaseError.New(ex.Message));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
namespace ErsatzTV.Core.Health.Checks;
|
||||
|
||||
public interface IErrorReportsHealthCheck : IHealthCheck
|
||||
{
|
||||
}
|
||||
@@ -1,5 +1,4 @@
|
||||
using Bugsnag;
|
||||
using ErsatzTV.Core.Domain;
|
||||
using ErsatzTV.Core.Domain;
|
||||
using ErsatzTV.Core.Interfaces.Metadata;
|
||||
using ErsatzTV.Core.Interfaces.Repositories;
|
||||
using ErsatzTV.Core.Search;
|
||||
@@ -38,7 +37,6 @@ public interface ISearchIndex : IDisposable
|
||||
Task<bool> RemoveItems(IEnumerable<int> ids);
|
||||
|
||||
Task<SearchResult> Search(
|
||||
IClient client,
|
||||
string query,
|
||||
string smartCollectionName,
|
||||
int skip,
|
||||
@@ -46,7 +44,6 @@ public interface ISearchIndex : IDisposable
|
||||
CancellationToken cancellationToken);
|
||||
|
||||
Task<SearchResult> Search(
|
||||
IClient client,
|
||||
string query,
|
||||
string smartCollectionName,
|
||||
int skip,
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
using System.Globalization;
|
||||
using System.Text.RegularExpressions;
|
||||
using Bugsnag;
|
||||
using ErsatzTV.Core.Domain;
|
||||
using ErsatzTV.Core.Interfaces.Metadata;
|
||||
|
||||
namespace ErsatzTV.Core.Metadata;
|
||||
|
||||
public partial class FallbackMetadataProvider(IClient client) : IFallbackMetadataProvider
|
||||
public partial class FallbackMetadataProvider : IFallbackMetadataProvider
|
||||
{
|
||||
private static readonly Regex SeasonPattern = SeasonNumber();
|
||||
|
||||
@@ -203,7 +202,7 @@ public partial class FallbackMetadataProvider(IClient client) : IFallbackMetadat
|
||||
[GeneratedRegex(@"s(?:eason)?\s?(\d+)(?![e\d])", RegexOptions.IgnoreCase)]
|
||||
private static partial Regex SeasonNumber();
|
||||
|
||||
private List<EpisodeMetadata> GetEpisodeMetadata(string fileName, EpisodeMetadata baseMetadata)
|
||||
private static List<EpisodeMetadata> GetEpisodeMetadata(string fileName, EpisodeMetadata baseMetadata)
|
||||
{
|
||||
var result = new List<EpisodeMetadata> { baseMetadata };
|
||||
|
||||
@@ -260,15 +259,15 @@ public partial class FallbackMetadataProvider(IClient client) : IFallbackMetadat
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
catch (Exception)
|
||||
{
|
||||
client.Notify(ex);
|
||||
// do nothing
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
private MovieMetadata GetMovieMetadata(string fileName, MovieMetadata metadata)
|
||||
private static MovieMetadata GetMovieMetadata(string fileName, MovieMetadata metadata)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -283,15 +282,15 @@ public partial class FallbackMetadataProvider(IClient client) : IFallbackMetadat
|
||||
metadata.DateUpdated = DateTime.UtcNow;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
catch (Exception)
|
||||
{
|
||||
client.Notify(ex);
|
||||
// do nothing
|
||||
}
|
||||
|
||||
return metadata;
|
||||
}
|
||||
|
||||
private Option<MusicVideoMetadata> GetMusicVideoMetadata(string fileName, MusicVideoMetadata metadata)
|
||||
private static Option<MusicVideoMetadata> GetMusicVideoMetadata(string fileName, MusicVideoMetadata metadata)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -310,14 +309,13 @@ public partial class FallbackMetadataProvider(IClient client) : IFallbackMetadat
|
||||
|
||||
return metadata;
|
||||
}
|
||||
catch (Exception ex)
|
||||
catch (Exception)
|
||||
{
|
||||
client.Notify(ex);
|
||||
return None;
|
||||
}
|
||||
}
|
||||
|
||||
private Option<OtherVideoMetadata> GetOtherVideoMetadata(string path, OtherVideoMetadata metadata)
|
||||
private static Option<OtherVideoMetadata> GetOtherVideoMetadata(string path, OtherVideoMetadata metadata)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -348,14 +346,13 @@ public partial class FallbackMetadataProvider(IClient client) : IFallbackMetadat
|
||||
|
||||
return metadata;
|
||||
}
|
||||
catch (Exception ex)
|
||||
catch (Exception)
|
||||
{
|
||||
client.Notify(ex);
|
||||
return None;
|
||||
}
|
||||
}
|
||||
|
||||
private Option<ImageMetadata> GetImageMetadata(string path, ImageMetadata metadata)
|
||||
private static Option<ImageMetadata> GetImageMetadata(string path, ImageMetadata metadata)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -386,14 +383,13 @@ public partial class FallbackMetadataProvider(IClient client) : IFallbackMetadat
|
||||
|
||||
return metadata;
|
||||
}
|
||||
catch (Exception ex)
|
||||
catch (Exception)
|
||||
{
|
||||
client.Notify(ex);
|
||||
return None;
|
||||
}
|
||||
}
|
||||
|
||||
private Option<RemoteStreamMetadata> GetRemoteStreamMetadata(string path, RemoteStreamMetadata metadata)
|
||||
private static Option<RemoteStreamMetadata> GetRemoteStreamMetadata(string path, RemoteStreamMetadata metadata)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -424,14 +420,13 @@ public partial class FallbackMetadataProvider(IClient client) : IFallbackMetadat
|
||||
|
||||
return metadata;
|
||||
}
|
||||
catch (Exception ex)
|
||||
catch (Exception)
|
||||
{
|
||||
client.Notify(ex);
|
||||
return None;
|
||||
}
|
||||
}
|
||||
|
||||
private Option<SongMetadata> GetSongMetadata(string path, SongMetadata metadata)
|
||||
private static Option<SongMetadata> GetSongMetadata(string path, SongMetadata metadata)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -462,14 +457,13 @@ public partial class FallbackMetadataProvider(IClient client) : IFallbackMetadat
|
||||
|
||||
return metadata;
|
||||
}
|
||||
catch (Exception ex)
|
||||
catch (Exception)
|
||||
{
|
||||
client.Notify(ex);
|
||||
return None;
|
||||
}
|
||||
}
|
||||
|
||||
private ShowMetadata GetTelevisionShowMetadata(string fileName, ShowMetadata metadata)
|
||||
private static ShowMetadata GetTelevisionShowMetadata(string fileName, ShowMetadata metadata)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -484,9 +478,9 @@ public partial class FallbackMetadataProvider(IClient client) : IFallbackMetadat
|
||||
metadata.DateUpdated = DateTime.UtcNow;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
catch (Exception)
|
||||
{
|
||||
client.Notify(ex);
|
||||
// do nothing
|
||||
}
|
||||
|
||||
return metadata;
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.IO.Abstractions;
|
||||
using System.Security.Cryptography;
|
||||
using Bugsnag;
|
||||
using ErsatzTV.Core.Interfaces.Metadata;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace ErsatzTV.Core.Metadata;
|
||||
|
||||
public class LocalFileSystem(IFileSystem fileSystem, IClient client, ILogger<LocalFileSystem> logger) : ILocalFileSystem
|
||||
public class LocalFileSystem(IFileSystem fileSystem, ILogger<LocalFileSystem> logger) : ILocalFileSystem
|
||||
{
|
||||
public Unit EnsureFolderExists(string folder)
|
||||
{
|
||||
@@ -50,10 +49,9 @@ public class LocalFileSystem(IFileSystem fileSystem, IClient client, ILogger<Loc
|
||||
{
|
||||
logger.LogWarning("Unauthorized access exception listing subdirectories of folder {Folder}", folder);
|
||||
}
|
||||
catch (Exception ex)
|
||||
catch (Exception)
|
||||
{
|
||||
// do nothing
|
||||
client.Notify(ex);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -73,10 +71,9 @@ public class LocalFileSystem(IFileSystem fileSystem, IClient client, ILogger<Loc
|
||||
{
|
||||
logger.LogWarning("Unauthorized access exception listing files in folder {Folder}", folder);
|
||||
}
|
||||
catch (Exception ex)
|
||||
catch (Exception)
|
||||
{
|
||||
// do nothing
|
||||
client.Notify(ex);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -96,10 +93,9 @@ public class LocalFileSystem(IFileSystem fileSystem, IClient client, ILogger<Loc
|
||||
{
|
||||
logger.LogWarning("Unauthorized access exception listing files in folder {Folder}", folder);
|
||||
}
|
||||
catch (Exception ex)
|
||||
catch (Exception)
|
||||
{
|
||||
// do nothing
|
||||
client.Notify(ex);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -123,10 +119,9 @@ public class LocalFileSystem(IFileSystem fileSystem, IClient client, ILogger<Loc
|
||||
{
|
||||
logger.LogWarning("Unauthorized access exception listing files in folder {Folder}", folder);
|
||||
}
|
||||
catch (Exception ex)
|
||||
catch (Exception)
|
||||
{
|
||||
// do nothing
|
||||
client.Notify(ex);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -151,7 +146,6 @@ public class LocalFileSystem(IFileSystem fileSystem, IClient client, ILogger<Loc
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
client.Notify(ex);
|
||||
return BaseError.New(ex.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using Bugsnag;
|
||||
using ErsatzTV.Core.Domain;
|
||||
using ErsatzTV.Core.Domain;
|
||||
using ErsatzTV.Core.Interfaces.Metadata;
|
||||
using ErsatzTV.Core.Interfaces.Repositories;
|
||||
using ErsatzTV.FFmpeg.Capabilities;
|
||||
@@ -24,7 +23,6 @@ public class LocalStatisticsProviderTests
|
||||
Substitute.For<IMetadataRepository>(),
|
||||
new MockFileSystem(),
|
||||
Substitute.For<ILocalFileSystem>(),
|
||||
Substitute.For<IClient>(),
|
||||
Substitute.For<IHardwareCapabilitiesFactory>(),
|
||||
Substitute.For<ILogger<LocalStatisticsProvider>>());
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using Bugsnag;
|
||||
using Dapper;
|
||||
using ErsatzTV.Core.Domain;
|
||||
using ErsatzTV.Core.Interfaces.Repositories;
|
||||
@@ -14,16 +13,13 @@ namespace ErsatzTV.Infrastructure.Data.Repositories;
|
||||
|
||||
public class MediaCollectionRepository : IMediaCollectionRepository
|
||||
{
|
||||
private readonly IClient _client;
|
||||
private readonly IDbContextFactory<TvContext> _dbContextFactory;
|
||||
private readonly ISearchIndex _searchIndex;
|
||||
|
||||
public MediaCollectionRepository(
|
||||
IClient client,
|
||||
ISearchIndex searchIndex,
|
||||
IDbContextFactory<TvContext> dbContextFactory)
|
||||
{
|
||||
_client = client;
|
||||
_searchIndex = searchIndex;
|
||||
_dbContextFactory = dbContextFactory;
|
||||
}
|
||||
@@ -463,7 +459,6 @@ public class MediaCollectionRepository : IMediaCollectionRepository
|
||||
|
||||
// elasticsearch doesn't like when we ask for a limit of zero, so use 10,000
|
||||
SearchResult searchResults = await _searchIndex.Search(
|
||||
_client,
|
||||
query,
|
||||
smartCollectionName,
|
||||
0,
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
using ErsatzTV.Core.Errors;
|
||||
using ErsatzTV.Core.Health;
|
||||
using ErsatzTV.Core.Health.Checks;
|
||||
using Microsoft.Extensions.Options;
|
||||
|
||||
namespace ErsatzTV.Infrastructure.Health.Checks;
|
||||
|
||||
public class ErrorReportsHealthCheck : BaseHealthCheck, IErrorReportsHealthCheck
|
||||
{
|
||||
private readonly IOptions<BugsnagConfiguration> _bugsnagConfiguration;
|
||||
|
||||
public ErrorReportsHealthCheck(IOptions<BugsnagConfiguration> bugsnagConfiguration) =>
|
||||
_bugsnagConfiguration = bugsnagConfiguration;
|
||||
|
||||
public override string Title => "Error Reports";
|
||||
|
||||
public Task<HealthCheckResult> Check(CancellationToken cancellationToken)
|
||||
{
|
||||
if (_bugsnagConfiguration.Value.Enable)
|
||||
{
|
||||
return Result(
|
||||
HealthCheckStatus.Pass,
|
||||
"Automated error reporting is enabled, thank you! To disable, edit the file appsettings.json or set the Bugsnag:Enable environment variable to false",
|
||||
"Automated error reporting is enabled, thank you!")
|
||||
.AsTask();
|
||||
}
|
||||
|
||||
return InfoResult(
|
||||
"Automated error reporting is disabled. Please enable to support bug fixing efforts!",
|
||||
"Automated error reporting is disabled")
|
||||
.AsTask();
|
||||
}
|
||||
}
|
||||
@@ -27,7 +27,6 @@ public class HealthCheckService : IHealthCheckService
|
||||
IFileNotFoundHealthCheck fileNotFoundHealthCheck,
|
||||
IUnavailableHealthCheck unavailableHealthCheck,
|
||||
IVaapiDriverHealthCheck vaapiDriverHealthCheck,
|
||||
IErrorReportsHealthCheck errorReportsHealthCheck,
|
||||
IUnifiedDockerHealthCheck unifiedDockerHealthCheck,
|
||||
IDowngradeHealthCheck downgradeHealthCheck,
|
||||
IEmptyScheduleHealthCheck emptyScheduleHealthCheck,
|
||||
@@ -53,8 +52,7 @@ public class HealthCheckService : IHealthCheckService
|
||||
fileNotFoundHealthCheck,
|
||||
unavailableHealthCheck,
|
||||
emptyScheduleHealthCheck,
|
||||
vaapiDriverHealthCheck,
|
||||
errorReportsHealthCheck
|
||||
vaapiDriverHealthCheck
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@ using System.Globalization;
|
||||
using System.IO.Abstractions;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using Bugsnag;
|
||||
using CliWrap;
|
||||
using CliWrap.Buffered;
|
||||
using ErsatzTV.Core;
|
||||
@@ -21,7 +20,6 @@ namespace ErsatzTV.Infrastructure.Metadata;
|
||||
|
||||
public partial class LocalStatisticsProvider : ILocalStatisticsProvider
|
||||
{
|
||||
private readonly IClient _client;
|
||||
private readonly IHardwareCapabilitiesFactory _hardwareCapabilitiesFactory;
|
||||
private readonly ILocalFileSystem _localFileSystem;
|
||||
private readonly ILogger<LocalStatisticsProvider> _logger;
|
||||
@@ -32,14 +30,12 @@ public partial class LocalStatisticsProvider : ILocalStatisticsProvider
|
||||
IMetadataRepository metadataRepository,
|
||||
IFileSystem fileSystem,
|
||||
ILocalFileSystem localFileSystem,
|
||||
IClient client,
|
||||
IHardwareCapabilitiesFactory hardwareCapabilitiesFactory,
|
||||
ILogger<LocalStatisticsProvider> logger)
|
||||
{
|
||||
_metadataRepository = metadataRepository;
|
||||
_fileSystem = fileSystem;
|
||||
_localFileSystem = localFileSystem;
|
||||
_client = client;
|
||||
_hardwareCapabilitiesFactory = hardwareCapabilitiesFactory;
|
||||
_logger = logger;
|
||||
}
|
||||
@@ -71,7 +67,6 @@ public partial class LocalStatisticsProvider : ILocalStatisticsProvider
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogWarning(ex, "Failed to refresh statistics for media item {Id}", mediaItem.Id);
|
||||
_client.Notify(ex);
|
||||
return BaseError.New(ex.Message);
|
||||
}
|
||||
}
|
||||
@@ -130,7 +125,6 @@ public partial class LocalStatisticsProvider : ILocalStatisticsProvider
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogWarning(ex, "Failed to get format tags for media item {Id}", mediaItem.Id);
|
||||
_client.Notify(ex);
|
||||
return BaseError.New(ex.Message);
|
||||
}
|
||||
}
|
||||
@@ -225,7 +219,6 @@ public partial class LocalStatisticsProvider : ILocalStatisticsProvider
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogWarning(ex, "Failed to refresh statistics for media item {Id}", mediaItem.Id);
|
||||
_client.Notify(ex);
|
||||
return BaseError.New(ex.Message);
|
||||
}
|
||||
}
|
||||
@@ -466,9 +459,8 @@ public partial class LocalStatisticsProvider : ILocalStatisticsProvider
|
||||
_logger.LogError("Duration analysis failed for media item at {Path}", path);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
catch (Exception)
|
||||
{
|
||||
_client.Notify(ex);
|
||||
_logger.LogError("Duration analysis failed for media item at {Path}", path);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System.Globalization;
|
||||
using Bugsnag;
|
||||
using Elastic.Clients.Elasticsearch.Aggregations;
|
||||
using Elastic.Clients.Elasticsearch.Core.Bulk;
|
||||
using Elastic.Clients.Elasticsearch.IndexManagement;
|
||||
@@ -168,13 +167,11 @@ public class ElasticSearchIndex : ISearchIndex
|
||||
}
|
||||
|
||||
public Task<SearchResult> Search(
|
||||
IClient client,
|
||||
string query,
|
||||
string smartCollectionName,
|
||||
int skip,
|
||||
int limit,
|
||||
CancellationToken cancellationToken) => Search(
|
||||
client,
|
||||
query,
|
||||
smartCollectionName,
|
||||
skip,
|
||||
@@ -183,7 +180,6 @@ public class ElasticSearchIndex : ISearchIndex
|
||||
cancellationToken);
|
||||
|
||||
public async Task<SearchResult> Search(
|
||||
IClient client,
|
||||
string query,
|
||||
string smartCollectionName,
|
||||
int skip,
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System.Globalization;
|
||||
using Bugsnag;
|
||||
using ErsatzTV.Core;
|
||||
using ErsatzTV.Core.Domain;
|
||||
using ErsatzTV.Core.Interfaces.Metadata;
|
||||
@@ -212,13 +211,11 @@ public sealed class LuceneSearchIndex : ISearchIndex
|
||||
|
||||
// default to title field only
|
||||
public Task<SearchResult> Search(
|
||||
IClient client,
|
||||
string query,
|
||||
string smartCollectionName,
|
||||
int skip,
|
||||
int limit,
|
||||
CancellationToken cancellationToken) => Search(
|
||||
client,
|
||||
query,
|
||||
smartCollectionName,
|
||||
skip,
|
||||
@@ -227,7 +224,6 @@ public sealed class LuceneSearchIndex : ISearchIndex
|
||||
cancellationToken);
|
||||
|
||||
public async Task<SearchResult> Search(
|
||||
IClient client,
|
||||
string query,
|
||||
string smartCollectionName,
|
||||
int skip,
|
||||
@@ -235,15 +231,6 @@ public sealed class LuceneSearchIndex : ISearchIndex
|
||||
List<string> defaultFields,
|
||||
CancellationToken cancellationToken)
|
||||
{
|
||||
var metadata = new Dictionary<string, string>
|
||||
{
|
||||
{ "searchQuery", query },
|
||||
{ "skip", skip.ToString(CultureInfo.InvariantCulture) },
|
||||
{ "limit", limit.ToString(CultureInfo.InvariantCulture) }
|
||||
};
|
||||
|
||||
client?.Breadcrumbs?.Leave("SearchIndex.Search", BreadcrumbType.State, metadata);
|
||||
|
||||
query ??= string.Empty;
|
||||
|
||||
if (string.IsNullOrWhiteSpace(query.Replace("*", string.Empty).Replace("?", string.Empty)) ||
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
using System.Diagnostics;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
using Bugsnag;
|
||||
using CliWrap;
|
||||
using CliWrap.Buffered;
|
||||
using ErsatzTV.Core;
|
||||
@@ -246,7 +245,6 @@ public class TranscodingTests
|
||||
{
|
||||
var localFileSystem = new LocalFileSystem(
|
||||
new RealFileSystem(),
|
||||
Substitute.For<IClient>(),
|
||||
LoggerFactory.CreateLogger<LocalFileSystem>());
|
||||
var fileSystem = new MockFileSystem();
|
||||
var tempFilePool = new TempFilePool();
|
||||
@@ -276,7 +274,6 @@ public class TranscodingTests
|
||||
var oldService = new FFmpegProcessService(
|
||||
new FakeStreamSelector(),
|
||||
tempFilePool,
|
||||
Substitute.For<IClient>(),
|
||||
LoggerFactory.CreateLogger<FFmpegProcessService>());
|
||||
|
||||
var service = new FFmpegLibraryProcessService(
|
||||
@@ -368,7 +365,6 @@ public class TranscodingTests
|
||||
metadataRepository,
|
||||
fileSystem,
|
||||
localFileSystem,
|
||||
Substitute.For<IClient>(),
|
||||
Substitute.For<IHardwareCapabilitiesFactory>(),
|
||||
LoggerFactory.CreateLogger<LocalStatisticsProvider>());
|
||||
|
||||
@@ -484,7 +480,6 @@ public class TranscodingTests
|
||||
|
||||
var localFileSystem = new LocalFileSystem(
|
||||
new MockFileSystem(),
|
||||
Substitute.For<IClient>(),
|
||||
LoggerFactory.CreateLogger<LocalFileSystem>());
|
||||
var fileSystem = new MockFileSystem();
|
||||
|
||||
@@ -533,7 +528,6 @@ public class TranscodingTests
|
||||
metadataRepository,
|
||||
fileSystem,
|
||||
localFileSystem,
|
||||
Substitute.For<IClient>(),
|
||||
Substitute.For<IHardwareCapabilitiesFactory>(),
|
||||
LoggerFactory.CreateLogger<LocalStatisticsProvider>());
|
||||
|
||||
@@ -1007,7 +1001,6 @@ public class TranscodingTests
|
||||
var oldService = new FFmpegProcessService(
|
||||
new FakeStreamSelector(),
|
||||
Substitute.For<ITempFilePool>(),
|
||||
Substitute.For<IClient>(),
|
||||
LoggerFactory.CreateLogger<FFmpegProcessService>());
|
||||
|
||||
var service = new FFmpegLibraryProcessService(
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System.Globalization;
|
||||
using Bugsnag;
|
||||
using ErsatzTV.Core.Domain;
|
||||
using ErsatzTV.Core.Interfaces.Repositories;
|
||||
using ErsatzTV.Core.Metadata;
|
||||
@@ -61,7 +60,7 @@ public class LocalSubtitlesProviderTests
|
||||
Substitute.For<IMediaItemRepository>(),
|
||||
Substitute.For<IMetadataRepository>(),
|
||||
fileSystem,
|
||||
new LocalFileSystem(fileSystem, Substitute.For<IClient>(), Substitute.For<ILogger<LocalFileSystem>>()),
|
||||
new LocalFileSystem(fileSystem, Substitute.For<ILogger<LocalFileSystem>>()),
|
||||
Substitute.For<ILogger<LocalSubtitlesProvider>>());
|
||||
|
||||
List<Subtitle> result = provider.LocateExternalSubtitles(
|
||||
@@ -115,7 +114,7 @@ public class LocalSubtitlesProviderTests
|
||||
Substitute.For<IMediaItemRepository>(),
|
||||
Substitute.For<IMetadataRepository>(),
|
||||
fileSystem,
|
||||
new LocalFileSystem(fileSystem, Substitute.For<IClient>(), Substitute.For<ILogger<LocalFileSystem>>()),
|
||||
new LocalFileSystem(fileSystem, Substitute.For<ILogger<LocalFileSystem>>()),
|
||||
Substitute.For<ILogger<LocalSubtitlesProvider>>());
|
||||
|
||||
List<Subtitle> result = provider.LocateExternalSubtitles(
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System.Runtime.InteropServices;
|
||||
using Bugsnag;
|
||||
using ErsatzTV.Core;
|
||||
using ErsatzTV.Core.Domain;
|
||||
using ErsatzTV.Core.Interfaces.FFmpeg;
|
||||
@@ -1032,7 +1031,7 @@ public class MovieFolderScannerTests
|
||||
return new MovieFolderScanner(
|
||||
_scannerProxy,
|
||||
fileSystem,
|
||||
new LocalFileSystem(fileSystem, Substitute.For<IClient>(), Substitute.For<ILogger<LocalFileSystem>>()),
|
||||
new LocalFileSystem(fileSystem, Substitute.For<ILogger<LocalFileSystem>>()),
|
||||
_movieRepository,
|
||||
_localStatisticsProvider,
|
||||
Substitute.For<ILocalSubtitlesProvider>(),
|
||||
@@ -1044,7 +1043,6 @@ public class MovieFolderScannerTests
|
||||
_mediaItemRepository,
|
||||
Substitute.For<IFFmpegPngService>(),
|
||||
Substitute.For<ITempFilePool>(),
|
||||
Substitute.For<IClient>(),
|
||||
Logger);
|
||||
}
|
||||
|
||||
@@ -1060,7 +1058,7 @@ public class MovieFolderScannerTests
|
||||
return new MovieFolderScanner(
|
||||
_scannerProxy,
|
||||
fileSystem,
|
||||
new LocalFileSystem(fileSystem, Substitute.For<IClient>(), Substitute.For<ILogger<LocalFileSystem>>()),
|
||||
new LocalFileSystem(fileSystem, Substitute.For<ILogger<LocalFileSystem>>()),
|
||||
_movieRepository,
|
||||
_localStatisticsProvider,
|
||||
Substitute.For<ILocalSubtitlesProvider>(),
|
||||
@@ -1072,7 +1070,6 @@ public class MovieFolderScannerTests
|
||||
_mediaItemRepository,
|
||||
Substitute.For<IFFmpegPngService>(),
|
||||
Substitute.For<ITempFilePool>(),
|
||||
Substitute.For<IClient>(),
|
||||
Logger);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
using System.Text;
|
||||
using Bugsnag;
|
||||
using ErsatzTV.Core;
|
||||
using ErsatzTV.Scanner.Core.Metadata.Nfo;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.IO;
|
||||
using NSubstitute;
|
||||
using NUnit.Framework;
|
||||
using Serilog;
|
||||
using Shouldly;
|
||||
@@ -17,7 +15,6 @@ public class ArtistNfoReaderTests
|
||||
[SetUp]
|
||||
public void SetUp() => _artistNfoReader = new ArtistNfoReader(
|
||||
new RecyclableMemoryStreamManager(),
|
||||
Substitute.For<IClient>(),
|
||||
_logger);
|
||||
|
||||
private readonly ILogger<ArtistNfoReader> _logger;
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
using System.Text;
|
||||
using Bugsnag;
|
||||
using ErsatzTV.Core;
|
||||
using ErsatzTV.Scanner.Core.Metadata.Nfo;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.IO;
|
||||
using NSubstitute;
|
||||
using NUnit.Framework;
|
||||
using Serilog;
|
||||
using Shouldly;
|
||||
@@ -17,7 +15,6 @@ public class EpisodeNfoReaderTests
|
||||
[SetUp]
|
||||
public void SetUp() => _episodeNfoReader = new EpisodeNfoReader(
|
||||
new RecyclableMemoryStreamManager(),
|
||||
Substitute.For<IClient>(),
|
||||
_logger);
|
||||
|
||||
private readonly ILogger<EpisodeNfoReader> _logger;
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
using System.Text;
|
||||
using Bugsnag;
|
||||
using ErsatzTV.Core;
|
||||
using ErsatzTV.Scanner.Core.Metadata.Nfo;
|
||||
using Microsoft.Extensions.Logging.Abstractions;
|
||||
using Microsoft.IO;
|
||||
using NSubstitute;
|
||||
using NUnit.Framework;
|
||||
using Shouldly;
|
||||
|
||||
@@ -16,7 +14,6 @@ public class MovieNfoReaderTests
|
||||
[SetUp]
|
||||
public void SetUp() => _movieNfoReader = new MovieNfoReader(
|
||||
new RecyclableMemoryStreamManager(),
|
||||
Substitute.For<IClient>(),
|
||||
new NullLogger<MovieNfoReader>());
|
||||
|
||||
private MovieNfoReader _movieNfoReader;
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
using System.Text;
|
||||
using Bugsnag;
|
||||
using ErsatzTV.Core;
|
||||
using ErsatzTV.Scanner.Core.Metadata.Nfo;
|
||||
using Microsoft.Extensions.Logging.Abstractions;
|
||||
using Microsoft.IO;
|
||||
using NSubstitute;
|
||||
using NUnit.Framework;
|
||||
using Shouldly;
|
||||
|
||||
@@ -16,7 +14,6 @@ public class MusicVideoNfoReaderTests
|
||||
[SetUp]
|
||||
public void SetUp() => _musicVideoNfoReader = new MusicVideoNfoReader(
|
||||
new RecyclableMemoryStreamManager(),
|
||||
Substitute.For<IClient>(),
|
||||
new NullLogger<MusicVideoNfoReader>());
|
||||
|
||||
private MusicVideoNfoReader _musicVideoNfoReader;
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
using System.Text;
|
||||
using Bugsnag;
|
||||
using ErsatzTV.Core;
|
||||
using ErsatzTV.Scanner.Core.Metadata.Nfo;
|
||||
using Microsoft.Extensions.Logging.Abstractions;
|
||||
using Microsoft.IO;
|
||||
using NSubstitute;
|
||||
using NUnit.Framework;
|
||||
using Shouldly;
|
||||
|
||||
@@ -16,7 +14,6 @@ public class OtherVideoNfoReaderTests
|
||||
[SetUp]
|
||||
public void SetUp() => _otherVideoNfoReader = new OtherVideoNfoReader(
|
||||
new RecyclableMemoryStreamManager(),
|
||||
Substitute.For<IClient>(),
|
||||
new NullLogger<OtherVideoNfoReader>());
|
||||
|
||||
private OtherVideoNfoReader _otherVideoNfoReader;
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
using System.Text;
|
||||
using Bugsnag;
|
||||
using ErsatzTV.Core;
|
||||
using ErsatzTV.Scanner.Core.Metadata.Nfo;
|
||||
using Microsoft.Extensions.Logging.Abstractions;
|
||||
using Microsoft.IO;
|
||||
using NSubstitute;
|
||||
using NUnit.Framework;
|
||||
using Shouldly;
|
||||
|
||||
@@ -16,7 +14,6 @@ public class ShowNfoReaderTests
|
||||
[SetUp]
|
||||
public void SetUp() => _showNfoReader = new ShowNfoReader(
|
||||
new RecyclableMemoryStreamManager(),
|
||||
Substitute.For<IClient>(),
|
||||
new NullLogger<ShowNfoReader>());
|
||||
|
||||
private ShowNfoReader _showNfoReader;
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using System.Collections.Immutable;
|
||||
using System.IO.Abstractions;
|
||||
using Bugsnag;
|
||||
using ErsatzTV.Core;
|
||||
using ErsatzTV.Core.Domain;
|
||||
using ErsatzTV.Core.Errors;
|
||||
@@ -19,7 +18,6 @@ namespace ErsatzTV.Scanner.Core.Metadata;
|
||||
|
||||
public class ImageFolderScanner : LocalFolderScanner, IImageFolderScanner
|
||||
{
|
||||
private readonly IClient _client;
|
||||
private readonly IImageRepository _imageRepository;
|
||||
private readonly ILibraryRepository _libraryRepository;
|
||||
private readonly IScannerProxy _scannerProxy;
|
||||
@@ -42,7 +40,6 @@ public class ImageFolderScanner : LocalFolderScanner, IImageFolderScanner
|
||||
IMediaItemRepository mediaItemRepository,
|
||||
IFFmpegPngService ffmpegPngService,
|
||||
ITempFilePool tempFilePool,
|
||||
IClient client,
|
||||
ILogger<ImageFolderScanner> logger) : base(
|
||||
fileSystem,
|
||||
localStatisticsProvider,
|
||||
@@ -51,7 +48,6 @@ public class ImageFolderScanner : LocalFolderScanner, IImageFolderScanner
|
||||
imageCache,
|
||||
ffmpegPngService,
|
||||
tempFilePool,
|
||||
client,
|
||||
logger)
|
||||
{
|
||||
_scannerProxy = scannerProxy;
|
||||
@@ -61,7 +57,6 @@ public class ImageFolderScanner : LocalFolderScanner, IImageFolderScanner
|
||||
_imageRepository = imageRepository;
|
||||
_libraryRepository = libraryRepository;
|
||||
_mediaItemRepository = mediaItemRepository;
|
||||
_client = client;
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
@@ -310,7 +305,6 @@ public class ImageFolderScanner : LocalFolderScanner, IImageFolderScanner
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_client.Notify(ex);
|
||||
return BaseError.New(ex.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using System.Collections.Immutable;
|
||||
using System.IO.Abstractions;
|
||||
using Bugsnag;
|
||||
using CliWrap;
|
||||
using ErsatzTV.Core;
|
||||
using ErsatzTV.Core.Domain;
|
||||
@@ -55,7 +54,6 @@ public abstract class LocalFolderScanner
|
||||
"yml"
|
||||
}.ToImmutableHashSet(StringComparer.OrdinalIgnoreCase);
|
||||
|
||||
private readonly IClient _client;
|
||||
private readonly IFFmpegPngService _ffmpegPngService;
|
||||
|
||||
private readonly IImageCache _imageCache;
|
||||
@@ -75,7 +73,6 @@ public abstract class LocalFolderScanner
|
||||
IImageCache imageCache,
|
||||
IFFmpegPngService ffmpegPngService,
|
||||
ITempFilePool tempFilePool,
|
||||
IClient client,
|
||||
ILogger logger)
|
||||
{
|
||||
_fileSystem = fileSystem;
|
||||
@@ -85,7 +82,6 @@ public abstract class LocalFolderScanner
|
||||
_imageCache = imageCache;
|
||||
_ffmpegPngService = ffmpegPngService;
|
||||
_tempFilePool = tempFilePool;
|
||||
_client = client;
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
@@ -129,7 +125,6 @@ public abstract class LocalFolderScanner
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_client.Notify(ex);
|
||||
return BaseError.New(ex.Message);
|
||||
}
|
||||
}
|
||||
@@ -278,7 +273,6 @@ public abstract class LocalFolderScanner
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogWarning(ex, "Error refreshing artwork");
|
||||
_client.Notify(ex);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -304,7 +298,6 @@ public abstract class LocalFolderScanner
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_client.Notify(ex);
|
||||
return BaseError.New(ex.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System.IO.Abstractions;
|
||||
using Bugsnag;
|
||||
using ErsatzTV.Core;
|
||||
using ErsatzTV.Core.Domain;
|
||||
using ErsatzTV.Core.Extensions;
|
||||
@@ -19,7 +18,6 @@ public class LocalMetadataProvider : ILocalMetadataProvider
|
||||
{
|
||||
private readonly IArtistNfoReader _artistNfoReader;
|
||||
private readonly IArtistRepository _artistRepository;
|
||||
private readonly IClient _client;
|
||||
private readonly IEpisodeNfoReader _episodeNfoReader;
|
||||
private readonly IFallbackMetadataProvider _fallbackMetadataProvider;
|
||||
private readonly IFileSystem _fileSystem;
|
||||
@@ -57,7 +55,6 @@ public class LocalMetadataProvider : ILocalMetadataProvider
|
||||
IShowNfoReader showNfoReader,
|
||||
IOtherVideoNfoReader otherVideoNfoReader,
|
||||
ILocalStatisticsProvider localStatisticsProvider,
|
||||
IClient client,
|
||||
ILogger<LocalMetadataProvider> logger)
|
||||
{
|
||||
_metadataRepository = metadataRepository;
|
||||
@@ -78,7 +75,6 @@ public class LocalMetadataProvider : ILocalMetadataProvider
|
||||
_showNfoReader = showNfoReader;
|
||||
_otherVideoNfoReader = otherVideoNfoReader;
|
||||
_localStatisticsProvider = localStatisticsProvider;
|
||||
_client = client;
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
@@ -345,7 +341,6 @@ public class LocalMetadataProvider : ILocalMetadataProvider
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogInformation(ex, "Failed to read music video nfo metadata from {Path}", nfoFileName);
|
||||
_client.Notify(ex);
|
||||
return None;
|
||||
}
|
||||
}
|
||||
@@ -430,7 +425,6 @@ public class LocalMetadataProvider : ILocalMetadataProvider
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogInformation(ex, "Failed to read embedded song metadata from {Path}", path);
|
||||
_client.Notify(ex);
|
||||
return None;
|
||||
}
|
||||
}
|
||||
@@ -498,7 +492,6 @@ public class LocalMetadataProvider : ILocalMetadataProvider
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogInformation(ex, "Failed to read embedded song metadata from {Path}", path);
|
||||
_client.Notify(ex);
|
||||
return None;
|
||||
}
|
||||
}
|
||||
@@ -554,7 +547,6 @@ public class LocalMetadataProvider : ILocalMetadataProvider
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogInformation(ex, "Failed to read embedded remote stream metadata from {Path}", path);
|
||||
_client.Notify(ex);
|
||||
return None;
|
||||
}
|
||||
}
|
||||
@@ -1327,7 +1319,6 @@ public class LocalMetadataProvider : ILocalMetadataProvider
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogInformation(ex, "Failed to read TV show nfo metadata from {Path}", nfoFileName);
|
||||
_client.Notify(ex);
|
||||
return None;
|
||||
}
|
||||
}
|
||||
@@ -1367,7 +1358,6 @@ public class LocalMetadataProvider : ILocalMetadataProvider
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogInformation(ex, "Failed to read artist nfo metadata from {Path}", nfoFileName);
|
||||
_client.Notify(ex);
|
||||
return None;
|
||||
}
|
||||
}
|
||||
@@ -1422,7 +1412,6 @@ public class LocalMetadataProvider : ILocalMetadataProvider
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogInformation(ex, "Failed to read TV episode nfo metadata from {Path}", nfoFileName);
|
||||
_client.Notify(ex);
|
||||
return _fallbackMetadataProvider.GetFallbackMetadata(episode);
|
||||
}
|
||||
}
|
||||
@@ -1509,7 +1498,6 @@ public class LocalMetadataProvider : ILocalMetadataProvider
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogInformation(ex, "Failed to read Movie nfo metadata from {Path}", nfoFileName);
|
||||
_client.Notify(ex);
|
||||
return _fallbackMetadataProvider.GetFallbackMetadata(movie);
|
||||
}
|
||||
}
|
||||
@@ -1583,7 +1571,6 @@ public class LocalMetadataProvider : ILocalMetadataProvider
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogInformation(ex, "Failed to read OtherVideo nfo metadata from {Path}", nfoFileName);
|
||||
_client.Notify(ex);
|
||||
}
|
||||
|
||||
return None;
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using System.Collections.Immutable;
|
||||
using System.IO.Abstractions;
|
||||
using Bugsnag;
|
||||
using ErsatzTV.Core;
|
||||
using ErsatzTV.Core.Domain;
|
||||
using ErsatzTV.Core.Errors;
|
||||
@@ -20,7 +19,6 @@ namespace ErsatzTV.Scanner.Core.Metadata;
|
||||
|
||||
public class MovieFolderScanner : LocalFolderScanner, IMovieFolderScanner
|
||||
{
|
||||
private readonly IClient _client;
|
||||
private readonly ILibraryRepository _libraryRepository;
|
||||
private readonly ILocalChaptersProvider _localChaptersProvider;
|
||||
private readonly IScannerProxy _scannerProxy;
|
||||
@@ -48,7 +46,6 @@ public class MovieFolderScanner : LocalFolderScanner, IMovieFolderScanner
|
||||
IMediaItemRepository mediaItemRepository,
|
||||
IFFmpegPngService ffmpegPngService,
|
||||
ITempFilePool tempFilePool,
|
||||
IClient client,
|
||||
ILogger<MovieFolderScanner> logger)
|
||||
: base(
|
||||
fileSystem,
|
||||
@@ -58,7 +55,6 @@ public class MovieFolderScanner : LocalFolderScanner, IMovieFolderScanner
|
||||
imageCache,
|
||||
ffmpegPngService,
|
||||
tempFilePool,
|
||||
client,
|
||||
logger)
|
||||
{
|
||||
_scannerProxy = scannerProxy;
|
||||
@@ -71,7 +67,6 @@ public class MovieFolderScanner : LocalFolderScanner, IMovieFolderScanner
|
||||
_metadataRepository = metadataRepository;
|
||||
_libraryRepository = libraryRepository;
|
||||
_mediaItemRepository = mediaItemRepository;
|
||||
_client = client;
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
@@ -301,7 +296,6 @@ public class MovieFolderScanner : LocalFolderScanner, IMovieFolderScanner
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_client.Notify(ex);
|
||||
return BaseError.New(ex.ToString());
|
||||
}
|
||||
}
|
||||
@@ -332,7 +326,6 @@ public class MovieFolderScanner : LocalFolderScanner, IMovieFolderScanner
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_client.Notify(ex);
|
||||
return BaseError.New(ex.ToString());
|
||||
}
|
||||
}
|
||||
@@ -348,7 +341,6 @@ public class MovieFolderScanner : LocalFolderScanner, IMovieFolderScanner
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_client.Notify(ex);
|
||||
return BaseError.New(ex.ToString());
|
||||
}
|
||||
}
|
||||
@@ -364,7 +356,6 @@ public class MovieFolderScanner : LocalFolderScanner, IMovieFolderScanner
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_client.Notify(ex);
|
||||
return BaseError.New(ex.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using System.Collections.Immutable;
|
||||
using System.IO.Abstractions;
|
||||
using Bugsnag;
|
||||
using ErsatzTV.Core;
|
||||
using ErsatzTV.Core.Domain;
|
||||
using ErsatzTV.Core.Errors;
|
||||
@@ -20,7 +19,6 @@ namespace ErsatzTV.Scanner.Core.Metadata;
|
||||
public class MusicVideoFolderScanner : LocalFolderScanner, IMusicVideoFolderScanner
|
||||
{
|
||||
private readonly IArtistRepository _artistRepository;
|
||||
private readonly IClient _client;
|
||||
private readonly ILibraryRepository _libraryRepository;
|
||||
private readonly ILocalChaptersProvider _localChaptersProvider;
|
||||
private readonly IMetadataRepository _metadataRepository;
|
||||
@@ -49,7 +47,6 @@ public class MusicVideoFolderScanner : LocalFolderScanner, IMusicVideoFolderScan
|
||||
IMediaItemRepository mediaItemRepository,
|
||||
IFFmpegPngService ffmpegPngService,
|
||||
ITempFilePool tempFilePool,
|
||||
IClient client,
|
||||
ILogger<MusicVideoFolderScanner> logger) : base(
|
||||
fileSystem,
|
||||
localStatisticsProvider,
|
||||
@@ -58,7 +55,6 @@ public class MusicVideoFolderScanner : LocalFolderScanner, IMusicVideoFolderScan
|
||||
imageCache,
|
||||
ffmpegPngService,
|
||||
tempFilePool,
|
||||
client,
|
||||
logger)
|
||||
{
|
||||
_scannerProxy = scannerProxy;
|
||||
@@ -72,7 +68,6 @@ public class MusicVideoFolderScanner : LocalFolderScanner, IMusicVideoFolderScan
|
||||
_musicVideoRepository = musicVideoRepository;
|
||||
_libraryRepository = libraryRepository;
|
||||
_mediaItemRepository = mediaItemRepository;
|
||||
_client = client;
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
@@ -267,7 +262,6 @@ public class MusicVideoFolderScanner : LocalFolderScanner, IMusicVideoFolderScan
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_client.Notify(ex);
|
||||
return BaseError.New(ex.ToString());
|
||||
}
|
||||
}
|
||||
@@ -299,7 +293,6 @@ public class MusicVideoFolderScanner : LocalFolderScanner, IMusicVideoFolderScan
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_client.Notify(ex);
|
||||
return BaseError.New(ex.ToString());
|
||||
}
|
||||
}
|
||||
@@ -467,7 +460,6 @@ public class MusicVideoFolderScanner : LocalFolderScanner, IMusicVideoFolderScan
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_client.Notify(ex);
|
||||
return BaseError.New(ex.ToString());
|
||||
}
|
||||
}
|
||||
@@ -525,7 +517,6 @@ public class MusicVideoFolderScanner : LocalFolderScanner, IMusicVideoFolderScan
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_client.Notify(ex);
|
||||
return BaseError.New(ex.ToString());
|
||||
}
|
||||
}
|
||||
@@ -541,7 +532,6 @@ public class MusicVideoFolderScanner : LocalFolderScanner, IMusicVideoFolderScan
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_client.Notify(ex);
|
||||
return BaseError.New(ex.ToString());
|
||||
}
|
||||
}
|
||||
@@ -557,7 +547,6 @@ public class MusicVideoFolderScanner : LocalFolderScanner, IMusicVideoFolderScan
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_client.Notify(ex);
|
||||
return BaseError.New(ex.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System.Xml;
|
||||
using Bugsnag;
|
||||
using ErsatzTV.Core;
|
||||
using ErsatzTV.Core.Errors;
|
||||
using ErsatzTV.Scanner.Core.Interfaces.Metadata.Nfo;
|
||||
@@ -10,16 +9,13 @@ namespace ErsatzTV.Scanner.Core.Metadata.Nfo;
|
||||
|
||||
public class ArtistNfoReader : NfoReader<ArtistNfo>, IArtistNfoReader
|
||||
{
|
||||
private readonly IClient _client;
|
||||
private readonly ILogger<ArtistNfoReader> _logger;
|
||||
|
||||
public ArtistNfoReader(
|
||||
RecyclableMemoryStreamManager recyclableMemoryStreamManager,
|
||||
IClient client,
|
||||
ILogger<ArtistNfoReader> logger)
|
||||
: base(recyclableMemoryStreamManager, logger)
|
||||
{
|
||||
_client = client;
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
@@ -112,7 +108,6 @@ public class ArtistNfoReader : NfoReader<ArtistNfo>, IArtistNfoReader
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_client.Notify(ex);
|
||||
return new FailedToReadNfo(ex.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System.Xml;
|
||||
using Bugsnag;
|
||||
using ErsatzTV.Core;
|
||||
using ErsatzTV.Core.Errors;
|
||||
using ErsatzTV.Scanner.Core.Interfaces.Metadata.Nfo;
|
||||
@@ -10,16 +9,13 @@ namespace ErsatzTV.Scanner.Core.Metadata.Nfo;
|
||||
|
||||
public class EpisodeNfoReader : NfoReader<EpisodeNfo>, IEpisodeNfoReader
|
||||
{
|
||||
private readonly IClient _client;
|
||||
private readonly ILogger<EpisodeNfoReader> _logger;
|
||||
|
||||
public EpisodeNfoReader(
|
||||
RecyclableMemoryStreamManager recyclableMemoryStreamManager,
|
||||
IClient client,
|
||||
ILogger<EpisodeNfoReader> logger)
|
||||
: base(recyclableMemoryStreamManager, logger)
|
||||
{
|
||||
_client = client;
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
@@ -147,7 +143,6 @@ public class EpisodeNfoReader : NfoReader<EpisodeNfo>, IEpisodeNfoReader
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_client.Notify(ex);
|
||||
return new FailedToReadNfo(ex.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System.Xml;
|
||||
using Bugsnag;
|
||||
using ErsatzTV.Core;
|
||||
using ErsatzTV.Core.Errors;
|
||||
using ErsatzTV.Scanner.Core.Interfaces.Metadata.Nfo;
|
||||
@@ -10,16 +9,13 @@ namespace ErsatzTV.Scanner.Core.Metadata.Nfo;
|
||||
|
||||
public class MovieNfoReader : NfoReader<MovieNfo>, IMovieNfoReader
|
||||
{
|
||||
private readonly IClient _client;
|
||||
private readonly ILogger<MovieNfoReader> _logger;
|
||||
|
||||
public MovieNfoReader(
|
||||
RecyclableMemoryStreamManager recyclableMemoryStreamManager,
|
||||
IClient client,
|
||||
ILogger<MovieNfoReader> logger)
|
||||
: base(recyclableMemoryStreamManager, logger)
|
||||
{
|
||||
_client = client;
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
@@ -159,7 +155,6 @@ public class MovieNfoReader : NfoReader<MovieNfo>, IMovieNfoReader
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_client.Notify(ex);
|
||||
return new FailedToReadNfo(ex.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System.Xml;
|
||||
using Bugsnag;
|
||||
using ErsatzTV.Core;
|
||||
using ErsatzTV.Core.Errors;
|
||||
using ErsatzTV.Scanner.Core.Interfaces.Metadata.Nfo;
|
||||
@@ -10,16 +9,13 @@ namespace ErsatzTV.Scanner.Core.Metadata.Nfo;
|
||||
|
||||
public class MusicVideoNfoReader : NfoReader<MusicVideoNfo>, IMusicVideoNfoReader
|
||||
{
|
||||
private readonly IClient _client;
|
||||
private readonly ILogger<MusicVideoNfoReader> _logger;
|
||||
|
||||
public MusicVideoNfoReader(
|
||||
RecyclableMemoryStreamManager recyclableMemoryStreamManager,
|
||||
IClient client,
|
||||
ILogger<MusicVideoNfoReader> logger)
|
||||
: base(recyclableMemoryStreamManager, logger)
|
||||
{
|
||||
_client = client;
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
@@ -147,7 +143,6 @@ public class MusicVideoNfoReader : NfoReader<MusicVideoNfo>, IMusicVideoNfoReade
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_client.Notify(ex);
|
||||
return new FailedToReadNfo(ex.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System.Xml;
|
||||
using Bugsnag;
|
||||
using ErsatzTV.Core;
|
||||
using ErsatzTV.Core.Errors;
|
||||
using ErsatzTV.Scanner.Core.Interfaces.Metadata.Nfo;
|
||||
@@ -10,16 +9,13 @@ namespace ErsatzTV.Scanner.Core.Metadata.Nfo;
|
||||
|
||||
public class OtherVideoNfoReader : NfoReader<OtherVideoNfo>, IOtherVideoNfoReader
|
||||
{
|
||||
private readonly IClient _client;
|
||||
private readonly ILogger<OtherVideoNfoReader> _logger;
|
||||
|
||||
public OtherVideoNfoReader(
|
||||
RecyclableMemoryStreamManager recyclableMemoryStreamManager,
|
||||
IClient client,
|
||||
ILogger<OtherVideoNfoReader> logger)
|
||||
: base(recyclableMemoryStreamManager, logger)
|
||||
{
|
||||
_client = client;
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
@@ -159,7 +155,6 @@ public class OtherVideoNfoReader : NfoReader<OtherVideoNfo>, IOtherVideoNfoReade
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_client.Notify(ex);
|
||||
return new FailedToReadNfo(ex.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System.Xml;
|
||||
using Bugsnag;
|
||||
using ErsatzTV.Core;
|
||||
using ErsatzTV.Core.Errors;
|
||||
using ErsatzTV.Scanner.Core.Interfaces.Metadata.Nfo;
|
||||
@@ -10,16 +9,13 @@ namespace ErsatzTV.Scanner.Core.Metadata.Nfo;
|
||||
|
||||
public class ShowNfoReader : NfoReader<ShowNfo>, IShowNfoReader
|
||||
{
|
||||
private readonly IClient _client;
|
||||
private readonly ILogger<ShowNfoReader> _logger;
|
||||
|
||||
public ShowNfoReader(
|
||||
RecyclableMemoryStreamManager recyclableMemoryStreamManager,
|
||||
IClient client,
|
||||
ILogger<ShowNfoReader> logger)
|
||||
: base(recyclableMemoryStreamManager, logger)
|
||||
{
|
||||
_client = client;
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
@@ -140,7 +136,6 @@ public class ShowNfoReader : NfoReader<ShowNfo>, IShowNfoReader
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_client.Notify(ex);
|
||||
return new FailedToReadNfo(ex.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using System.Collections.Immutable;
|
||||
using System.IO.Abstractions;
|
||||
using Bugsnag;
|
||||
using ErsatzTV.Core;
|
||||
using ErsatzTV.Core.Domain;
|
||||
using ErsatzTV.Core.Errors;
|
||||
@@ -19,7 +18,6 @@ namespace ErsatzTV.Scanner.Core.Metadata;
|
||||
|
||||
public class OtherVideoFolderScanner : LocalFolderScanner, IOtherVideoFolderScanner
|
||||
{
|
||||
private readonly IClient _client;
|
||||
private readonly ILibraryRepository _libraryRepository;
|
||||
private readonly ILocalChaptersProvider _localChaptersProvider;
|
||||
private readonly IMetadataRepository _metadataRepository;
|
||||
@@ -47,7 +45,6 @@ public class OtherVideoFolderScanner : LocalFolderScanner, IOtherVideoFolderScan
|
||||
IMediaItemRepository mediaItemRepository,
|
||||
IFFmpegPngService ffmpegPngService,
|
||||
ITempFilePool tempFilePool,
|
||||
IClient client,
|
||||
ILogger<OtherVideoFolderScanner> logger) : base(
|
||||
fileSystem,
|
||||
localStatisticsProvider,
|
||||
@@ -56,7 +53,6 @@ public class OtherVideoFolderScanner : LocalFolderScanner, IOtherVideoFolderScan
|
||||
imageCache,
|
||||
ffmpegPngService,
|
||||
tempFilePool,
|
||||
client,
|
||||
logger)
|
||||
{
|
||||
_scannerProxy = scannerProxy;
|
||||
@@ -69,7 +65,6 @@ public class OtherVideoFolderScanner : LocalFolderScanner, IOtherVideoFolderScan
|
||||
_otherVideoRepository = otherVideoRepository;
|
||||
_libraryRepository = libraryRepository;
|
||||
_mediaItemRepository = mediaItemRepository;
|
||||
_client = client;
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
@@ -316,7 +311,6 @@ public class OtherVideoFolderScanner : LocalFolderScanner, IOtherVideoFolderScan
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_client.Notify(ex);
|
||||
return BaseError.New(ex.ToString());
|
||||
}
|
||||
}
|
||||
@@ -332,7 +326,6 @@ public class OtherVideoFolderScanner : LocalFolderScanner, IOtherVideoFolderScan
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_client.Notify(ex);
|
||||
return BaseError.New(ex.ToString());
|
||||
}
|
||||
}
|
||||
@@ -348,7 +341,6 @@ public class OtherVideoFolderScanner : LocalFolderScanner, IOtherVideoFolderScan
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_client.Notify(ex);
|
||||
return BaseError.New(ex.ToString());
|
||||
}
|
||||
}
|
||||
@@ -379,7 +371,6 @@ public class OtherVideoFolderScanner : LocalFolderScanner, IOtherVideoFolderScan
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_client.Notify(ex);
|
||||
return BaseError.New(ex.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using System.Collections.Immutable;
|
||||
using System.IO.Abstractions;
|
||||
using Bugsnag;
|
||||
using ErsatzTV.Core;
|
||||
using ErsatzTV.Core.Domain;
|
||||
using ErsatzTV.Core.Errors;
|
||||
@@ -22,7 +21,6 @@ namespace ErsatzTV.Scanner.Core.Metadata;
|
||||
|
||||
public class RemoteStreamFolderScanner : LocalFolderScanner, IRemoteStreamFolderScanner
|
||||
{
|
||||
private readonly IClient _client;
|
||||
private readonly ILibraryRepository _libraryRepository;
|
||||
private readonly IScannerProxy _scannerProxy;
|
||||
private readonly IFileSystem _fileSystem;
|
||||
@@ -46,7 +44,6 @@ public class RemoteStreamFolderScanner : LocalFolderScanner, IRemoteStreamFolder
|
||||
IMediaItemRepository mediaItemRepository,
|
||||
IFFmpegPngService ffmpegPngService,
|
||||
ITempFilePool tempFilePool,
|
||||
IClient client,
|
||||
ILogger<RemoteStreamFolderScanner> logger) : base(
|
||||
fileSystem,
|
||||
localStatisticsProvider,
|
||||
@@ -55,7 +52,6 @@ public class RemoteStreamFolderScanner : LocalFolderScanner, IRemoteStreamFolder
|
||||
imageCache,
|
||||
ffmpegPngService,
|
||||
tempFilePool,
|
||||
client,
|
||||
logger)
|
||||
{
|
||||
_scannerProxy = scannerProxy;
|
||||
@@ -66,7 +62,6 @@ public class RemoteStreamFolderScanner : LocalFolderScanner, IRemoteStreamFolder
|
||||
_remoteStreamRepository = remoteStreamRepository;
|
||||
_libraryRepository = libraryRepository;
|
||||
_mediaItemRepository = mediaItemRepository;
|
||||
_client = client;
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
@@ -337,7 +332,6 @@ public class RemoteStreamFolderScanner : LocalFolderScanner, IRemoteStreamFolder
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_client.Notify(ex);
|
||||
return BaseError.New(ex.ToString());
|
||||
}
|
||||
}
|
||||
@@ -375,7 +369,6 @@ public class RemoteStreamFolderScanner : LocalFolderScanner, IRemoteStreamFolder
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_client.Notify(ex);
|
||||
return BaseError.New(ex.ToString());
|
||||
}
|
||||
}
|
||||
@@ -406,7 +399,6 @@ public class RemoteStreamFolderScanner : LocalFolderScanner, IRemoteStreamFolder
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_client.Notify(ex);
|
||||
return BaseError.New(ex.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using System.Collections.Immutable;
|
||||
using System.IO.Abstractions;
|
||||
using Bugsnag;
|
||||
using ErsatzTV.Core;
|
||||
using ErsatzTV.Core.Domain;
|
||||
using ErsatzTV.Core.Errors;
|
||||
@@ -19,7 +18,6 @@ namespace ErsatzTV.Scanner.Core.Metadata;
|
||||
|
||||
public class SongFolderScanner : LocalFolderScanner, ISongFolderScanner
|
||||
{
|
||||
private readonly IClient _client;
|
||||
private readonly ILibraryRepository _libraryRepository;
|
||||
private readonly IScannerProxy _scannerProxy;
|
||||
private readonly IFileSystem _fileSystem;
|
||||
@@ -43,7 +41,6 @@ public class SongFolderScanner : LocalFolderScanner, ISongFolderScanner
|
||||
IMediaItemRepository mediaItemRepository,
|
||||
IFFmpegPngService ffmpegPngService,
|
||||
ITempFilePool tempFilePool,
|
||||
IClient client,
|
||||
ILogger<SongFolderScanner> logger) : base(
|
||||
fileSystem,
|
||||
localStatisticsProvider,
|
||||
@@ -52,7 +49,6 @@ public class SongFolderScanner : LocalFolderScanner, ISongFolderScanner
|
||||
imageCache,
|
||||
ffmpegPngService,
|
||||
tempFilePool,
|
||||
client,
|
||||
logger)
|
||||
{
|
||||
_scannerProxy = scannerProxy;
|
||||
@@ -63,7 +59,6 @@ public class SongFolderScanner : LocalFolderScanner, ISongFolderScanner
|
||||
_songRepository = songRepository;
|
||||
_libraryRepository = libraryRepository;
|
||||
_mediaItemRepository = mediaItemRepository;
|
||||
_client = client;
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
@@ -278,7 +273,6 @@ public class SongFolderScanner : LocalFolderScanner, ISongFolderScanner
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_client.Notify(ex);
|
||||
return BaseError.New(ex.ToString());
|
||||
}
|
||||
}
|
||||
@@ -332,7 +326,6 @@ public class SongFolderScanner : LocalFolderScanner, ISongFolderScanner
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_client.Notify(ex);
|
||||
return BaseError.New(ex.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using System.Collections.Immutable;
|
||||
using System.IO.Abstractions;
|
||||
using Bugsnag;
|
||||
using ErsatzTV.Core;
|
||||
using ErsatzTV.Core.Domain;
|
||||
using ErsatzTV.Core.Errors;
|
||||
@@ -19,7 +18,6 @@ namespace ErsatzTV.Scanner.Core.Metadata;
|
||||
|
||||
public class TelevisionFolderScanner : LocalFolderScanner, ITelevisionFolderScanner
|
||||
{
|
||||
private readonly IClient _client;
|
||||
private readonly IFallbackMetadataProvider _fallbackMetadataProvider;
|
||||
private readonly ILibraryRepository _libraryRepository;
|
||||
private readonly ILocalChaptersProvider _localChaptersProvider;
|
||||
@@ -48,7 +46,6 @@ public class TelevisionFolderScanner : LocalFolderScanner, ITelevisionFolderScan
|
||||
IMediaItemRepository mediaItemRepository,
|
||||
IFFmpegPngService ffmpegPngService,
|
||||
ITempFilePool tempFilePool,
|
||||
IClient client,
|
||||
IFallbackMetadataProvider fallbackMetadataProvider,
|
||||
ILogger<TelevisionFolderScanner> logger) : base(
|
||||
fileSystem,
|
||||
@@ -58,7 +55,6 @@ public class TelevisionFolderScanner : LocalFolderScanner, ITelevisionFolderScan
|
||||
imageCache,
|
||||
ffmpegPngService,
|
||||
tempFilePool,
|
||||
client,
|
||||
logger)
|
||||
{
|
||||
_scannerProxy = scannerProxy;
|
||||
@@ -71,7 +67,6 @@ public class TelevisionFolderScanner : LocalFolderScanner, ITelevisionFolderScan
|
||||
_metadataRepository = metadataRepository;
|
||||
_libraryRepository = libraryRepository;
|
||||
_mediaItemRepository = mediaItemRepository;
|
||||
_client = client;
|
||||
_fallbackMetadataProvider = fallbackMetadataProvider;
|
||||
_logger = logger;
|
||||
}
|
||||
@@ -407,7 +402,6 @@ public class TelevisionFolderScanner : LocalFolderScanner, ITelevisionFolderScan
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_client.Notify(ex);
|
||||
return BaseError.New(ex.ToString());
|
||||
}
|
||||
}
|
||||
@@ -483,7 +477,6 @@ public class TelevisionFolderScanner : LocalFolderScanner, ITelevisionFolderScan
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_client.Notify(ex);
|
||||
return BaseError.New(ex.ToString());
|
||||
}
|
||||
}
|
||||
@@ -515,7 +508,6 @@ public class TelevisionFolderScanner : LocalFolderScanner, ITelevisionFolderScan
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_client.Notify(ex);
|
||||
return BaseError.New(ex.ToString());
|
||||
}
|
||||
}
|
||||
@@ -545,7 +537,6 @@ public class TelevisionFolderScanner : LocalFolderScanner, ITelevisionFolderScan
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_client.Notify(ex);
|
||||
return BaseError.New(ex.ToString());
|
||||
}
|
||||
}
|
||||
@@ -578,7 +569,6 @@ public class TelevisionFolderScanner : LocalFolderScanner, ITelevisionFolderScan
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_client.Notify(ex);
|
||||
return BaseError.New(ex.ToString());
|
||||
}
|
||||
}
|
||||
@@ -592,7 +582,6 @@ public class TelevisionFolderScanner : LocalFolderScanner, ITelevisionFolderScan
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_client.Notify(ex);
|
||||
return BaseError.New(ex.ToString());
|
||||
}
|
||||
}
|
||||
@@ -606,7 +595,6 @@ public class TelevisionFolderScanner : LocalFolderScanner, ITelevisionFolderScan
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_client.Notify(ex);
|
||||
return BaseError.New(ex.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
using System.IO.Abstractions;
|
||||
using Bugsnag;
|
||||
using Bugsnag.Payload;
|
||||
using Dapper;
|
||||
using ErsatzTV.Core;
|
||||
using ErsatzTV.Core.Emby;
|
||||
@@ -51,7 +49,6 @@ using Serilog.Events;
|
||||
using Serilog.Formatting.Compact;
|
||||
using Testably.Abstractions;
|
||||
using Exception = System.Exception;
|
||||
using IConfiguration = Bugsnag.IConfiguration;
|
||||
|
||||
namespace ErsatzTV.Scanner;
|
||||
|
||||
@@ -254,8 +251,6 @@ public class Program
|
||||
services.AddSingleton<SearchQueryParser>();
|
||||
services.AddSingleton<ISearchIndex, LuceneSearchIndex>();
|
||||
services.AddSingleton<RecyclableMemoryStreamManager>();
|
||||
// TODO: real bugsnag?
|
||||
services.AddSingleton<IClient>(_ => new BugsnagNoopClient());
|
||||
services.AddSingleton<IScannerProxy, ScannerProxy>();
|
||||
services.AddSingleton<ILanguageCodeCache, LanguageCodeCache>();
|
||||
|
||||
@@ -271,43 +266,4 @@ public class Program
|
||||
})
|
||||
.UseSerilog();
|
||||
}
|
||||
|
||||
private class BugsnagNoopClient : IClient
|
||||
{
|
||||
public void Notify(Exception exception)
|
||||
{
|
||||
}
|
||||
|
||||
public void Notify(Exception exception, Middleware callback)
|
||||
{
|
||||
}
|
||||
|
||||
public void Notify(Exception exception, Severity severity)
|
||||
{
|
||||
}
|
||||
|
||||
public void Notify(Exception exception, Severity severity, Middleware callback)
|
||||
{
|
||||
}
|
||||
|
||||
public void Notify(Exception exception, HandledState handledState)
|
||||
{
|
||||
}
|
||||
|
||||
public void Notify(Exception exception, HandledState handledState, Middleware callback)
|
||||
{
|
||||
}
|
||||
|
||||
public void Notify(Report report, Middleware callback)
|
||||
{
|
||||
}
|
||||
|
||||
public void BeforeNotify(Middleware middleware)
|
||||
{
|
||||
}
|
||||
|
||||
public IBreadcrumbs Breadcrumbs => new Breadcrumbs(Configuration);
|
||||
public ISessionTracker SessionTracking => new SessionTracker(Configuration);
|
||||
public IConfiguration Configuration => new Configuration();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,7 +32,6 @@
|
||||
<!-- <PackageReference Include="EntityFrameworkProfiler.Appender" Version="6.0.6049" /> -->
|
||||
<PackageReference Include="Blazored.FluentValidation" Version="2.2.0" />
|
||||
<PackageReference Include="BlazorSortable" Version="5.2.1" />
|
||||
<PackageReference Include="Bugsnag.AspNet.Core" Version="4.1.0" />
|
||||
<PackageReference Include="Chronic.Core" Version="0.4.0" />
|
||||
<PackageReference Include="FluentValidation" Version="12.1.1" />
|
||||
<PackageReference Include="FluentValidation.AspNetCore" Version="11.3.1" />
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System.Threading.Channels;
|
||||
using Bugsnag;
|
||||
using ErsatzTV.Application;
|
||||
using ErsatzTV.Application.Emby;
|
||||
using ErsatzTV.Core;
|
||||
@@ -71,19 +70,6 @@ public class EmbyService : BackgroundService
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogWarning(ex, "Failed to process Emby background service request");
|
||||
|
||||
try
|
||||
{
|
||||
using (IServiceScope scope = _serviceScopeFactory.CreateScope())
|
||||
{
|
||||
IClient client = scope.ServiceProvider.GetRequiredService<IClient>();
|
||||
client.Notify(ex);
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System.Threading.Channels;
|
||||
using Bugsnag;
|
||||
using ErsatzTV.Application;
|
||||
using ErsatzTV.Application.Streaming;
|
||||
using ErsatzTV.Application.Troubleshooting;
|
||||
@@ -61,16 +60,6 @@ public class FFmpegWorkerService : BackgroundService
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogWarning(ex, "Failed to handle ffmpeg worker request");
|
||||
|
||||
try
|
||||
{
|
||||
IClient client = scope.ServiceProvider.GetRequiredService<IClient>();
|
||||
client.Notify(ex);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System.Threading.Channels;
|
||||
using Bugsnag;
|
||||
using ErsatzTV.Application;
|
||||
using ErsatzTV.Application.Jellyfin;
|
||||
using ErsatzTV.Core;
|
||||
@@ -71,19 +70,6 @@ public class JellyfinService : BackgroundService
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogWarning(ex, "Failed to process Jellyfin background service request");
|
||||
|
||||
try
|
||||
{
|
||||
using (IServiceScope scope = _serviceScopeFactory.CreateScope())
|
||||
{
|
||||
IClient client = scope.ServiceProvider.GetRequiredService<IClient>();
|
||||
client.Notify(ex);
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System.Threading.Channels;
|
||||
using Bugsnag;
|
||||
using ErsatzTV.Application;
|
||||
using ErsatzTV.Application.Plex;
|
||||
using ErsatzTV.Core;
|
||||
@@ -74,19 +73,6 @@ public class PlexService : BackgroundService
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogWarning(ex, "Failed to process plex background service request");
|
||||
|
||||
try
|
||||
{
|
||||
using (IServiceScope scope = _serviceScopeFactory.CreateScope())
|
||||
{
|
||||
IClient client = scope.ServiceProvider.GetRequiredService<IClient>();
|
||||
client.Notify(ex);
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System.Threading.Channels;
|
||||
using Bugsnag;
|
||||
using ErsatzTV.Application;
|
||||
using ErsatzTV.Application.Emby;
|
||||
using ErsatzTV.Application.Jellyfin;
|
||||
@@ -90,17 +89,6 @@ public class ScannerService : BackgroundService
|
||||
catch (Exception ex) when (ex is not (TaskCanceledException or OperationCanceledException))
|
||||
{
|
||||
_logger.LogWarning(ex, "Failed to process scanner background service request");
|
||||
|
||||
try
|
||||
{
|
||||
using IServiceScope scope = _serviceScopeFactory.CreateScope();
|
||||
IClient client = scope.ServiceProvider.GetRequiredService<IClient>();
|
||||
client.Notify(ex);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using System.Globalization;
|
||||
using System.Threading.Channels;
|
||||
using Bugsnag;
|
||||
using ErsatzTV.Application;
|
||||
using ErsatzTV.Application.Channels;
|
||||
using ErsatzTV.Application.Emby;
|
||||
@@ -143,19 +142,6 @@ public class SchedulerService : BackgroundService
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogWarning(ex, "Error during scheduler run");
|
||||
|
||||
try
|
||||
{
|
||||
using (IServiceScope scope = _serviceScopeFactory.CreateScope())
|
||||
{
|
||||
IClient client = scope.ServiceProvider.GetRequiredService<IClient>();
|
||||
client.Notify(ex);
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -190,19 +176,6 @@ public class SchedulerService : BackgroundService
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogWarning(ex, "Error during scheduler run");
|
||||
|
||||
try
|
||||
{
|
||||
using (IServiceScope scope = _serviceScopeFactory.CreateScope())
|
||||
{
|
||||
IClient client = scope.ServiceProvider.GetRequiredService<IClient>();
|
||||
client.Notify(ex);
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System.Threading.Channels;
|
||||
using Bugsnag;
|
||||
using ErsatzTV.Application;
|
||||
using ErsatzTV.Application.Search;
|
||||
using ErsatzTV.Core;
|
||||
@@ -157,16 +156,6 @@ public class SearchIndexService : BackgroundService
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogWarning(ex, "Failed to handle search index batch worker request");
|
||||
|
||||
try
|
||||
{
|
||||
IClient client = scope.ServiceProvider.GetRequiredService<IClient>();
|
||||
client.Notify(ex);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using System.Diagnostics;
|
||||
using System.Threading.Channels;
|
||||
using Bugsnag;
|
||||
using ErsatzTV.Application;
|
||||
using ErsatzTV.Application.Channels;
|
||||
using ErsatzTV.Application.FFmpeg;
|
||||
@@ -137,16 +136,6 @@ public class WorkerService : BackgroundService
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogWarning(ex, "Failed to process background service request");
|
||||
|
||||
try
|
||||
{
|
||||
IClient client = scope.ServiceProvider.GetRequiredService<IClient>();
|
||||
client.Notify(ex);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,6 @@ using System.Text;
|
||||
using System.Text.Json.Serialization;
|
||||
using System.Threading.Channels;
|
||||
using BlazorSortable;
|
||||
using Bugsnag.AspNet.Core;
|
||||
using Dapper;
|
||||
using ErsatzTV.Application;
|
||||
using ErsatzTV.Application.Channels;
|
||||
@@ -132,25 +131,6 @@ public class Startup
|
||||
options.KnownProxies.Clear();
|
||||
});
|
||||
|
||||
services.AddBugsnag(configuration =>
|
||||
{
|
||||
configuration.ApiKey = bugsnagConfig.ApiKey;
|
||||
configuration.ProjectNamespaces = new[] { "ErsatzTV" };
|
||||
configuration.AppVersion = Assembly.GetEntryAssembly()
|
||||
?.GetCustomAttribute<AssemblyInformationalVersionAttribute>()
|
||||
?.InformationalVersion ?? "unknown";
|
||||
configuration.AutoNotify = true;
|
||||
|
||||
configuration.NotifyReleaseStages = new[] { "public", "develop" };
|
||||
|
||||
#if DEBUG || DEBUG_NO_SYNC
|
||||
configuration.ReleaseStage = "develop";
|
||||
#else
|
||||
// effectively "disable" by tweaking app config
|
||||
configuration.ReleaseStage = bugsnagConfig.Enable ? "public" : "private";
|
||||
#endif
|
||||
});
|
||||
|
||||
services.AddDataProtection().PersistKeysToFileSystem(new DirectoryInfo(FileSystemLayout.DataProtectionFolder));
|
||||
|
||||
services.AddOpenApi("v1", options => { options.ShouldInclude += a => a.GroupName == "general"; });
|
||||
@@ -774,7 +754,6 @@ public class Startup
|
||||
services.AddScoped<IFileNotFoundHealthCheck, FileNotFoundHealthCheck>();
|
||||
services.AddScoped<IUnavailableHealthCheck, UnavailableHealthCheck>();
|
||||
services.AddScoped<IVaapiDriverHealthCheck, VaapiDriverHealthCheck>();
|
||||
services.AddScoped<IErrorReportsHealthCheck, ErrorReportsHealthCheck>();
|
||||
services.AddScoped<IUnifiedDockerHealthCheck, UnifiedDockerHealthCheck>();
|
||||
services.AddScoped<IDowngradeHealthCheck, DowngradeHealthCheck>();
|
||||
services.AddScoped<IEmptyScheduleHealthCheck, EmptyScheduleHealthCheck>();
|
||||
|
||||
@@ -15,12 +15,5 @@
|
||||
"WithThreadId"
|
||||
]
|
||||
},
|
||||
"AllowedHosts": "*",
|
||||
"Trakt": {
|
||||
"ClientId": "e30585c7db49eaf1bd80d7ce5296d5de0bb33e1166f323cd7202412a605c609a"
|
||||
},
|
||||
"Bugsnag": {
|
||||
"ApiKey": "f59f3cc93cce91210a5c0f047eb2047c",
|
||||
"Enable": true
|
||||
}
|
||||
"AllowedHosts": "*"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user