Remove warnings

pull/7039/head
Joe Rogers 3 years ago
parent 6e4710d048
commit b03f56c3d6
No known key found for this signature in database
GPG Key ID: 0074AD57B8FDBBB4

@ -164,6 +164,10 @@ namespace MediaBrowser.Providers.Manager
{ {
contentType = "image/png"; contentType = "image/png";
} }
else
{
throw new HttpRequestException("Invalid image received: contentType not set.", null, response.StatusCode);
}
} }
// thetvdb will sometimes serve a rubbish 404 html page with a 200 OK code, because reasons... // thetvdb will sometimes serve a rubbish 404 html page with a 200 OK code, because reasons...
@ -589,7 +593,7 @@ namespace MediaBrowser.Providers.Manager
foreach (var saver in savers.Where(i => IsSaverEnabledForItem(i, item, libraryOptions, updateType, false))) foreach (var saver in savers.Where(i => IsSaverEnabledForItem(i, item, libraryOptions, updateType, false)))
{ {
_logger.LogDebug("Saving {0} to {1}.", item.Path ?? item.Name, saver.Name); _logger.LogDebug("Saving {Item} to {Saver}", item.Path ?? item.Name, saver.Name);
if (saver is IMetadataFileSaver fileSaver) if (saver is IMetadataFileSaver fileSaver)
{ {
@ -601,7 +605,7 @@ namespace MediaBrowser.Providers.Manager
} }
catch (Exception ex) catch (Exception ex)
{ {
_logger.LogError(ex, "Error in {0} GetSavePath", saver.Name); _logger.LogError(ex, "Error in {Saver} GetSavePath", saver.Name);
continue; continue;
} }
@ -688,7 +692,7 @@ namespace MediaBrowser.Providers.Manager
} }
catch (Exception ex) catch (Exception ex)
{ {
_logger.LogError(ex, "Error in {0}.IsEnabledFor", saver.Name); _logger.LogError(ex, "Error in {Saver}.IsEnabledFor", saver.Name);
return false; return false;
} }
} }
@ -838,7 +842,7 @@ namespace MediaBrowser.Providers.Manager
} }
catch (Exception ex) catch (Exception ex)
{ {
_logger.LogError(ex, "Error in {0}.Supports", i.GetType().Name); _logger.LogError(ex, "Error in {Type}.Supports", i.GetType().Name);
return false; return false;
} }
}); });
@ -904,7 +908,7 @@ namespace MediaBrowser.Providers.Manager
/// <inheritdoc/> /// <inheritdoc/>
public void OnRefreshStart(BaseItem item) public void OnRefreshStart(BaseItem item)
{ {
_logger.LogDebug("OnRefreshStart {0}", item.Id.ToString("N", CultureInfo.InvariantCulture)); _logger.LogDebug("OnRefreshStart {Item}", item.Id.ToString("N", CultureInfo.InvariantCulture));
_activeRefreshes[item.Id] = 0; _activeRefreshes[item.Id] = 0;
RefreshStarted?.Invoke(this, new GenericEventArgs<BaseItem>(item)); RefreshStarted?.Invoke(this, new GenericEventArgs<BaseItem>(item));
} }
@ -912,7 +916,7 @@ namespace MediaBrowser.Providers.Manager
/// <inheritdoc/> /// <inheritdoc/>
public void OnRefreshComplete(BaseItem item) public void OnRefreshComplete(BaseItem item)
{ {
_logger.LogDebug("OnRefreshComplete {0}", item.Id.ToString("N", CultureInfo.InvariantCulture)); _logger.LogDebug("OnRefreshComplete {Item}", item.Id.ToString("N", CultureInfo.InvariantCulture));
_activeRefreshes.Remove(item.Id, out _); _activeRefreshes.Remove(item.Id, out _);
@ -934,7 +938,7 @@ namespace MediaBrowser.Providers.Manager
public void OnRefreshProgress(BaseItem item, double progress) public void OnRefreshProgress(BaseItem item, double progress)
{ {
var id = item.Id; var id = item.Id;
_logger.LogDebug("OnRefreshProgress {0} {1}", id.ToString("N", CultureInfo.InvariantCulture), progress); _logger.LogDebug("OnRefreshProgress {Id} {Progress}", id.ToString("N", CultureInfo.InvariantCulture), progress);
// TODO: Need to hunt down the conditions for this happening // TODO: Need to hunt down the conditions for this happening
_activeRefreshes.AddOrUpdate( _activeRefreshes.AddOrUpdate(

@ -1,21 +1,29 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Net.Http;
using System.Runtime.CompilerServices;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using MediaBrowser.Controller;
using MediaBrowser.Controller.BaseItemManager; using MediaBrowser.Controller.BaseItemManager;
using MediaBrowser.Controller.Configuration; using MediaBrowser.Controller.Configuration;
using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Entities.Movies; using MediaBrowser.Controller.Entities.Movies;
using MediaBrowser.Controller.Library; using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.Providers; using MediaBrowser.Controller.Providers;
using MediaBrowser.Controller.Subtitles;
using MediaBrowser.Model.Configuration; using MediaBrowser.Model.Configuration;
using MediaBrowser.Model.IO;
using MediaBrowser.Providers.Manager; using MediaBrowser.Providers.Manager;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Abstractions; using Microsoft.Extensions.Logging.Abstractions;
using Moq; using Moq;
using Xunit; using Xunit;
// Allow Moq to see internal class
[assembly: InternalsVisibleTo("DynamicProxyGenAssembly2")]
namespace Jellyfin.Providers.Tests.Manager namespace Jellyfin.Providers.Tests.Manager
{ {
public class ProviderManagerTests public class ProviderManagerTests
@ -269,8 +277,6 @@ namespace Jellyfin.Providers.Tests.Manager
// IHasOrder ordering (not interleaved, doesn't care about types) // IHasOrder ordering (not interleaved, doesn't care about types)
{ new[] { l, l, r, r }, null, null, null, null, new int?[] { 2, null, 1, null }, new[] { 2, 0, 1, 3 } }, // partially defined { new[] { l, l, r, r }, null, null, null, null, new int?[] { 2, null, 1, null }, new[] { 2, 0, 1, 3 } }, // partially defined
{ new[] { l, l, r, r }, null, null, null, null, new int?[] { 3, 2, 1, 0 }, new[] { 3, 2, 1, 0 } }, // full reverse order { new[] { l, l, r, r }, null, null, null, null, new int?[] { 3, 2, 1, 0 }, new[] { 3, 2, 1, 0 } }, // full reverse order
// note odd interaction - orderby determines order of slot when local and remote both have a slot 0
{ new[] { l, l, r, r }, new[] { 1 }, new[] { 3 }, null, null, new int?[] { null, 2, null, 1 }, new[] { 3, 1, 0, 2 } }, // sorts interleaved results
// multiple orders set // multiple orders set
{ new[] { l, l, l, r, r, r }, new[] { 1 }, new[] { 4 }, new[] { 2, 1, 0 }, new[] { 5, 4, 3 }, null, new[] { 1, 4, 0, 2, 3, 5 } }, // partial library order first, server order ignored { new[] { l, l, l, r, r, r }, new[] { 1 }, new[] { 4 }, new[] { 2, 1, 0 }, new[] { 5, 4, 3 }, null, new[] { 1, 4, 0, 2, 3, 5 } }, // partial library order first, server order ignored
@ -562,13 +568,13 @@ namespace Jellyfin.Providers.Tests.Manager
.Returns(libraryOptions ?? new LibraryOptions()); .Returns(libraryOptions ?? new LibraryOptions());
var providerManager = new ProviderManager( var providerManager = new ProviderManager(
null, Mock.Of<IHttpClientFactory>(),
null, Mock.Of<ISubtitleManager>(),
serverConfigurationManager.Object, serverConfigurationManager.Object,
null, Mock.Of<ILibraryMonitor>(),
_logger, _logger,
null, Mock.Of<IFileSystem>(),
null, Mock.Of<IServerApplicationPaths>(),
libraryManager.Object, libraryManager.Object,
baseItemManager!); baseItemManager!);
@ -595,7 +601,7 @@ namespace Jellyfin.Providers.Tests.Manager
/// <summary> /// <summary>
/// Simple <see cref="BaseItem"/> extension to make SupportsLocalMetadata directly settable. /// Simple <see cref="BaseItem"/> extension to make SupportsLocalMetadata directly settable.
/// </summary> /// </summary>
public class MetadataTestItem : BaseItem, IHasLookupInfo<MetadataTestItemInfo> internal class MetadataTestItem : BaseItem, IHasLookupInfo<MetadataTestItemInfo>
{ {
public bool EnableLocalMetadata { get; set; } = true; public bool EnableLocalMetadata { get; set; } = true;
@ -607,7 +613,7 @@ namespace Jellyfin.Providers.Tests.Manager
} }
} }
public class MetadataTestItemInfo : ItemLookupInfo internal class MetadataTestItemInfo : ItemLookupInfo
{ {
} }
} }

Loading…
Cancel
Save