Merge pull request #6794 from Bond-009/dead

Remove some dead code
pull/6814/head
Claus Vium 3 years ago committed by GitHub
commit c50c9c3dbf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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

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

@ -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))
{
return "Dolby Digital";
}
else if (string.Equals(codec, "eac3", StringComparison.OrdinalIgnoreCase))
{
case "ac3":
return "Dolby Digital";
case "eac3":
return "Dolby Digital+";
case "dca":
return "DTS";
default:
return codec.ToUpperInvariant();
return "Dolby Digital+";
}
else if (string.Equals(codec, "dca", StringComparison.OrdinalIgnoreCase))
{
return "DTS";
}
return codec.ToUpperInvariant();
}
}
}

@ -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; }

@ -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; }
}
}

@ -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";
}
}

@ -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
}
}

@ -231,12 +231,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);
@ -286,7 +286,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>()))
@ -323,12 +323,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++)
@ -393,12 +393,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++)
@ -442,7 +442,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;
@ -487,7 +487,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

Loading…
Cancel
Save