Remove some dead code

This commit is contained in:
Bond_009 2021-11-09 16:28:39 +01:00
parent 5c5d49ee60
commit 994101fcf4
8 changed files with 23 additions and 135 deletions

View File

@ -1,5 +1,3 @@
#nullable disable
#pragma warning disable CA1819, CS1591
using System;

View File

@ -1,5 +1,3 @@
#nullable disable
#pragma warning disable CS1591
using System;

View File

@ -1,13 +1,11 @@
#pragma warning disable CS1591
using System;
namespace MediaBrowser.Model.MediaInfo
{
public static class AudioCodec
{
public const string AAC = "aac";
public const string MP3 = "mp3";
public const string AC3 = "ac3";
public static string GetFriendlyName(string codec)
{
if (codec.Length == 0)
@ -15,17 +13,20 @@ namespace MediaBrowser.Model.MediaInfo
return codec;
}
switch (codec.ToLowerInvariant())
if (string.Equals(codec, "ac3", StringComparison.OrdinalIgnoreCase))
{
case "ac3":
return "Dolby Digital";
case "eac3":
}
else if (string.Equals(codec, "eac3", StringComparison.OrdinalIgnoreCase))
{
return "Dolby Digital+";
case "dca":
}
else if (string.Equals(codec, "dca", StringComparison.OrdinalIgnoreCase))
{
return "DTS";
default:
}
return codec.ToUpperInvariant();
}
}
}
}

View File

@ -16,22 +16,6 @@ namespace MediaBrowser.Model.MediaInfo
DirectPlayProtocols = new MediaProtocol[] { MediaProtocol.Http };
}
public LiveStreamRequest(AudioOptions options)
{
MaxStreamingBitrate = options.MaxBitrate;
ItemId = options.ItemId;
DeviceProfile = options.Profile;
MaxAudioChannels = options.MaxAudioChannels;
DirectPlayProtocols = new MediaProtocol[] { MediaProtocol.Http };
if (options is VideoOptions videoOptions)
{
AudioStreamIndex = videoOptions.AudioStreamIndex;
SubtitleStreamIndex = videoOptions.SubtitleStreamIndex;
}
}
public string OpenToken { get; set; }
public Guid UserId { get; set; }

View File

@ -1,58 +0,0 @@
#nullable disable
#pragma warning disable CS1591
using System;
using MediaBrowser.Model.Dlna;
namespace MediaBrowser.Model.MediaInfo
{
public class PlaybackInfoRequest
{
public PlaybackInfoRequest()
{
EnableDirectPlay = true;
EnableDirectStream = true;
EnableTranscoding = true;
AllowVideoStreamCopy = true;
AllowAudioStreamCopy = true;
IsPlayback = true;
DirectPlayProtocols = new MediaProtocol[] { MediaProtocol.Http };
}
public Guid Id { get; set; }
public Guid UserId { get; set; }
public long? MaxStreamingBitrate { get; set; }
public long? StartTimeTicks { get; set; }
public int? AudioStreamIndex { get; set; }
public int? SubtitleStreamIndex { get; set; }
public int? MaxAudioChannels { get; set; }
public string MediaSourceId { get; set; }
public string LiveStreamId { get; set; }
public DeviceProfile DeviceProfile { get; set; }
public bool EnableDirectPlay { get; set; }
public bool EnableDirectStream { get; set; }
public bool EnableTranscoding { get; set; }
public bool AllowVideoStreamCopy { get; set; }
public bool AllowAudioStreamCopy { get; set; }
public bool IsPlayback { get; set; }
public bool AutoOpenLiveStream { get; set; }
public MediaProtocol[] DirectPlayProtocols { get; set; }
}
}

View File

@ -8,8 +8,6 @@ namespace MediaBrowser.Model.MediaInfo
public const string SSA = "ssa";
public const string ASS = "ass";
public const string VTT = "vtt";
public const string SUB = "sub";
public const string SMI = "smi";
public const string TTML = "ttml";
}
}

View File

@ -1,33 +0,0 @@
namespace MediaBrowser.Model.Net
{
/// <summary>
/// Enum NetworkShareType.
/// </summary>
public enum NetworkShareType
{
/// <summary>
/// Disk share.
/// </summary>
Disk,
/// <summary>
/// Printer share.
/// </summary>
Printer,
/// <summary>
/// Device share.
/// </summary>
Device,
/// <summary>
/// IPC share.
/// </summary>
Ipc,
/// <summary>
/// Special share.
/// </summary>
Special
}
}

View File

@ -235,12 +235,12 @@ namespace Jellyfin.Providers.Tests.Manager
.ReturnsAsync(imageResponse);
var refreshOptions = forceRefresh
? new ImageRefreshOptions(null)
? new ImageRefreshOptions(Mock.Of<IDirectoryService>())
{
ImageRefreshMode = MetadataRefreshMode.FullRefresh,
ReplaceAllImages = true
}
: new ImageRefreshOptions(null);
: new ImageRefreshOptions(Mock.Of<IDirectoryService>());
var itemImageProvider = GetItemImageProvider(null, new Mock<IFileSystem>());
var result = await itemImageProvider.RefreshImages(item, libraryOptions, new List<IImageProvider> { dynamicProvider.Object }, refreshOptions, CancellationToken.None);
@ -290,7 +290,7 @@ namespace Jellyfin.Providers.Tests.Manager
dynamicProvider.Setup(rp => rp.GetImage(item, imageType, It.IsAny<CancellationToken>()))
.ReturnsAsync(imageResponse);
var refreshOptions = new ImageRefreshOptions(null);
var refreshOptions = new ImageRefreshOptions(Mock.Of<IDirectoryService>());
var providerManager = new Mock<IProviderManager>(MockBehavior.Strict);
providerManager.Setup(pm => pm.SaveImage(item, It.IsAny<Stream>(), It.IsAny<string>(), imageType, null, It.IsAny<CancellationToken>()))
@ -329,12 +329,12 @@ namespace Jellyfin.Providers.Tests.Manager
.Returns(new[] { imageType });
var refreshOptions = forceRefresh
? new ImageRefreshOptions(null)
? new ImageRefreshOptions(Mock.Of<IDirectoryService>())
{
ImageRefreshMode = MetadataRefreshMode.FullRefresh,
ReplaceAllImages = true
}
: new ImageRefreshOptions(null);
: new ImageRefreshOptions(Mock.Of<IDirectoryService>());
var remoteInfo = new RemoteImageInfo[imageCount];
for (int i = 0; i < imageCount; i++)
@ -399,12 +399,12 @@ namespace Jellyfin.Providers.Tests.Manager
});
var refreshOptions = fullRefresh
? new ImageRefreshOptions(null)
? new ImageRefreshOptions(Mock.Of<IDirectoryService>())
{
ImageRefreshMode = MetadataRefreshMode.FullRefresh,
ReplaceAllImages = true
}
: new ImageRefreshOptions(null);
: new ImageRefreshOptions(Mock.Of<IDirectoryService>());
var remoteInfo = new RemoteImageInfo[targetImageCount];
for (int i = 0; i < targetImageCount; i++)
@ -448,7 +448,7 @@ namespace Jellyfin.Providers.Tests.Manager
remoteProvider.Setup(rp => rp.GetSupportedImages(item))
.Returns(new[] { imageType });
var refreshOptions = new ImageRefreshOptions(null);
var refreshOptions = new ImageRefreshOptions(Mock.Of<IDirectoryService>());
// populate remote with double the required images to verify count is trimmed to the library option count
var remoteInfoCount = imageCount * 2;
@ -493,7 +493,7 @@ namespace Jellyfin.Providers.Tests.Manager
remoteProvider.Setup(rp => rp.GetSupportedImages(item))
.Returns(new[] { imageType });
var refreshOptions = new ImageRefreshOptions(null)
var refreshOptions = new ImageRefreshOptions(Mock.Of<IDirectoryService>())
{
ImageRefreshMode = MetadataRefreshMode.FullRefresh,
ReplaceAllImages = true