diff --git a/BDInfo/BDInfoSettings.cs b/BDInfo/BDInfoSettings.cs index d127710f49..f4cb300166 100644 --- a/BDInfo/BDInfoSettings.cs +++ b/BDInfo/BDInfoSettings.cs @@ -3,103 +3,31 @@ namespace BDInfo { class BDInfoSettings { - public static bool GenerateStreamDiagnostics - { - get - { - return true; - } - } + public static bool GenerateStreamDiagnostics => true; - public static bool EnableSSIF - { - get - { - return true; - } - } + public static bool EnableSSIF => true; - public static bool AutosaveReport - { - get - { - return false; - } - } + public static bool AutosaveReport => false; - public static bool GenerateFrameDataFile - { - get - { - return false; - } - } + public static bool GenerateFrameDataFile => false; - public static bool FilterLoopingPlaylists - { - get - { - return true; - } - } + public static bool FilterLoopingPlaylists => true; - public static bool FilterShortPlaylists - { - get - { - return false; - } - } + public static bool FilterShortPlaylists => false; - public static int FilterShortPlaylistsValue - { - get - { - return 0; - } - } + public static int FilterShortPlaylistsValue => 0; - public static bool UseImagePrefix - { - get - { - return false; - } - } + public static bool UseImagePrefix => false; - public static string UseImagePrefixValue - { - get - { - return null; - } - } + public static string UseImagePrefixValue => null; /// /// Setting this to false throws an IComparer error on some discs. /// - public static bool KeepStreamOrder - { - get - { - return true; - } - } + public static bool KeepStreamOrder => true; - public static bool GenerateTextSummary - { - get - { - return false; - } - } + public static bool GenerateTextSummary => false; - public static string LastPath - { - get - { - return string.Empty; - } - } + public static string LastPath => string.Empty; } } diff --git a/BDInfo/TSStream.cs b/BDInfo/TSStream.cs index 98269a362a..fad3f1acbc 100644 --- a/BDInfo/TSStream.cs +++ b/BDInfo/TSStream.cs @@ -142,21 +142,12 @@ namespace BDInfo public double PacketSeconds = 0; public int AngleIndex = 0; - public ulong PacketSize - { - get - { - return PacketCount * 192; - } - } + public ulong PacketSize => PacketCount * 192; private string _LanguageCode; public string LanguageCode { - get - { - return _LanguageCode; - } + get => _LanguageCode; set { _LanguageCode = value; @@ -398,13 +389,7 @@ namespace BDInfo } } - public virtual string Description - { - get - { - return ""; - } - } + public virtual string Description => ""; public abstract TSStream Clone(); @@ -444,10 +429,7 @@ namespace BDInfo private TSVideoFormat _VideoFormat; public TSVideoFormat VideoFormat { - get - { - return _VideoFormat; - } + get => _VideoFormat; set { _VideoFormat = value; @@ -488,10 +470,7 @@ namespace BDInfo private TSFrameRate _FrameRate; public TSFrameRate FrameRate { - get - { - return _FrameRate; - } + get => _FrameRate; set { _FrameRate = value; diff --git a/BDInfo/TSStreamBuffer.cs b/BDInfo/TSStreamBuffer.cs index 36f3149fa4..17025c2e31 100644 --- a/BDInfo/TSStreamBuffer.cs +++ b/BDInfo/TSStreamBuffer.cs @@ -37,21 +37,9 @@ namespace BDInfo Stream = new MemoryStream(Buffer); } - public long Length - { - get - { - return (long)BufferLength; - } - } + public long Length => (long)BufferLength; - public long Position - { - get - { - return Stream.Position; - } - } + public long Position => Stream.Position; public void Add( byte[] buffer, diff --git a/BDInfo/TSStreamClip.cs b/BDInfo/TSStreamClip.cs index 23408859d3..20f795e536 100644 --- a/BDInfo/TSStreamClip.cs +++ b/BDInfo/TSStreamClip.cs @@ -74,13 +74,7 @@ namespace BDInfo } } - public ulong PacketSize - { - get - { - return PacketCount * 192; - } - } + public ulong PacketSize => PacketCount * 192; public ulong PacketBitRate { diff --git a/Emby.Dlna/Api/DlnaServerService.cs b/Emby.Dlna/Api/DlnaServerService.cs index 44c9ebc712..f4009ee936 100644 --- a/Emby.Dlna/Api/DlnaServerService.cs +++ b/Emby.Dlna/Api/DlnaServerService.cs @@ -115,29 +115,11 @@ namespace Emby.Dlna.Api public IRequest Request { get; set; } private IHttpResultFactory _resultFactory; - private IContentDirectory ContentDirectory - { - get - { - return DlnaEntryPoint.Current.ContentDirectory; - } - } + private IContentDirectory ContentDirectory => DlnaEntryPoint.Current.ContentDirectory; - private IConnectionManager ConnectionManager - { - get - { - return DlnaEntryPoint.Current.ConnectionManager; - } - } + private IConnectionManager ConnectionManager => DlnaEntryPoint.Current.ConnectionManager; - private IMediaReceiverRegistrar MediaReceiverRegistrar - { - get - { - return DlnaEntryPoint.Current.MediaReceiverRegistrar; - } - } + private IMediaReceiverRegistrar MediaReceiverRegistrar => DlnaEntryPoint.Current.MediaReceiverRegistrar; public DlnaServerService(IDlnaManager dlnaManager, IHttpResultFactory httpResultFactory) { diff --git a/Emby.Dlna/Didl/StringWriterWithEncoding.cs b/Emby.Dlna/Didl/StringWriterWithEncoding.cs index 93ed323d0f..c3c4bd393b 100644 --- a/Emby.Dlna/Didl/StringWriterWithEncoding.cs +++ b/Emby.Dlna/Didl/StringWriterWithEncoding.cs @@ -51,9 +51,6 @@ namespace Emby.Dlna.Didl _encoding = encoding; } - public override Encoding Encoding - { - get { return (null == _encoding) ? base.Encoding : _encoding; } - } + public override Encoding Encoding => (null == _encoding) ? base.Encoding : _encoding; } } diff --git a/Emby.Dlna/DlnaManager.cs b/Emby.Dlna/DlnaManager.cs index 2a65ce40a6..62b2619087 100644 --- a/Emby.Dlna/DlnaManager.cs +++ b/Emby.Dlna/DlnaManager.cs @@ -261,21 +261,9 @@ namespace Emby.Dlna return false; } - private string UserProfilesPath - { - get - { - return Path.Combine(_appPaths.ConfigurationDirectoryPath, "dlna", "user"); - } - } + private string UserProfilesPath => Path.Combine(_appPaths.ConfigurationDirectoryPath, "dlna", "user"); - private string SystemProfilesPath - { - get - { - return Path.Combine(_appPaths.ConfigurationDirectoryPath, "dlna", "system"); - } - } + private string SystemProfilesPath => Path.Combine(_appPaths.ConfigurationDirectoryPath, "dlna", "system"); private IEnumerable GetProfiles(string path, DeviceProfileType type) { diff --git a/Emby.Dlna/Eventing/EventSubscription.cs b/Emby.Dlna/Eventing/EventSubscription.cs index 4c72c4211f..eb8781e0cd 100644 --- a/Emby.Dlna/Eventing/EventSubscription.cs +++ b/Emby.Dlna/Eventing/EventSubscription.cs @@ -23,12 +23,6 @@ namespace Emby.Dlna.Eventing TriggerCount++; } - public bool IsExpired - { - get - { - return SubscriptionTime.AddSeconds(TimeoutSeconds) >= DateTime.UtcNow; - } - } + public bool IsExpired => SubscriptionTime.AddSeconds(TimeoutSeconds) >= DateTime.UtcNow; } } diff --git a/Emby.Dlna/PlayTo/Device.cs b/Emby.Dlna/PlayTo/Device.cs index 1176461080..a85720b5f9 100644 --- a/Emby.Dlna/PlayTo/Device.cs +++ b/Emby.Dlna/PlayTo/Device.cs @@ -35,10 +35,7 @@ namespace Emby.Dlna.PlayTo RefreshVolumeIfNeeded(); return _volume; } - set - { - _volume = value; - } + set => _volume = value; } public TimeSpan? Duration { get; set; } @@ -46,41 +43,17 @@ namespace Emby.Dlna.PlayTo private TimeSpan _position = TimeSpan.FromSeconds(0); public TimeSpan Position { - get - { - return _position; - } - set - { - _position = value; - } + get => _position; + set => _position = value; } public TRANSPORTSTATE TransportState { get; private set; } - public bool IsPlaying - { - get - { - return TransportState == TRANSPORTSTATE.PLAYING; - } - } + public bool IsPlaying => TransportState == TRANSPORTSTATE.PLAYING; - public bool IsPaused - { - get - { - return TransportState == TRANSPORTSTATE.PAUSED || TransportState == TRANSPORTSTATE.PAUSED_PLAYBACK; - } - } + public bool IsPaused => TransportState == TRANSPORTSTATE.PAUSED || TransportState == TRANSPORTSTATE.PAUSED_PLAYBACK; - public bool IsStopped - { - get - { - return TransportState == TRANSPORTSTATE.STOPPED; - } - } + public bool IsStopped => TransportState == TRANSPORTSTATE.STOPPED; #endregion diff --git a/Emby.Dlna/PlayTo/DeviceInfo.cs b/Emby.Dlna/PlayTo/DeviceInfo.cs index d81ce584b2..9e7c04bdb3 100644 --- a/Emby.Dlna/PlayTo/DeviceInfo.cs +++ b/Emby.Dlna/PlayTo/DeviceInfo.cs @@ -34,26 +34,14 @@ namespace Emby.Dlna.PlayTo private string _baseUrl = string.Empty; public string BaseUrl { - get - { - return _baseUrl; - } - set - { - _baseUrl = value; - } + get => _baseUrl; + set => _baseUrl = value; } public DeviceIcon Icon { get; set; } private readonly List _services = new List(); - public List Services - { - get - { - return _services; - } - } + public List Services => _services; public DeviceIdentification ToDeviceIdentification() { diff --git a/Emby.Dlna/PlayTo/PlayToController.cs b/Emby.Dlna/PlayTo/PlayToController.cs index 49c944790f..95be02ff43 100644 --- a/Emby.Dlna/PlayTo/PlayToController.cs +++ b/Emby.Dlna/PlayTo/PlayToController.cs @@ -44,18 +44,9 @@ namespace Emby.Dlna.PlayTo private readonly string _accessToken; private readonly DateTime _creationTime; - public bool IsSessionActive - { - get - { - return !_disposed && _device != null; - } - } + public bool IsSessionActive => !_disposed && _device != null; - public bool SupportsMediaControl - { - get { return IsSessionActive; } - } + public bool SupportsMediaControl => IsSessionActive; public PlayToController(SessionInfo session, ISessionManager sessionManager, ILibraryManager libraryManager, ILogger logger, IDlnaManager dlnaManager, IUserManager userManager, IImageProcessor imageProcessor, string serverAddress, string accessToken, IDeviceDiscovery deviceDiscovery, IUserDataManager userDataManager, ILocalizationManager localization, IMediaSourceManager mediaSourceManager, IConfigurationManager config, IMediaEncoder mediaEncoder) { @@ -436,13 +427,7 @@ namespace Emby.Dlna.PlayTo private int _currentPlaylistIndex; private readonly List _playlist = new List(); - private List Playlist - { - get - { - return _playlist; - } - } + private List Playlist => _playlist; private void AddItemFromId(Guid id, List list) { diff --git a/Emby.Dlna/PlayTo/TransportCommands.cs b/Emby.Dlna/PlayTo/TransportCommands.cs index bb6d691153..b96fa43e50 100644 --- a/Emby.Dlna/PlayTo/TransportCommands.cs +++ b/Emby.Dlna/PlayTo/TransportCommands.cs @@ -12,27 +12,15 @@ namespace Emby.Dlna.PlayTo private List _stateVariables = new List(); public List StateVariables { - get - { - return _stateVariables; - } - set - { - _stateVariables = value; - } + get => _stateVariables; + set => _stateVariables = value; } private List _serviceActions = new List(); public List ServiceActions { - get - { - return _serviceActions; - } - set - { - _serviceActions = value; - } + get => _serviceActions; + set => _serviceActions = value; } public static TransportCommands Create(XDocument document) diff --git a/Emby.Drawing.Skia/SkiaEncoder.cs b/Emby.Drawing.Skia/SkiaEncoder.cs index 3f82fd4b7c..8f517681e8 100644 --- a/Emby.Drawing.Skia/SkiaEncoder.cs +++ b/Emby.Drawing.Skia/SkiaEncoder.cs @@ -34,46 +34,34 @@ namespace Emby.Drawing.Skia LogVersion(); } - public string[] SupportedInputFormats - { - get + public string[] SupportedInputFormats => + new[] { - // Some common file name extensions for RAW picture files include: .cr2, .crw, .dng, .nef, .orf, .rw2, .pef, .arw, .sr2, .srf, and .tif. - return new[] - { - "jpeg", - "jpg", - "png", + "jpeg", + "jpg", + "png", - "dng", + "dng", - "webp", - "gif", - "bmp", - "ico", - "astc", - "ktx", - "pkm", - "wbmp", + "webp", + "gif", + "bmp", + "ico", + "astc", + "ktx", + "pkm", + "wbmp", - // TODO - // Are all of these supported? https://github.com/google/skia/blob/master/infra/bots/recipes/test.py#L454 + // TODO + // Are all of these supported? https://github.com/google/skia/blob/master/infra/bots/recipes/test.py#L454 - // working on windows at least - "cr2", - "nef", - "arw" - }; - } - } + // working on windows at least + "cr2", + "nef", + "arw" + }; - public ImageFormat[] SupportedOutputFormats - { - get - { - return new[] { ImageFormat.Webp, ImageFormat.Jpg, ImageFormat.Png }; - } - } + public ImageFormat[] SupportedOutputFormats => new[] { ImageFormat.Webp, ImageFormat.Jpg, ImageFormat.Png }; private void LogVersion() { @@ -666,19 +654,10 @@ namespace Emby.Drawing.Skia } } - public string Name - { - get { return "Skia"; } - } + public string Name => "Skia"; - public bool SupportsImageCollageCreation - { - get { return true; } - } + public bool SupportsImageCollageCreation => true; - public bool SupportsImageEncoding - { - get { return true; } - } + public bool SupportsImageEncoding => true; } } diff --git a/Emby.Drawing/ImageProcessor.cs b/Emby.Drawing/ImageProcessor.cs index 5b9b15857a..57a6eb148c 100644 --- a/Emby.Drawing/ImageProcessor.cs +++ b/Emby.Drawing/ImageProcessor.cs @@ -74,7 +74,7 @@ namespace Emby.Drawing public IImageEncoder ImageEncoder { - get { return _imageEncoder; } + get => _imageEncoder; set { if (value == null) @@ -86,67 +86,44 @@ namespace Emby.Drawing } } - public string[] SupportedInputFormats - { - get + public string[] SupportedInputFormats => + new string[] { - return new string[] - { - "tiff", - "tif", - "jpeg", - "jpg", - "png", - "aiff", - "cr2", - "crw", + "tiff", + "tif", + "jpeg", + "jpg", + "png", + "aiff", + "cr2", + "crw", - // Remove until supported - //"nef", - "orf", - "pef", - "arw", - "webp", - "gif", - "bmp", - "erf", - "raf", - "rw2", - "nrw", - "dng", - "ico", - "astc", - "ktx", - "pkm", - "wbmp" - }; - } - } + // Remove until supported + //"nef", + "orf", + "pef", + "arw", + "webp", + "gif", + "bmp", + "erf", + "raf", + "rw2", + "nrw", + "dng", + "ico", + "astc", + "ktx", + "pkm", + "wbmp" + }; - public bool SupportsImageCollageCreation - { - get - { - return _imageEncoder.SupportsImageCollageCreation; - } - } + public bool SupportsImageCollageCreation => _imageEncoder.SupportsImageCollageCreation; - private string ResizedImageCachePath - { - get - { - return Path.Combine(_appPaths.ImageCachePath, "resized-images"); - } - } + private string ResizedImageCachePath => Path.Combine(_appPaths.ImageCachePath, "resized-images"); - private string EnhancedImageCachePath - { - get - { - return Path.Combine(_appPaths.ImageCachePath, "enhanced-images"); - } - } + private string EnhancedImageCachePath => Path.Combine(_appPaths.ImageCachePath, "enhanced-images"); public void AddParts(IEnumerable enhancers) { diff --git a/Emby.Drawing/NullImageEncoder.cs b/Emby.Drawing/NullImageEncoder.cs index 748ae6f2c8..e6f205a1f5 100644 --- a/Emby.Drawing/NullImageEncoder.cs +++ b/Emby.Drawing/NullImageEncoder.cs @@ -6,26 +6,15 @@ namespace Emby.Drawing { public class NullImageEncoder : IImageEncoder { - public string[] SupportedInputFormats - { - get + public string[] SupportedInputFormats => + new[] { - return new[] - { - "png", - "jpeg", - "jpg" - }; - } - } + "png", + "jpeg", + "jpg" + }; - public ImageFormat[] SupportedOutputFormats - { - get - { - return new[] { ImageFormat.Jpg, ImageFormat.Png }; - } - } + public ImageFormat[] SupportedOutputFormats => new[] { ImageFormat.Jpg, ImageFormat.Png }; public void CropWhiteSpace(string inputPath, string outputPath) { @@ -42,20 +31,11 @@ namespace Emby.Drawing throw new NotImplementedException(); } - public string Name - { - get { return "Null Image Encoder"; } - } + public string Name => "Null Image Encoder"; - public bool SupportsImageCollageCreation - { - get { return false; } - } + public bool SupportsImageCollageCreation => false; - public bool SupportsImageEncoding - { - get { return false; } - } + public bool SupportsImageEncoding => false; public ImageSize GetImageSize(string path) { diff --git a/Emby.IsoMounting/IsoMounter/LinuxIsoManager.cs b/Emby.IsoMounting/IsoMounter/LinuxIsoManager.cs index 846f3b2ce6..ac486f1675 100644 --- a/Emby.IsoMounting/IsoMounter/LinuxIsoManager.cs +++ b/Emby.IsoMounting/IsoMounter/LinuxIsoManager.cs @@ -13,7 +13,7 @@ namespace IsoMounter public class LinuxIsoManager : IIsoMounter { [DllImport("libc", SetLastError = true)] - public static extern uint getuid(); + static extern uint getuid(); #region Private Fields @@ -102,26 +102,11 @@ namespace IsoMounter #region Interface Implementation for IIsoMounter - public bool IsInstalled - { - get - { - return true; - } - } + public bool IsInstalled => true; - public string Name - { - get { return "LinuxMount"; } - } + public string Name => "LinuxMount"; - public bool RequiresInstallation - { - get - { - return false; - } - } + public bool RequiresInstallation => false; public bool CanMount(string path) { diff --git a/Emby.IsoMounting/IsoMounter/Plugin.cs b/Emby.IsoMounting/IsoMounter/Plugin.cs index bcacab9067..f45b39d3e4 100644 --- a/Emby.IsoMounting/IsoMounter/Plugin.cs +++ b/Emby.IsoMounting/IsoMounter/Plugin.cs @@ -13,30 +13,18 @@ namespace IsoMounter } private Guid _id = new Guid("4682DD4C-A675-4F1B-8E7C-79ADF137A8F8"); - public override Guid Id - { - get { return _id; } - } + public override Guid Id => _id; /// /// Gets the name of the plugin /// /// The name. - public override string Name - { - get { return "Iso Mounter"; } - } + public override string Name => "Iso Mounter"; /// /// Gets the description. /// /// The description. - public override string Description - { - get - { - return "Mount and stream ISO contents"; - } - } + public override string Description => "Mount and stream ISO contents"; } } diff --git a/Emby.Naming/Common/EpisodeExpression.cs b/Emby.Naming/Common/EpisodeExpression.cs index ebaacd3a15..fd85bf76ad 100644 --- a/Emby.Naming/Common/EpisodeExpression.cs +++ b/Emby.Naming/Common/EpisodeExpression.cs @@ -6,7 +6,8 @@ namespace Emby.Naming.Common public class EpisodeExpression { private string _expression; - public string Expression { get { return _expression; } set { _expression = value; _regex = null; } } + public string Expression { get => _expression; + set { _expression = value; _regex = null; } } public bool IsByDate { get; set; } public bool IsOptimistic { get; set; } @@ -16,13 +17,7 @@ namespace Emby.Naming.Common public string[] DateTimeFormats { get; set; } private Regex _regex; - public Regex Regex - { - get - { - return _regex ?? (_regex = new Regex(Expression, RegexOptions.IgnoreCase | RegexOptions.Compiled)); - } - } + public Regex Regex => _regex ?? (_regex = new Regex(Expression, RegexOptions.IgnoreCase | RegexOptions.Compiled)); public EpisodeExpression(string expression, bool byDate) { diff --git a/Emby.Naming/Video/VideoFileInfo.cs b/Emby.Naming/Video/VideoFileInfo.cs index d14d04b20e..6a29ada7ea 100644 --- a/Emby.Naming/Video/VideoFileInfo.cs +++ b/Emby.Naming/Video/VideoFileInfo.cs @@ -65,10 +65,7 @@ namespace Emby.Naming.Video /// Gets the file name without extension. /// /// The file name without extension. - public string FileNameWithoutExtension - { - get { return !IsDirectory ? System.IO.Path.GetFileNameWithoutExtension(Path) : System.IO.Path.GetFileName(Path); } - } + public string FileNameWithoutExtension => !IsDirectory ? System.IO.Path.GetFileNameWithoutExtension(Path) : System.IO.Path.GetFileName(Path); public override string ToString() { diff --git a/Emby.Photos/PhotoProvider.cs b/Emby.Photos/PhotoProvider.cs index 40480b2ae6..99d0ed7aba 100644 --- a/Emby.Photos/PhotoProvider.cs +++ b/Emby.Photos/PhotoProvider.cs @@ -199,9 +199,6 @@ namespace Emby.Photos return Task.FromResult(result); } - public string Name - { - get { return "Embedded Information"; } - } + public string Name => "Embedded Information"; } } diff --git a/Emby.Server.Implementations/Data/SqliteItemRepository.cs b/Emby.Server.Implementations/Data/SqliteItemRepository.cs index 8621de563e..325bad501e 100644 --- a/Emby.Server.Implementations/Data/SqliteItemRepository.cs +++ b/Emby.Server.Implementations/Data/SqliteItemRepository.cs @@ -45,13 +45,7 @@ namespace Emby.Server.Implementations.Data /// Gets the name of the repository /// /// The name. - public string Name - { - get - { - return "SQLite"; - } - } + public string Name => "SQLite"; /// /// Gets the json serializer. @@ -97,21 +91,9 @@ namespace Emby.Server.Implementations.Data private const string ChaptersTableName = "Chapters2"; - protected override int? CacheSize - { - get - { - return 20000; - } - } + protected override int? CacheSize => 20000; - protected override bool EnableTempStoreMemory - { - get - { - return true; - } - } + protected override bool EnableTempStoreMemory => true; /// /// Opens the connection to the database diff --git a/Jellyfin.Server/CoreAppHost.cs b/Jellyfin.Server/CoreAppHost.cs index 50e24a0c21..b18562a69f 100644 --- a/Jellyfin.Server/CoreAppHost.cs +++ b/Jellyfin.Server/CoreAppHost.cs @@ -16,14 +16,7 @@ namespace Jellyfin.Server { } - public override bool CanSelfRestart - { - get - { - // A restart script must be provided - return StartupOptions.ContainsOption("-restartpath"); - } - } + public override bool CanSelfRestart => StartupOptions.ContainsOption("-restartpath"); protected override void RestartInternal() => Program.Restart(); @@ -32,13 +25,7 @@ namespace Jellyfin.Server protected override void ShutdownInternal() => Program.Shutdown(); - protected override bool SupportsDualModeSockets - { - get - { - return true; - } - } + protected override bool SupportsDualModeSockets => true; protected override IHttpListener CreateHttpListener() => new WebSocketSharpListener( diff --git a/Jellyfin.Server/SocketSharp/RequestMono.cs b/Jellyfin.Server/SocketSharp/RequestMono.cs index ffa57758a4..6e5a4e75a3 100644 --- a/Jellyfin.Server/SocketSharp/RequestMono.cs +++ b/Jellyfin.Server/SocketSharp/RequestMono.cs @@ -113,21 +113,9 @@ namespace Jellyfin.SocketSharp return form; } - public string Accept - { - get - { - return string.IsNullOrEmpty(request.Headers["Accept"]) ? null : request.Headers["Accept"]; - } - } + public string Accept => string.IsNullOrEmpty(request.Headers["Accept"]) ? null : request.Headers["Accept"]; - public string Authorization - { - get - { - return string.IsNullOrEmpty(request.Headers["Authorization"]) ? null : request.Headers["Authorization"]; - } - } + public string Authorization => string.IsNullOrEmpty(request.Headers["Authorization"]) ? null : request.Headers["Authorization"]; protected bool validate_cookies, validate_query_string, validate_form; protected bool checked_cookies, checked_query_string, checked_form; @@ -410,30 +398,17 @@ namespace Jellyfin.SocketSharp throw new NotSupportedException(); } - public override bool CanRead - { - get { return true; } - } - public override bool CanSeek - { - get { return true; } - } - public override bool CanWrite - { - get { return false; } - } + public override bool CanRead => true; - public override long Length - { - get { return end - offset; } - } + public override bool CanSeek => true; + + public override bool CanWrite => false; + + public override long Length => end - offset; public override long Position { - get - { - return position - offset; - } + get => position - offset; set { if (value > Length) @@ -451,37 +426,13 @@ namespace Jellyfin.SocketSharp this.stream = new ReadSubStream(base_stream, offset, length); } - public string ContentType - { - get - { - return content_type; - } - } + public string ContentType => content_type; - public int ContentLength - { - get - { - return (int)stream.Length; - } - } + public int ContentLength => (int)stream.Length; - public string FileName - { - get - { - return name; - } - } + public string FileName => name; - public Stream InputStream - { - get - { - return stream; - } - } + public Stream InputStream => stream; } class Helpers diff --git a/Jellyfin.Server/SocketSharp/SharpWebSocket.cs b/Jellyfin.Server/SocketSharp/SharpWebSocket.cs index cb346cac57..d0dcd86ebf 100644 --- a/Jellyfin.Server/SocketSharp/SharpWebSocket.cs +++ b/Jellyfin.Server/SocketSharp/SharpWebSocket.cs @@ -85,13 +85,7 @@ namespace Jellyfin.SocketSharp /// Gets or sets the state. /// /// The state. - public WebSocketState State - { - get - { - return WebSocket.ReadyState; - } - } + public WebSocketState State => WebSocket.ReadyState; /// /// Sends the async. diff --git a/Jellyfin.Server/SocketSharp/WebSocketSharpRequest.cs b/Jellyfin.Server/SocketSharp/WebSocketSharpRequest.cs index c6c87cdea8..e38468388b 100644 --- a/Jellyfin.Server/SocketSharp/WebSocketSharpRequest.cs +++ b/Jellyfin.Server/SocketSharp/WebSocketSharpRequest.cs @@ -39,88 +39,38 @@ namespace Jellyfin.SocketSharp return string.IsNullOrEmpty(endHostUrl) ? null : endHostUrl.TrimEnd('/'); } - public HttpListenerRequest HttpRequest - { - get { return request; } - } + public HttpListenerRequest HttpRequest => request; - public object OriginalRequest - { - get { return request; } - } + public object OriginalRequest => request; - public IResponse Response - { - get { return response; } - } + public IResponse Response => response; - public IHttpResponse HttpResponse - { - get { return response; } - } + public IHttpResponse HttpResponse => response; public string OperationName { get; set; } public object Dto { get; set; } - public string RawUrl - { - get { return request.RawUrl; } - } + public string RawUrl => request.RawUrl; - public string AbsoluteUri - { - get { return request.Url.AbsoluteUri.TrimEnd('/'); } - } + public string AbsoluteUri => request.Url.AbsoluteUri.TrimEnd('/'); - public string UserHostAddress - { - get { return request.UserHostAddress; } - } + public string UserHostAddress => request.UserHostAddress; - public string XForwardedFor - { - get - { - return string.IsNullOrEmpty(request.Headers["X-Forwarded-For"]) ? null : request.Headers["X-Forwarded-For"]; - } - } + public string XForwardedFor => string.IsNullOrEmpty(request.Headers["X-Forwarded-For"]) ? null : request.Headers["X-Forwarded-For"]; - public int? XForwardedPort - { - get - { - return string.IsNullOrEmpty(request.Headers["X-Forwarded-Port"]) ? (int?)null : int.Parse(request.Headers["X-Forwarded-Port"]); - } - } + public int? XForwardedPort => string.IsNullOrEmpty(request.Headers["X-Forwarded-Port"]) ? (int?)null : int.Parse(request.Headers["X-Forwarded-Port"]); - public string XForwardedProtocol - { - get - { - return string.IsNullOrEmpty(request.Headers["X-Forwarded-Proto"]) ? null : request.Headers["X-Forwarded-Proto"]; - } - } + public string XForwardedProtocol => string.IsNullOrEmpty(request.Headers["X-Forwarded-Proto"]) ? null : request.Headers["X-Forwarded-Proto"]; - public string XRealIp - { - get - { - return string.IsNullOrEmpty(request.Headers["X-Real-IP"]) ? null : request.Headers["X-Real-IP"]; - } - } + public string XRealIp => string.IsNullOrEmpty(request.Headers["X-Real-IP"]) ? null : request.Headers["X-Real-IP"]; private string remoteIp; - public string RemoteIp - { - get - { - return remoteIp ?? - (remoteIp = (CheckBadChars(XForwardedFor)) ?? - (NormalizeIp(CheckBadChars(XRealIp)) ?? - (request.RemoteEndPoint != null ? NormalizeIp(request.RemoteEndPoint.Address.ToString()) : null))); - } - } + public string RemoteIp => + remoteIp ?? + (remoteIp = (CheckBadChars(XForwardedFor)) ?? + (NormalizeIp(CheckBadChars(XRealIp)) ?? + (request.RemoteEndPoint != null ? NormalizeIp(request.RemoteEndPoint.Address.ToString()) : null))); private static readonly char[] HttpTrimCharacters = new char[] { (char)0x09, (char)0xA, (char)0xB, (char)0xC, (char)0xD, (char)0x20 }; @@ -215,34 +165,20 @@ namespace Jellyfin.SocketSharp return ip; } - public bool IsSecureConnection - { - get { return request.IsSecureConnection || XForwardedProtocol == "https"; } - } + public bool IsSecureConnection => request.IsSecureConnection || XForwardedProtocol == "https"; - public string[] AcceptTypes - { - get { return request.AcceptTypes; } - } + public string[] AcceptTypes => request.AcceptTypes; private Dictionary items; - public Dictionary Items - { - get { return items ?? (items = new Dictionary()); } - } + public Dictionary Items => items ?? (items = new Dictionary()); private string responseContentType; public string ResponseContentType { - get - { - return responseContentType - ?? (responseContentType = GetResponseContentType(this)); - } - set - { - this.responseContentType = value; - } + get => + responseContentType + ?? (responseContentType = GetResponseContentType(this)); + set => this.responseContentType = value; } public const string FormUrlEncoded = "application/x-www-form-urlencoded"; @@ -434,58 +370,32 @@ namespace Jellyfin.SocketSharp } } - public string UserAgent - { - get { return request.UserAgent; } - } + public string UserAgent => request.UserAgent; - public QueryParamCollection Headers - { - get { return request.Headers; } - } + public QueryParamCollection Headers => request.Headers; private QueryParamCollection queryString; - public QueryParamCollection QueryString - { - get { return queryString ?? (queryString = MyHttpUtility.ParseQueryString(request.Url.Query)); } - } + public QueryParamCollection QueryString => queryString ?? (queryString = MyHttpUtility.ParseQueryString(request.Url.Query)); - public bool IsLocal - { - get { return request.IsLocal; } - } + public bool IsLocal => request.IsLocal; private string httpMethod; - public string HttpMethod - { - get - { - return httpMethod - ?? (httpMethod = request.HttpMethod); - } - } + public string HttpMethod => + httpMethod + ?? (httpMethod = request.HttpMethod); - public string Verb - { - get { return HttpMethod; } - } + public string Verb => HttpMethod; - public string ContentType - { - get { return request.ContentType; } - } + public string ContentType => request.ContentType; public Encoding contentEncoding; public Encoding ContentEncoding { - get { return contentEncoding ?? request.ContentEncoding; } - set { contentEncoding = value; } + get => contentEncoding ?? request.ContentEncoding; + set => contentEncoding = value; } - public Uri UrlReferrer - { - get { return request.UrlReferrer; } - } + public Uri UrlReferrer => request.UrlReferrer; public static Encoding GetEncoding(string contentTypeHeader) { @@ -501,15 +411,9 @@ namespace Jellyfin.SocketSharp } } - public Stream InputStream - { - get { return request.InputStream; } - } + public Stream InputStream => request.InputStream; - public long ContentLength - { - get { return request.ContentLength64; } - } + public long ContentLength => request.ContentLength64; private IHttpFile[] httpFiles; public IHttpFile[] Files diff --git a/Jellyfin.Server/SocketSharp/WebSocketSharpResponse.cs b/Jellyfin.Server/SocketSharp/WebSocketSharpResponse.cs index 8b1e8bbb7c..21bfac55da 100644 --- a/Jellyfin.Server/SocketSharp/WebSocketSharpResponse.cs +++ b/Jellyfin.Server/SocketSharp/WebSocketSharpResponse.cs @@ -31,27 +31,24 @@ namespace Jellyfin.SocketSharp public IRequest Request { get; private set; } public Dictionary Items { get; private set; } - public object OriginalResponse - { - get { return _response; } - } + public object OriginalResponse => _response; public int StatusCode { - get { return this._response.StatusCode; } - set { this._response.StatusCode = value; } + get => this._response.StatusCode; + set => this._response.StatusCode = value; } public string StatusDescription { - get { return this._response.StatusDescription; } - set { this._response.StatusDescription = value; } + get => this._response.StatusDescription; + set => this._response.StatusDescription = value; } public string ContentType { - get { return _response.ContentType; } - set { _response.ContentType = value; } + get => _response.ContentType; + set => _response.ContentType = value; } //public ICookies Cookies { get; set; } @@ -67,13 +64,7 @@ namespace Jellyfin.SocketSharp _response.AddHeader(name, value); } - public QueryParamCollection Headers - { - get - { - return _response.Headers; - } - } + public QueryParamCollection Headers => _response.Headers; public string GetHeader(string name) { @@ -85,10 +76,7 @@ namespace Jellyfin.SocketSharp _response.Redirect(url); } - public Stream OutputStream - { - get { return _response.OutputStream; } - } + public Stream OutputStream => _response.OutputStream; public void Close() { @@ -179,8 +167,8 @@ namespace Jellyfin.SocketSharp public bool SendChunked { - get { return _response.SendChunked; } - set { _response.SendChunked = value; } + get => _response.SendChunked; + set => _response.SendChunked = value; } public bool KeepAlive { get; set; } diff --git a/MediaBrowser.Api/BaseApiService.cs b/MediaBrowser.Api/BaseApiService.cs index ff0d23fcd9..8decea5a24 100644 --- a/MediaBrowser.Api/BaseApiService.cs +++ b/MediaBrowser.Api/BaseApiService.cs @@ -22,25 +22,13 @@ namespace MediaBrowser.Api /// Gets or sets the logger. /// /// The logger. - public ILogger Logger - { - get - { - return ApiEntryPoint.Instance.Logger; - } - } + public ILogger Logger => ApiEntryPoint.Instance.Logger; /// /// Gets or sets the HTTP result factory. /// /// The HTTP result factory. - public IHttpResultFactory ResultFactory - { - get - { - return ApiEntryPoint.Instance.ResultFactory; - } - } + public IHttpResultFactory ResultFactory => ApiEntryPoint.Instance.ResultFactory; /// /// Gets or sets the request context. diff --git a/MediaBrowser.Api/LiveTv/ProgressiveFileCopier.cs b/MediaBrowser.Api/LiveTv/ProgressiveFileCopier.cs index 28590444ef..8412bf66b9 100644 --- a/MediaBrowser.Api/LiveTv/ProgressiveFileCopier.cs +++ b/MediaBrowser.Api/LiveTv/ProgressiveFileCopier.cs @@ -45,13 +45,7 @@ namespace MediaBrowser.Api.LiveTv _streamHelper = streamHelper; } - public IDictionary Headers - { - get - { - return _outputHeaders; - } - } + public IDictionary Headers => _outputHeaders; private Stream GetInputStream(bool allowAsyncFileRead) { diff --git a/MediaBrowser.Api/Playback/BaseStreamingService.cs b/MediaBrowser.Api/Playback/BaseStreamingService.cs index c6781cad9d..cdf9c7d0b4 100644 --- a/MediaBrowser.Api/Playback/BaseStreamingService.cs +++ b/MediaBrowser.Api/Playback/BaseStreamingService.cs @@ -141,10 +141,7 @@ namespace MediaBrowser.Api.Playback return Path.Combine(folder, dataHash + (outputFileExtension ?? string.Empty).ToLower()); } - protected virtual bool EnableOutputInSubFolder - { - get { return false; } - } + protected virtual bool EnableOutputInSubFolder => false; protected readonly CultureInfo UsCulture = new CultureInfo("en-US"); diff --git a/MediaBrowser.Api/Playback/Hls/BaseHlsService.cs b/MediaBrowser.Api/Playback/Hls/BaseHlsService.cs index 969ab9c3bc..1e90d03b0a 100644 --- a/MediaBrowser.Api/Playback/Hls/BaseHlsService.cs +++ b/MediaBrowser.Api/Playback/Hls/BaseHlsService.cs @@ -52,10 +52,7 @@ namespace MediaBrowser.Api.Playback.Hls /// Gets the type of the transcoding job. /// /// The type of the transcoding job. - protected override TranscodingJobType TranscodingJobType - { - get { return TranscodingJobType.Hls; } - } + protected override TranscodingJobType TranscodingJobType => TranscodingJobType.Hls; /// /// Processes the request. diff --git a/MediaBrowser.Api/Playback/Progressive/BaseProgressiveStreamingService.cs b/MediaBrowser.Api/Playback/Progressive/BaseProgressiveStreamingService.cs index e3fb0ad52f..bb21fe5ae1 100644 --- a/MediaBrowser.Api/Playback/Progressive/BaseProgressiveStreamingService.cs +++ b/MediaBrowser.Api/Playback/Progressive/BaseProgressiveStreamingService.cs @@ -102,10 +102,7 @@ namespace MediaBrowser.Api.Playback.Progressive /// Gets the type of the transcoding job. /// /// The type of the transcoding job. - protected override TranscodingJobType TranscodingJobType - { - get { return TranscodingJobType.Progressive; } - } + protected override TranscodingJobType TranscodingJobType => TranscodingJobType.Progressive; /// /// Processes the request. diff --git a/MediaBrowser.Api/Playback/Progressive/ProgressiveStreamWriter.cs b/MediaBrowser.Api/Playback/Progressive/ProgressiveStreamWriter.cs index cad08ea24f..3dd9de2a1b 100644 --- a/MediaBrowser.Api/Playback/Progressive/ProgressiveStreamWriter.cs +++ b/MediaBrowser.Api/Playback/Progressive/ProgressiveStreamWriter.cs @@ -50,13 +50,7 @@ namespace MediaBrowser.Api.Playback.Progressive _environment = environment; } - public IDictionary Headers - { - get - { - return _outputHeaders; - } - } + public IDictionary Headers => _outputHeaders; private Stream GetInputStream(bool allowAsyncFileRead) { diff --git a/MediaBrowser.Api/Playback/StaticRemoteStreamWriter.cs b/MediaBrowser.Api/Playback/StaticRemoteStreamWriter.cs index 5a309ba091..3b8b299957 100644 --- a/MediaBrowser.Api/Playback/StaticRemoteStreamWriter.cs +++ b/MediaBrowser.Api/Playback/StaticRemoteStreamWriter.cs @@ -31,10 +31,7 @@ namespace MediaBrowser.Api.Playback /// Gets the options. /// /// The options. - public IDictionary Headers - { - get { return _options; } - } + public IDictionary Headers => _options; public async Task WriteToAsync(Stream responseStream, CancellationToken cancellationToken) { diff --git a/MediaBrowser.Api/Playback/StreamRequest.cs b/MediaBrowser.Api/Playback/StreamRequest.cs index 4771e188f6..da1f00c3e9 100644 --- a/MediaBrowser.Api/Playback/StreamRequest.cs +++ b/MediaBrowser.Api/Playback/StreamRequest.cs @@ -50,13 +50,7 @@ namespace MediaBrowser.Api.Playback /// Gets a value indicating whether this instance has fixed resolution. /// /// true if this instance has fixed resolution; otherwise, false. - public bool HasFixedResolution - { - get - { - return Width.HasValue || Height.HasValue; - } - } + public bool HasFixedResolution => Width.HasValue || Height.HasValue; public bool EnableSubtitlesInManifest { get; set; } } diff --git a/MediaBrowser.Api/Playback/StreamState.cs b/MediaBrowser.Api/Playback/StreamState.cs index fc2310683d..400ad47cc6 100644 --- a/MediaBrowser.Api/Playback/StreamState.cs +++ b/MediaBrowser.Api/Playback/StreamState.cs @@ -17,7 +17,7 @@ namespace MediaBrowser.Api.Playback public StreamRequest Request { - get { return (StreamRequest)BaseRequest; } + get => (StreamRequest)BaseRequest; set { BaseRequest = value; @@ -28,10 +28,7 @@ namespace MediaBrowser.Api.Playback public TranscodingThrottler TranscodingThrottler { get; set; } - public VideoStreamRequest VideoRequest - { - get { return Request as VideoStreamRequest; } - } + public VideoStreamRequest VideoRequest => Request as VideoStreamRequest; /// /// Gets or sets the log file stream. @@ -42,10 +39,7 @@ namespace MediaBrowser.Api.Playback public string WaitForPath { get; set; } - public bool IsOutputVideo - { - get { return Request is VideoStreamRequest; } - } + public bool IsOutputVideo => Request is VideoStreamRequest; public int SegmentLength { @@ -98,13 +92,7 @@ namespace MediaBrowser.Api.Playback } } - public int HlsListSize - { - get - { - return 0; - } - } + public int HlsListSize => 0; public string UserAgent { get; set; } diff --git a/MediaBrowser.Api/ScheduledTasks/ScheduledTasksWebSocketListener.cs b/MediaBrowser.Api/ScheduledTasks/ScheduledTasksWebSocketListener.cs index f1edc5a228..b0c4b29c17 100644 --- a/MediaBrowser.Api/ScheduledTasks/ScheduledTasksWebSocketListener.cs +++ b/MediaBrowser.Api/ScheduledTasks/ScheduledTasksWebSocketListener.cs @@ -24,10 +24,7 @@ namespace MediaBrowser.Api.ScheduledTasks /// Gets the name. /// /// The name. - protected override string Name - { - get { return "ScheduledTasksInfo"; } - } + protected override string Name => "ScheduledTasksInfo"; /// /// Initializes a new instance of the class. diff --git a/MediaBrowser.Api/Session/SessionInfoWebSocketListener.cs b/MediaBrowser.Api/Session/SessionInfoWebSocketListener.cs index f2cb1d4850..387ccad25e 100644 --- a/MediaBrowser.Api/Session/SessionInfoWebSocketListener.cs +++ b/MediaBrowser.Api/Session/SessionInfoWebSocketListener.cs @@ -17,10 +17,7 @@ namespace MediaBrowser.Api.Session /// Gets the name. /// /// The name. - protected override string Name - { - get { return "Sessions"; } - } + protected override string Name => "Sessions"; /// /// The _kernel diff --git a/MediaBrowser.Api/System/ActivityLogWebSocketListener.cs b/MediaBrowser.Api/System/ActivityLogWebSocketListener.cs index 1b1fc8ff83..0df46c3996 100644 --- a/MediaBrowser.Api/System/ActivityLogWebSocketListener.cs +++ b/MediaBrowser.Api/System/ActivityLogWebSocketListener.cs @@ -17,10 +17,7 @@ namespace MediaBrowser.Api.System /// Gets the name. /// /// The name. - protected override string Name - { - get { return "ActivityLogEntry"; } - } + protected override string Name => "ActivityLogEntry"; /// /// The _kernel diff --git a/MediaBrowser.Common/Net/HttpRequestOptions.cs b/MediaBrowser.Common/Net/HttpRequestOptions.cs index 938b562850..0b21472f04 100644 --- a/MediaBrowser.Common/Net/HttpRequestOptions.cs +++ b/MediaBrowser.Common/Net/HttpRequestOptions.cs @@ -24,11 +24,8 @@ namespace MediaBrowser.Common.Net /// The accept header. public string AcceptHeader { - get { return GetHeaderValue("Accept"); } - set - { - RequestHeaders["Accept"] = value; - } + get => GetHeaderValue("Accept"); + set => RequestHeaders["Accept"] = value; } /// /// Gets or sets the cancellation token. @@ -48,11 +45,8 @@ namespace MediaBrowser.Common.Net /// The user agent. public string UserAgent { - get { return GetHeaderValue("User-Agent"); } - set - { - RequestHeaders["User-Agent"] = value; - } + get => GetHeaderValue("User-Agent"); + set => RequestHeaders["User-Agent"] = value; } /// diff --git a/MediaBrowser.Common/Plugins/BasePlugin.cs b/MediaBrowser.Common/Plugins/BasePlugin.cs index cd52803c64..a14c9fb34b 100644 --- a/MediaBrowser.Common/Plugins/BasePlugin.cs +++ b/MediaBrowser.Common/Plugins/BasePlugin.cs @@ -18,10 +18,7 @@ namespace MediaBrowser.Common.Plugins /// Gets the description. /// /// The description. - public virtual string Description - { - get { return string.Empty; } - } + public virtual string Description => string.Empty; /// /// Gets the unique id. @@ -108,10 +105,7 @@ namespace MediaBrowser.Common.Plugins /// Gets the type of configuration this plugin uses /// /// The type of the configuration. - public Type ConfigurationType - { - get { return typeof(TConfigurationType); } - } + public Type ConfigurationType => typeof(TConfigurationType); private Action _directoryCreateFn; public void SetStartupInfo(Action directoryCreateFn) @@ -124,13 +118,7 @@ namespace MediaBrowser.Common.Plugins /// Gets the name the assembly file /// /// The name of the assembly file. - protected string AssemblyFileName - { - get - { - return Path.GetFileName(AssemblyFilePath); - } - } + protected string AssemblyFileName => Path.GetFileName(AssemblyFilePath); /// /// The _configuration sync lock @@ -161,10 +149,7 @@ namespace MediaBrowser.Common.Plugins } return _configuration; } - protected set - { - _configuration = value; - } + protected set => _configuration = value; } private TConfigurationType LoadConfiguration() @@ -185,22 +170,13 @@ namespace MediaBrowser.Common.Plugins /// Gets the name of the configuration file. Subclasses should override /// /// The name of the configuration file. - public virtual string ConfigurationFileName - { - get { return Path.ChangeExtension(AssemblyFileName, ".xml"); } - } + public virtual string ConfigurationFileName => Path.ChangeExtension(AssemblyFileName, ".xml"); /// /// Gets the full path to the configuration file /// /// The configuration file path. - public string ConfigurationFilePath - { - get - { - return Path.Combine(ApplicationPaths.PluginConfigurationsPath, ConfigurationFileName); - } - } + public string ConfigurationFilePath => Path.Combine(ApplicationPaths.PluginConfigurationsPath, ConfigurationFileName); /// /// Initializes a new instance of the class. @@ -253,10 +229,7 @@ namespace MediaBrowser.Common.Plugins /// Gets the plugin's configuration /// /// The configuration. - BasePluginConfiguration IHasPluginConfiguration.Configuration - { - get { return Configuration; } - } + BasePluginConfiguration IHasPluginConfiguration.Configuration => Configuration; public override PluginInfo GetPluginInfo() { diff --git a/MediaBrowser.Controller/Channels/Channel.cs b/MediaBrowser.Controller/Channels/Channel.cs index 022d4aa820..adf03fb661 100644 --- a/MediaBrowser.Controller/Channels/Channel.cs +++ b/MediaBrowser.Controller/Channels/Channel.cs @@ -31,19 +31,10 @@ namespace MediaBrowser.Controller.Channels } [IgnoreDataMember] - public override bool SupportsInheritedParentImages - { - get - { - return false; - } - } + public override bool SupportsInheritedParentImages => false; [IgnoreDataMember] - public override SourceType SourceType - { - get { return SourceType.Channel; } - } + public override SourceType SourceType => SourceType.Channel; protected override QueryResult GetItemsInternal(InternalItemsQuery query) { diff --git a/MediaBrowser.Controller/Entities/AggregateFolder.cs b/MediaBrowser.Controller/Entities/AggregateFolder.cs index a484f31f1b..522b3e33e9 100644 --- a/MediaBrowser.Controller/Entities/AggregateFolder.cs +++ b/MediaBrowser.Controller/Entities/AggregateFolder.cs @@ -24,10 +24,7 @@ namespace MediaBrowser.Controller.Entities } [IgnoreDataMember] - public override bool IsPhysicalRoot - { - get { return true; } - } + public override bool IsPhysicalRoot => true; public override bool CanDelete() { @@ -35,13 +32,7 @@ namespace MediaBrowser.Controller.Entities } [IgnoreDataMember] - public override bool SupportsPlayedStatus - { - get - { - return false; - } - } + public override bool SupportsPlayedStatus => false; /// /// The _virtual children @@ -52,19 +43,10 @@ namespace MediaBrowser.Controller.Entities /// Gets the virtual children. /// /// The virtual children. - public ConcurrentBag VirtualChildren - { - get { return _virtualChildren; } - } + public ConcurrentBag VirtualChildren => _virtualChildren; [IgnoreDataMember] - public override string[] PhysicalLocations - { - get - { - return PhysicalLocationsList; - } - } + public override string[] PhysicalLocations => PhysicalLocationsList; public string[] PhysicalLocationsList { get; set; } diff --git a/MediaBrowser.Controller/Entities/Audio/Audio.cs b/MediaBrowser.Controller/Entities/Audio/Audio.cs index e9eb1e9075..13a6fe44a9 100644 --- a/MediaBrowser.Controller/Entities/Audio/Audio.cs +++ b/MediaBrowser.Controller/Entities/Audio/Audio.cs @@ -41,49 +41,22 @@ namespace MediaBrowser.Controller.Entities.Audio } [IgnoreDataMember] - public override bool SupportsPlayedStatus - { - get - { - return true; - } - } + public override bool SupportsPlayedStatus => true; [IgnoreDataMember] - public override bool SupportsPeople - { - get { return false; } - } + public override bool SupportsPeople => false; [IgnoreDataMember] - public override bool SupportsAddingToPlaylist - { - get { return true; } - } + public override bool SupportsAddingToPlaylist => true; [IgnoreDataMember] - public override bool SupportsInheritedParentImages - { - get { return true; } - } + public override bool SupportsInheritedParentImages => true; [IgnoreDataMember] - protected override bool SupportsOwnedItems - { - get - { - return false; - } - } + protected override bool SupportsOwnedItems => false; [IgnoreDataMember] - public override Folder LatestItemsIndexContainer - { - get - { - return AlbumEntity; - } - } + public override Folder LatestItemsIndexContainer => AlbumEntity; public override bool CanDownload() { @@ -115,23 +88,14 @@ namespace MediaBrowser.Controller.Entities.Audio } [IgnoreDataMember] - public MusicAlbum AlbumEntity - { - get { return FindParent(); } - } + public MusicAlbum AlbumEntity => FindParent(); /// /// Gets the type of the media. /// /// The type of the media. [IgnoreDataMember] - public override string MediaType - { - get - { - return Model.Entities.MediaType.Audio; - } - } + public override string MediaType => Model.Entities.MediaType.Audio; /// /// Creates the name of the sort. diff --git a/MediaBrowser.Controller/Entities/Audio/MusicAlbum.cs b/MediaBrowser.Controller/Entities/Audio/MusicAlbum.cs index b91aa4d0b1..a3e05f0d2d 100644 --- a/MediaBrowser.Controller/Entities/Audio/MusicAlbum.cs +++ b/MediaBrowser.Controller/Entities/Audio/MusicAlbum.cs @@ -28,22 +28,13 @@ namespace MediaBrowser.Controller.Entities.Audio } [IgnoreDataMember] - public override bool SupportsAddingToPlaylist - { - get { return true; } - } + public override bool SupportsAddingToPlaylist => true; [IgnoreDataMember] - public override bool SupportsInheritedParentImages - { - get { return true; } - } + public override bool SupportsInheritedParentImages => true; [IgnoreDataMember] - public MusicArtist MusicArtist - { - get { return GetMusicArtist(new DtoOptions(true)); } - } + public MusicArtist MusicArtist => GetMusicArtist(new DtoOptions(true)); public MusicArtist GetMusicArtist(DtoOptions options) { @@ -66,22 +57,10 @@ namespace MediaBrowser.Controller.Entities.Audio } [IgnoreDataMember] - public override bool SupportsPlayedStatus - { - get - { - return false; - } - } + public override bool SupportsPlayedStatus => false; [IgnoreDataMember] - public override bool SupportsCumulativeRunTimeTicks - { - get - { - return true; - } - } + public override bool SupportsCumulativeRunTimeTicks => true; [IgnoreDataMember] public string[] AllArtists @@ -107,29 +86,17 @@ namespace MediaBrowser.Controller.Entities.Audio } [IgnoreDataMember] - public string AlbumArtist - { - get { return AlbumArtists.Length == 0 ? null : AlbumArtists[0]; } - } + public string AlbumArtist => AlbumArtists.Length == 0 ? null : AlbumArtists[0]; [IgnoreDataMember] - public override bool SupportsPeople - { - get { return false; } - } + public override bool SupportsPeople => false; /// /// Gets the tracks. /// /// The tracks. [IgnoreDataMember] - public IEnumerable Tracks - { - get - { - return GetRecursiveChildren(i => i is Audio); - } - } + public IEnumerable Tracks => GetRecursiveChildren(i => i is Audio); protected override IEnumerable GetEligibleChildrenForRecursiveChildren(User user) { diff --git a/MediaBrowser.Controller/Entities/Audio/MusicArtist.cs b/MediaBrowser.Controller/Entities/Audio/MusicArtist.cs index d1e047c5dc..2d464bd321 100644 --- a/MediaBrowser.Controller/Entities/Audio/MusicArtist.cs +++ b/MediaBrowser.Controller/Entities/Audio/MusicArtist.cs @@ -19,61 +19,25 @@ namespace MediaBrowser.Controller.Entities.Audio public class MusicArtist : Folder, IItemByName, IHasMusicGenres, IHasDualAccess, IHasLookupInfo { [IgnoreDataMember] - public bool IsAccessedByName - { - get { return ParentId.Equals(Guid.Empty); } - } + public bool IsAccessedByName => ParentId.Equals(Guid.Empty); [IgnoreDataMember] - public override bool IsFolder - { - get - { - return !IsAccessedByName; - } - } + public override bool IsFolder => !IsAccessedByName; [IgnoreDataMember] - public override bool SupportsInheritedParentImages - { - get - { - return false; - } - } + public override bool SupportsInheritedParentImages => false; [IgnoreDataMember] - public override bool SupportsCumulativeRunTimeTicks - { - get - { - return true; - } - } + public override bool SupportsCumulativeRunTimeTicks => true; [IgnoreDataMember] - public override bool IsDisplayedAsFolder - { - get - { - return true; - } - } + public override bool IsDisplayedAsFolder => true; [IgnoreDataMember] - public override bool SupportsAddingToPlaylist - { - get { return true; } - } + public override bool SupportsAddingToPlaylist => true; [IgnoreDataMember] - public override bool SupportsPlayedStatus - { - get - { - return false; - } - } + public override bool SupportsPlayedStatus => false; public override double GetDefaultPrimaryImageAspectRatio() { @@ -154,13 +118,7 @@ namespace MediaBrowser.Controller.Entities.Audio /// /// The containing folder path. [IgnoreDataMember] - public override string ContainingFolderPath - { - get - { - return Path; - } - } + public override string ContainingFolderPath => Path; /// /// Gets the user data key. @@ -207,13 +165,7 @@ namespace MediaBrowser.Controller.Entities.Audio } [IgnoreDataMember] - public override bool SupportsPeople - { - get - { - return false; - } - } + public override bool SupportsPeople => false; public static string GetPath(string name) { diff --git a/MediaBrowser.Controller/Entities/Audio/MusicGenre.cs b/MediaBrowser.Controller/Entities/Audio/MusicGenre.cs index 5525ddcc54..d26aaf2bb1 100644 --- a/MediaBrowser.Controller/Entities/Audio/MusicGenre.cs +++ b/MediaBrowser.Controller/Entities/Audio/MusicGenre.cs @@ -24,28 +24,13 @@ namespace MediaBrowser.Controller.Entities.Audio } [IgnoreDataMember] - public override bool SupportsAddingToPlaylist - { - get { return true; } - } + public override bool SupportsAddingToPlaylist => true; [IgnoreDataMember] - public override bool SupportsAncestors - { - get - { - return false; - } - } + public override bool SupportsAncestors => false; [IgnoreDataMember] - public override bool IsDisplayedAsFolder - { - get - { - return true; - } - } + public override bool IsDisplayedAsFolder => true; /// /// Returns the folder containing the item. @@ -53,13 +38,7 @@ namespace MediaBrowser.Controller.Entities.Audio /// /// The containing folder path. [IgnoreDataMember] - public override string ContainingFolderPath - { - get - { - return Path; - } - } + public override string ContainingFolderPath => Path; public override double GetDefaultPrimaryImageAspectRatio() { @@ -77,13 +56,7 @@ namespace MediaBrowser.Controller.Entities.Audio } [IgnoreDataMember] - public override bool SupportsPeople - { - get - { - return false; - } - } + public override bool SupportsPeople => false; public IList GetTaggedItems(InternalItemsQuery query) { diff --git a/MediaBrowser.Controller/Entities/AudioBook.cs b/MediaBrowser.Controller/Entities/AudioBook.cs index 95d1690d5d..65c8a5fdd0 100644 --- a/MediaBrowser.Controller/Entities/AudioBook.cs +++ b/MediaBrowser.Controller/Entities/AudioBook.cs @@ -8,22 +8,10 @@ namespace MediaBrowser.Controller.Entities public class AudioBook : Audio.Audio, IHasSeries, IHasLookupInfo { [IgnoreDataMember] - public override bool SupportsPositionTicksResume - { - get - { - return true; - } - } + public override bool SupportsPositionTicksResume => true; [IgnoreDataMember] - public override bool SupportsPlayedStatus - { - get - { - return true; - } - } + public override bool SupportsPlayedStatus => true; [IgnoreDataMember] public string SeriesPresentationUniqueKey { get; set; } diff --git a/MediaBrowser.Controller/Entities/BaseItem.cs b/MediaBrowser.Controller/Entities/BaseItem.cs index 65f2ad9922..995f394834 100644 --- a/MediaBrowser.Controller/Entities/BaseItem.cs +++ b/MediaBrowser.Controller/Entities/BaseItem.cs @@ -108,19 +108,10 @@ namespace MediaBrowser.Controller.Entities public Guid ChannelId { get; set; } [IgnoreDataMember] - public virtual bool SupportsAddingToPlaylist - { - get - { - return false; - } - } + public virtual bool SupportsAddingToPlaylist => false; [IgnoreDataMember] - public virtual bool AlwaysScanInternalMetadataPath - { - get { return false; } - } + public virtual bool AlwaysScanInternalMetadataPath => false; /// /// Gets a value indicating whether this instance is in mixed folder. @@ -130,31 +121,13 @@ namespace MediaBrowser.Controller.Entities public bool IsInMixedFolder { get; set; } [IgnoreDataMember] - public virtual bool SupportsPlayedStatus - { - get - { - return false; - } - } + public virtual bool SupportsPlayedStatus => false; [IgnoreDataMember] - public virtual bool SupportsPositionTicksResume - { - get - { - return false; - } - } + public virtual bool SupportsPositionTicksResume => false; [IgnoreDataMember] - public virtual bool SupportsRemoteImageDownloading - { - get - { - return true; - } - } + public virtual bool SupportsRemoteImageDownloading => true; private string _name; /// @@ -164,10 +137,7 @@ namespace MediaBrowser.Controller.Entities [IgnoreDataMember] public virtual string Name { - get - { - return _name; - } + get => _name; set { _name = value; @@ -178,10 +148,7 @@ namespace MediaBrowser.Controller.Entities } [IgnoreDataMember] - public bool IsUnaired - { - get { return PremiereDate.HasValue && PremiereDate.Value.ToLocalTime().Date >= DateTime.Now.Date; } - } + public bool IsUnaired => PremiereDate.HasValue && PremiereDate.Value.ToLocalTime().Date >= DateTime.Now.Date; [IgnoreDataMember] public int? TotalBitrate { get; set; } @@ -189,13 +156,7 @@ namespace MediaBrowser.Controller.Entities public ExtraType? ExtraType { get; set; } [IgnoreDataMember] - public bool IsThemeMedia - { - get - { - return ExtraType.HasValue && (ExtraType.Value == Model.Entities.ExtraType.ThemeSong || ExtraType.Value == Model.Entities.ExtraType.ThemeVideo); - } - } + public bool IsThemeMedia => ExtraType.HasValue && (ExtraType.Value == Model.Entities.ExtraType.ThemeSong || ExtraType.Value == Model.Entities.ExtraType.ThemeVideo); [IgnoreDataMember] public string OriginalTitle { get; set; } @@ -295,13 +256,7 @@ namespace MediaBrowser.Controller.Entities public string ExternalEtag { get; set; } [IgnoreDataMember] - public virtual bool IsHidden - { - get - { - return false; - } - } + public virtual bool IsHidden => false; public BaseItem GetOwner() { @@ -362,22 +317,10 @@ namespace MediaBrowser.Controller.Entities } [IgnoreDataMember] - public bool IsFileProtocol - { - get - { - return IsPathProtocol(MediaProtocol.File); - } - } + public bool IsFileProtocol => IsPathProtocol(MediaProtocol.File); [IgnoreDataMember] - public bool HasPathProtocol - { - get - { - return PathProtocol.HasValue; - } - } + public bool HasPathProtocol => PathProtocol.HasValue; [IgnoreDataMember] public virtual bool SupportsLocalMetadata @@ -408,13 +351,7 @@ namespace MediaBrowser.Controller.Entities } [IgnoreDataMember] - public virtual bool EnableAlphaNumericSorting - { - get - { - return true; - } - } + public virtual bool EnableAlphaNumericSorting => true; private List> GetSortChunks(string s1) { @@ -455,10 +392,7 @@ namespace MediaBrowser.Controller.Entities /// /// The primary image path. [IgnoreDataMember] - public string PrimaryImagePath - { - get { return this.GetImagePath(ImageType.Primary); } - } + public string PrimaryImagePath => this.GetImagePath(ImageType.Primary); public bool IsMetadataFetcherEnabled(LibraryOptions libraryOptions, string name) { @@ -637,13 +571,7 @@ namespace MediaBrowser.Controller.Entities /// /// The type of the media. [IgnoreDataMember] - public virtual string MediaType - { - get - { - return null; - } - } + public virtual string MediaType => null; [IgnoreDataMember] public virtual string[] PhysicalLocations @@ -667,7 +595,7 @@ namespace MediaBrowser.Controller.Entities [IgnoreDataMember] public string ForcedSortName { - get { return _forcedSortName; } + get => _forcedSortName; set { _forcedSortName = value; _sortName = null; } } @@ -695,10 +623,7 @@ namespace MediaBrowser.Controller.Entities } return _sortName; } - set - { - _sortName = value; - } + set => _sortName = value; } public string GetInternalMetadataPath() @@ -816,7 +741,7 @@ namespace MediaBrowser.Controller.Entities [IgnoreDataMember] public Folder Parent { - get { return GetParent() as Folder; } + get => GetParent() as Folder; set { @@ -1007,10 +932,7 @@ namespace MediaBrowser.Controller.Entities public int? ParentIndexNumber { get; set; } [IgnoreDataMember] - public virtual bool HasLocalAlternateVersions - { - get { return false; } - } + public virtual bool HasLocalAlternateVersions => false; [IgnoreDataMember] public string OfficialRatingForComparison @@ -1426,22 +1348,13 @@ namespace MediaBrowser.Controller.Entities } [IgnoreDataMember] - protected virtual bool SupportsOwnedItems - { - get { return !ParentId.Equals(Guid.Empty) && IsFileProtocol; } - } + protected virtual bool SupportsOwnedItems => !ParentId.Equals(Guid.Empty) && IsFileProtocol; [IgnoreDataMember] - public virtual bool SupportsPeople - { - get { return false; } - } + public virtual bool SupportsPeople => false; [IgnoreDataMember] - public virtual bool SupportsThemeMedia - { - get { return false; } - } + public virtual bool SupportsThemeMedia => false; /// /// Refreshes owned items such as trailers, theme videos, special features, etc. @@ -1602,10 +1515,7 @@ namespace MediaBrowser.Controller.Entities public Dictionary ProviderIds { get; set; } [IgnoreDataMember] - public virtual Folder LatestItemsIndexContainer - { - get { return null; } - } + public virtual Folder LatestItemsIndexContainer => null; public virtual double GetDefaultPrimaryImageAspectRatio() { @@ -1923,10 +1833,7 @@ namespace MediaBrowser.Controller.Entities } [IgnoreDataMember] - public virtual bool SupportsInheritedParentImages - { - get { return false; } - } + public virtual bool SupportsInheritedParentImages => false; protected bool IsVisibleStandaloneInternal(User user, bool checkFolders) { @@ -1969,22 +1876,10 @@ namespace MediaBrowser.Controller.Entities /// /// true if this instance is folder; otherwise, false. [IgnoreDataMember] - public virtual bool IsFolder - { - get - { - return false; - } - } + public virtual bool IsFolder => false; [IgnoreDataMember] - public virtual bool IsDisplayedAsFolder - { - get - { - return false; - } - } + public virtual bool IsDisplayedAsFolder => false; public virtual string GetClientTypeName() { @@ -2070,13 +1965,7 @@ namespace MediaBrowser.Controller.Entities } [IgnoreDataMember] - public virtual bool EnableRememberingTrackSelections - { - get - { - return true; - } - } + public virtual bool EnableRememberingTrackSelections => true; /// /// Adds a studio to the item @@ -2813,22 +2702,10 @@ namespace MediaBrowser.Controller.Entities } [IgnoreDataMember] - public virtual bool SupportsAncestors - { - get - { - return true; - } - } + public virtual bool SupportsAncestors => true; [IgnoreDataMember] - public virtual bool StopRefreshIfLocalMetadataFound - { - get - { - return true; - } - } + public virtual bool StopRefreshIfLocalMetadataFound => true; public virtual IEnumerable GetIdsForAncestorQuery() { @@ -2915,13 +2792,7 @@ namespace MediaBrowser.Controller.Entities return GetExtras(); } - public virtual bool IsHD - { - get - { - return Height >= 720; - } - } + public virtual bool IsHD => Height >= 720; public bool IsShortcut { get; set; } public string ShortcutPath { get; set; } public int Width { get; set; } @@ -2933,12 +2804,6 @@ namespace MediaBrowser.Controller.Entities } // what does this do? public static ExtraType[] DisplayExtraTypes = new[] { Model.Entities.ExtraType.ThemeSong, Model.Entities.ExtraType.ThemeVideo }; - public virtual bool SupportsExternalTransfer - { - get - { - return false; - } - } + public virtual bool SupportsExternalTransfer => false; } } diff --git a/MediaBrowser.Controller/Entities/BasePluginFolder.cs b/MediaBrowser.Controller/Entities/BasePluginFolder.cs index 2185159955..c15ba1a1e5 100644 --- a/MediaBrowser.Controller/Entities/BasePluginFolder.cs +++ b/MediaBrowser.Controller/Entities/BasePluginFolder.cs @@ -10,10 +10,7 @@ namespace MediaBrowser.Controller.Entities public abstract class BasePluginFolder : Folder, ICollectionFolder { [IgnoreDataMember] - public virtual string CollectionType - { - get { return null; } - } + public virtual string CollectionType => null; public override bool CanDelete() { @@ -26,22 +23,10 @@ namespace MediaBrowser.Controller.Entities } [IgnoreDataMember] - public override bool SupportsInheritedParentImages - { - get - { - return false; - } - } + public override bool SupportsInheritedParentImages => false; [IgnoreDataMember] - public override bool SupportsPeople - { - get - { - return false; - } - } + public override bool SupportsPeople => false; //public override double? GetDefaultPrimaryImageAspectRatio() //{ diff --git a/MediaBrowser.Controller/Entities/Book.cs b/MediaBrowser.Controller/Entities/Book.cs index febd0cc202..7a23d9a663 100644 --- a/MediaBrowser.Controller/Entities/Book.cs +++ b/MediaBrowser.Controller/Entities/Book.cs @@ -9,13 +9,7 @@ namespace MediaBrowser.Controller.Entities public class Book : BaseItem, IHasLookupInfo, IHasSeries { [IgnoreDataMember] - public override string MediaType - { - get - { - return Model.Entities.MediaType.Book; - } - } + public override string MediaType => Model.Entities.MediaType.Book; [IgnoreDataMember] public string SeriesPresentationUniqueKey { get; set; } diff --git a/MediaBrowser.Controller/Entities/CollectionFolder.cs b/MediaBrowser.Controller/Entities/CollectionFolder.cs index f0713a74b0..c56dc04ece 100644 --- a/MediaBrowser.Controller/Entities/CollectionFolder.cs +++ b/MediaBrowser.Controller/Entities/CollectionFolder.cs @@ -34,22 +34,10 @@ namespace MediaBrowser.Controller.Entities } [IgnoreDataMember] - public override bool SupportsPlayedStatus - { - get - { - return false; - } - } + public override bool SupportsPlayedStatus => false; [IgnoreDataMember] - public override bool SupportsInheritedParentImages - { - get - { - return false; - } - } + public override bool SupportsInheritedParentImages => false; public override bool CanDelete() { @@ -158,22 +146,10 @@ namespace MediaBrowser.Controller.Entities /// /// The display prefs id. [IgnoreDataMember] - public override Guid DisplayPreferencesId - { - get - { - return Id; - } - } + public override Guid DisplayPreferencesId => Id; [IgnoreDataMember] - public override string[] PhysicalLocations - { - get - { - return PhysicalLocationsList; - } - } + public override string[] PhysicalLocations => PhysicalLocationsList; public override bool IsSaveLocalMetadataEnabled() { @@ -337,10 +313,7 @@ namespace MediaBrowser.Controller.Entities /// /// The actual children. [IgnoreDataMember] - public override IEnumerable Children - { - get { return GetActualChildren(); } - } + public override IEnumerable Children => GetActualChildren(); public IEnumerable GetActualChildren() { @@ -386,12 +359,6 @@ namespace MediaBrowser.Controller.Entities } [IgnoreDataMember] - public override bool SupportsPeople - { - get - { - return false; - } - } + public override bool SupportsPeople => false; } } diff --git a/MediaBrowser.Controller/Entities/Folder.cs b/MediaBrowser.Controller/Entities/Folder.cs index 5573bbf31b..fe53d2f051 100644 --- a/MediaBrowser.Controller/Entities/Folder.cs +++ b/MediaBrowser.Controller/Entities/Folder.cs @@ -47,80 +47,35 @@ namespace MediaBrowser.Controller.Entities } [IgnoreDataMember] - public override bool SupportsThemeMedia - { - get { return true; } - } + public override bool SupportsThemeMedia => true; [IgnoreDataMember] - public virtual bool IsPreSorted - { - get { return false; } - } + public virtual bool IsPreSorted => false; [IgnoreDataMember] - public virtual bool IsPhysicalRoot - { - get { return false; } - } + public virtual bool IsPhysicalRoot => false; [IgnoreDataMember] - public override bool SupportsInheritedParentImages - { - get - { - return true; - } - } + public override bool SupportsInheritedParentImages => true; [IgnoreDataMember] - public override bool SupportsPlayedStatus - { - get - { - return true; - } - } + public override bool SupportsPlayedStatus => true; /// /// Gets a value indicating whether this instance is folder. /// /// true if this instance is folder; otherwise, false. [IgnoreDataMember] - public override bool IsFolder - { - get - { - return true; - } - } + public override bool IsFolder => true; [IgnoreDataMember] - public override bool IsDisplayedAsFolder - { - get - { - return true; - } - } + public override bool IsDisplayedAsFolder => true; [IgnoreDataMember] - public virtual bool SupportsCumulativeRunTimeTicks - { - get - { - return false; - } - } + public virtual bool SupportsCumulativeRunTimeTicks => false; [IgnoreDataMember] - public virtual bool SupportsDateLastMediaAdded - { - get - { - return false; - } - } + public virtual bool SupportsDateLastMediaAdded => false; public override bool CanDelete() { @@ -172,10 +127,7 @@ namespace MediaBrowser.Controller.Entities } [IgnoreDataMember] - protected virtual bool SupportsShortcutChildren - { - get { return false; } - } + protected virtual bool SupportsShortcutChildren => false; /// /// Adds the child. @@ -210,23 +162,14 @@ namespace MediaBrowser.Controller.Entities /// /// The actual children. [IgnoreDataMember] - public virtual IEnumerable Children - { - get - { - return LoadChildren(); - } - } + public virtual IEnumerable Children => LoadChildren(); /// /// thread-safe access to all recursive children of this folder - without regard to user /// /// The recursive children. [IgnoreDataMember] - public IEnumerable RecursiveChildren - { - get { return GetRecursiveChildren(); } - } + public IEnumerable RecursiveChildren => GetRecursiveChildren(); public override bool IsVisible(User user) { @@ -1421,13 +1364,7 @@ namespace MediaBrowser.Controller.Entities return list; } - protected virtual bool FilterLinkedChildrenPerUser - { - get - { - return false; - } - } + protected virtual bool FilterLinkedChildrenPerUser => false; public bool ContainsLinkedChildByItemId(Guid itemId) { @@ -1524,13 +1461,7 @@ namespace MediaBrowser.Controller.Entities } [IgnoreDataMember] - protected override bool SupportsOwnedItems - { - get - { - return base.SupportsOwnedItems || SupportsShortcutChildren; - } - } + protected override bool SupportsOwnedItems => base.SupportsOwnedItems || SupportsShortcutChildren; protected override async Task RefreshedOwnedItems(MetadataRefreshOptions options, List fileSystemChildren, CancellationToken cancellationToken) { diff --git a/MediaBrowser.Controller/Entities/Game.cs b/MediaBrowser.Controller/Entities/Game.cs index 46cdfcf159..82a4531ff0 100644 --- a/MediaBrowser.Controller/Entities/Game.cs +++ b/MediaBrowser.Controller/Entities/Game.cs @@ -27,26 +27,17 @@ namespace MediaBrowser.Controller.Entities } [IgnoreDataMember] - public override bool SupportsThemeMedia - { - get { return true; } - } + public override bool SupportsThemeMedia => true; [IgnoreDataMember] - public override bool SupportsPeople - { - get { return false; } - } + public override bool SupportsPeople => false; /// /// Gets the type of the media. /// /// The type of the media. [IgnoreDataMember] - public override string MediaType - { - get { return Model.Entities.MediaType.Game; } - } + public override string MediaType => Model.Entities.MediaType.Game; /// /// Gets or sets the players supported. diff --git a/MediaBrowser.Controller/Entities/GameGenre.cs b/MediaBrowser.Controller/Entities/GameGenre.cs index e552739043..c0fd4ae893 100644 --- a/MediaBrowser.Controller/Entities/GameGenre.cs +++ b/MediaBrowser.Controller/Entities/GameGenre.cs @@ -32,22 +32,10 @@ namespace MediaBrowser.Controller.Entities /// /// The containing folder path. [IgnoreDataMember] - public override string ContainingFolderPath - { - get - { - return Path; - } - } + public override string ContainingFolderPath => Path; [IgnoreDataMember] - public override bool SupportsAncestors - { - get - { - return false; - } - } + public override bool SupportsAncestors => false; public override bool IsSaveLocalMetadataEnabled() { @@ -68,13 +56,7 @@ namespace MediaBrowser.Controller.Entities } [IgnoreDataMember] - public override bool SupportsPeople - { - get - { - return false; - } - } + public override bool SupportsPeople => false; public static string GetPath(string name) { diff --git a/MediaBrowser.Controller/Entities/GameSystem.cs b/MediaBrowser.Controller/Entities/GameSystem.cs index e9c915ead7..63f830d256 100644 --- a/MediaBrowser.Controller/Entities/GameSystem.cs +++ b/MediaBrowser.Controller/Entities/GameSystem.cs @@ -18,31 +18,13 @@ namespace MediaBrowser.Controller.Entities /// /// The display prefs id. [IgnoreDataMember] - public override Guid DisplayPreferencesId - { - get - { - return Id; - } - } + public override Guid DisplayPreferencesId => Id; [IgnoreDataMember] - public override bool SupportsPlayedStatus - { - get - { - return false; - } - } + public override bool SupportsPlayedStatus => false; [IgnoreDataMember] - public override bool SupportsInheritedParentImages - { - get - { - return false; - } - } + public override bool SupportsInheritedParentImages => false; public override double GetDefaultPrimaryImageAspectRatio() { @@ -90,12 +72,6 @@ namespace MediaBrowser.Controller.Entities } [IgnoreDataMember] - public override bool SupportsPeople - { - get - { - return false; - } - } + public override bool SupportsPeople => false; } } diff --git a/MediaBrowser.Controller/Entities/Genre.cs b/MediaBrowser.Controller/Entities/Genre.cs index 9380deb335..3f3ab35513 100644 --- a/MediaBrowser.Controller/Entities/Genre.cs +++ b/MediaBrowser.Controller/Entities/Genre.cs @@ -35,31 +35,13 @@ namespace MediaBrowser.Controller.Entities /// /// The containing folder path. [IgnoreDataMember] - public override string ContainingFolderPath - { - get - { - return Path; - } - } + public override string ContainingFolderPath => Path; [IgnoreDataMember] - public override bool IsDisplayedAsFolder - { - get - { - return true; - } - } + public override bool IsDisplayedAsFolder => true; [IgnoreDataMember] - public override bool SupportsAncestors - { - get - { - return false; - } - } + public override bool SupportsAncestors => false; public override bool IsSaveLocalMetadataEnabled() { @@ -80,13 +62,7 @@ namespace MediaBrowser.Controller.Entities } [IgnoreDataMember] - public override bool SupportsPeople - { - get - { - return false; - } - } + public override bool SupportsPeople => false; public static string GetPath(string name) { diff --git a/MediaBrowser.Controller/Entities/Movies/BoxSet.cs b/MediaBrowser.Controller/Entities/Movies/BoxSet.cs index c2384ca72d..124a943ef8 100644 --- a/MediaBrowser.Controller/Entities/Movies/BoxSet.cs +++ b/MediaBrowser.Controller/Entities/Movies/BoxSet.cs @@ -25,28 +25,13 @@ namespace MediaBrowser.Controller.Entities.Movies } [IgnoreDataMember] - protected override bool FilterLinkedChildrenPerUser - { - get - { - return true; - } - } + protected override bool FilterLinkedChildrenPerUser => true; [IgnoreDataMember] - public override bool SupportsInheritedParentImages - { - get - { - return false; - } - } + public override bool SupportsInheritedParentImages => false; [IgnoreDataMember] - public override bool SupportsPeople - { - get { return true; } - } + public override bool SupportsPeople => true; public Guid[] LocalTrailerIds { get; set; } public Guid[] RemoteTrailerIds { get; set; } @@ -110,13 +95,7 @@ namespace MediaBrowser.Controller.Entities.Movies } [IgnoreDataMember] - public override bool IsPreSorted - { - get - { - return true; - } - } + public override bool IsPreSorted => true; public override bool IsAuthorizedToDelete(User user, List allCollectionFolders) { diff --git a/MediaBrowser.Controller/Entities/Movies/Movie.cs b/MediaBrowser.Controller/Entities/Movies/Movie.cs index 0da021558e..232d116241 100644 --- a/MediaBrowser.Controller/Entities/Movies/Movie.cs +++ b/MediaBrowser.Controller/Entities/Movies/Movie.cs @@ -39,8 +39,8 @@ namespace MediaBrowser.Controller.Entities.Movies [IgnoreDataMember] public string CollectionName { - get { return TmdbCollectionName; } - set { TmdbCollectionName = value; } + get => TmdbCollectionName; + set => TmdbCollectionName = value; } public override double GetDefaultPrimaryImageAspectRatio() @@ -184,13 +184,6 @@ namespace MediaBrowser.Controller.Entities.Movies } [IgnoreDataMember] - public override bool StopRefreshIfLocalMetadataFound - { - get - { - // Need people id's from internet metadata - return false; - } - } + public override bool StopRefreshIfLocalMetadataFound => false; } } diff --git a/MediaBrowser.Controller/Entities/MusicVideo.cs b/MediaBrowser.Controller/Entities/MusicVideo.cs index e990b9374d..5bf082b7ee 100644 --- a/MediaBrowser.Controller/Entities/MusicVideo.cs +++ b/MediaBrowser.Controller/Entities/MusicVideo.cs @@ -17,13 +17,7 @@ namespace MediaBrowser.Controller.Entities } [IgnoreDataMember] - public string[] AllArtists - { - get - { - return Artists; - } - } + public string[] AllArtists => Artists; public override UnratedItem GetBlockUnratedType() { diff --git a/MediaBrowser.Controller/Entities/Person.cs b/MediaBrowser.Controller/Entities/Person.cs index 0615414477..0ba8b3b48f 100644 --- a/MediaBrowser.Controller/Entities/Person.cs +++ b/MediaBrowser.Controller/Entities/Person.cs @@ -51,13 +51,7 @@ namespace MediaBrowser.Controller.Entities /// /// The containing folder path. [IgnoreDataMember] - public override string ContainingFolderPath - { - get - { - return Path; - } - } + public override string ContainingFolderPath => Path; public override bool CanDelete() { @@ -70,31 +64,13 @@ namespace MediaBrowser.Controller.Entities } [IgnoreDataMember] - public override bool EnableAlphaNumericSorting - { - get - { - return false; - } - } + public override bool EnableAlphaNumericSorting => false; [IgnoreDataMember] - public override bool SupportsPeople - { - get - { - return false; - } - } + public override bool SupportsPeople => false; [IgnoreDataMember] - public override bool SupportsAncestors - { - get - { - return false; - } - } + public override bool SupportsAncestors => false; public static string GetPath(string name) { diff --git a/MediaBrowser.Controller/Entities/Photo.cs b/MediaBrowser.Controller/Entities/Photo.cs index 2e6830e788..686bb643b1 100644 --- a/MediaBrowser.Controller/Entities/Photo.cs +++ b/MediaBrowser.Controller/Entities/Photo.cs @@ -6,31 +6,13 @@ namespace MediaBrowser.Controller.Entities public class Photo : BaseItem { [IgnoreDataMember] - public override bool SupportsLocalMetadata - { - get - { - return false; - } - } + public override bool SupportsLocalMetadata => false; [IgnoreDataMember] - public override string MediaType - { - get - { - return Model.Entities.MediaType.Photo; - } - } + public override string MediaType => Model.Entities.MediaType.Photo; [IgnoreDataMember] - public override Folder LatestItemsIndexContainer - { - get - { - return AlbumEntity; - } - } + public override Folder LatestItemsIndexContainer => AlbumEntity; [IgnoreDataMember] diff --git a/MediaBrowser.Controller/Entities/PhotoAlbum.cs b/MediaBrowser.Controller/Entities/PhotoAlbum.cs index 42992bbd57..4cd0c8b668 100644 --- a/MediaBrowser.Controller/Entities/PhotoAlbum.cs +++ b/MediaBrowser.Controller/Entities/PhotoAlbum.cs @@ -5,30 +5,12 @@ namespace MediaBrowser.Controller.Entities public class PhotoAlbum : Folder { [IgnoreDataMember] - public override bool AlwaysScanInternalMetadataPath - { - get - { - return true; - } - } + public override bool AlwaysScanInternalMetadataPath => true; [IgnoreDataMember] - public override bool SupportsPlayedStatus - { - get - { - return false; - } - } + public override bool SupportsPlayedStatus => false; [IgnoreDataMember] - public override bool SupportsInheritedParentImages - { - get - { - return false; - } - } + public override bool SupportsInheritedParentImages => false; } } diff --git a/MediaBrowser.Controller/Entities/Studio.cs b/MediaBrowser.Controller/Entities/Studio.cs index b95199f7e1..d6da0d48c7 100644 --- a/MediaBrowser.Controller/Entities/Studio.cs +++ b/MediaBrowser.Controller/Entities/Studio.cs @@ -29,31 +29,13 @@ namespace MediaBrowser.Controller.Entities /// /// The containing folder path. [IgnoreDataMember] - public override string ContainingFolderPath - { - get - { - return Path; - } - } + public override string ContainingFolderPath => Path; [IgnoreDataMember] - public override bool IsDisplayedAsFolder - { - get - { - return true; - } - } + public override bool IsDisplayedAsFolder => true; [IgnoreDataMember] - public override bool SupportsAncestors - { - get - { - return false; - } - } + public override bool SupportsAncestors => false; public override double GetDefaultPrimaryImageAspectRatio() { @@ -81,13 +63,7 @@ namespace MediaBrowser.Controller.Entities } [IgnoreDataMember] - public override bool SupportsPeople - { - get - { - return false; - } - } + public override bool SupportsPeople => false; public static string GetPath(string name) { diff --git a/MediaBrowser.Controller/Entities/TV/Episode.cs b/MediaBrowser.Controller/Entities/TV/Episode.cs index 8a04d7a8df..072b1d89af 100644 --- a/MediaBrowser.Controller/Entities/TV/Episode.cs +++ b/MediaBrowser.Controller/Entities/TV/Episode.cs @@ -47,61 +47,25 @@ namespace MediaBrowser.Controller.Entities.TV } [IgnoreDataMember] - protected override bool SupportsOwnedItems - { - get - { - return IsStacked || MediaSourceCount > 1; - } - } + protected override bool SupportsOwnedItems => IsStacked || MediaSourceCount > 1; [IgnoreDataMember] - public override bool SupportsInheritedParentImages - { - get { return true; } - } + public override bool SupportsInheritedParentImages => true; [IgnoreDataMember] - public override bool SupportsPeople - { - get { return true; } - } + public override bool SupportsPeople => true; [IgnoreDataMember] - public int? AiredSeasonNumber - { - get - { - return AirsAfterSeasonNumber ?? AirsBeforeSeasonNumber ?? ParentIndexNumber; - } - } + public int? AiredSeasonNumber => AirsAfterSeasonNumber ?? AirsBeforeSeasonNumber ?? ParentIndexNumber; [IgnoreDataMember] - public override Folder LatestItemsIndexContainer - { - get - { - return Series; - } - } + public override Folder LatestItemsIndexContainer => Series; [IgnoreDataMember] - public override Guid DisplayParentId - { - get - { - return SeasonId; - } - } + public override Guid DisplayParentId => SeasonId; [IgnoreDataMember] - protected override bool EnableDefaultVideoUserDataKeys - { - get - { - return false; - } - } + protected override bool EnableDefaultVideoUserDataKeys => false; public override double GetDefaultPrimaryImageAspectRatio() { @@ -166,13 +130,7 @@ namespace MediaBrowser.Controller.Entities.TV } [IgnoreDataMember] - public bool IsInSeasonFolder - { - get - { - return FindParent() != null; - } - } + public bool IsInSeasonFolder => FindParent() != null; [IgnoreDataMember] public string SeriesPresentationUniqueKey { get; set; } @@ -278,13 +236,7 @@ namespace MediaBrowser.Controller.Entities.TV } [IgnoreDataMember] - public bool IsMissingEpisode - { - get - { - return LocationType == LocationType.Virtual; - } - } + public bool IsMissingEpisode => LocationType == LocationType.Virtual; [IgnoreDataMember] public Guid SeasonId { get; set; } diff --git a/MediaBrowser.Controller/Entities/TV/Season.cs b/MediaBrowser.Controller/Entities/TV/Season.cs index 4c8c9b5904..b40009e0c7 100644 --- a/MediaBrowser.Controller/Entities/TV/Season.cs +++ b/MediaBrowser.Controller/Entities/TV/Season.cs @@ -16,46 +16,22 @@ namespace MediaBrowser.Controller.Entities.TV public class Season : Folder, IHasSeries, IHasLookupInfo { [IgnoreDataMember] - public override bool SupportsAddingToPlaylist - { - get { return true; } - } + public override bool SupportsAddingToPlaylist => true; [IgnoreDataMember] - public override bool IsPreSorted - { - get - { - return true; - } - } + public override bool IsPreSorted => true; [IgnoreDataMember] - public override bool SupportsDateLastMediaAdded - { - get - { - return false; - } - } + public override bool SupportsDateLastMediaAdded => false; [IgnoreDataMember] - public override bool SupportsPeople - { - get { return true; } - } + public override bool SupportsPeople => true; [IgnoreDataMember] - public override bool SupportsInheritedParentImages - { - get { return true; } - } + public override bool SupportsInheritedParentImages => true; [IgnoreDataMember] - public override Guid DisplayParentId - { - get { return SeriesId; } - } + public override Guid DisplayParentId => SeriesId; public override double GetDefaultPrimaryImageAspectRatio() { diff --git a/MediaBrowser.Controller/Entities/TV/Series.cs b/MediaBrowser.Controller/Entities/TV/Series.cs index e48c8dd291..5ba4613c06 100644 --- a/MediaBrowser.Controller/Entities/TV/Series.cs +++ b/MediaBrowser.Controller/Entities/TV/Series.cs @@ -32,43 +32,19 @@ namespace MediaBrowser.Controller.Entities.TV public string AirTime { get; set; } [IgnoreDataMember] - public override bool SupportsAddingToPlaylist - { - get { return true; } - } + public override bool SupportsAddingToPlaylist => true; [IgnoreDataMember] - public override bool IsPreSorted - { - get - { - return true; - } - } + public override bool IsPreSorted => true; [IgnoreDataMember] - public override bool SupportsDateLastMediaAdded - { - get - { - return true; - } - } + public override bool SupportsDateLastMediaAdded => true; [IgnoreDataMember] - public override bool SupportsInheritedParentImages - { - get - { - return false; - } - } + public override bool SupportsInheritedParentImages => false; [IgnoreDataMember] - public override bool SupportsPeople - { - get { return true; } - } + public override bool SupportsPeople => true; public Guid[] LocalTrailerIds { get; set; } public Guid[] RemoteTrailerIds { get; set; } @@ -526,13 +502,6 @@ namespace MediaBrowser.Controller.Entities.TV } [IgnoreDataMember] - public override bool StopRefreshIfLocalMetadataFound - { - get - { - // Need people id's from internet metadata - return false; - } - } + public override bool StopRefreshIfLocalMetadataFound => false; } } diff --git a/MediaBrowser.Controller/Entities/Trailer.cs b/MediaBrowser.Controller/Entities/Trailer.cs index 2ce7761037..5bf22d7bc8 100644 --- a/MediaBrowser.Controller/Entities/Trailer.cs +++ b/MediaBrowser.Controller/Entities/Trailer.cs @@ -94,13 +94,6 @@ namespace MediaBrowser.Controller.Entities } [IgnoreDataMember] - public override bool StopRefreshIfLocalMetadataFound - { - get - { - // Need people id's from internet metadata - return false; - } - } + public override bool StopRefreshIfLocalMetadataFound => false; } } diff --git a/MediaBrowser.Controller/Entities/User.cs b/MediaBrowser.Controller/Entities/User.cs index 03facf1072..16fef9a824 100644 --- a/MediaBrowser.Controller/Entities/User.cs +++ b/MediaBrowser.Controller/Entities/User.cs @@ -40,14 +40,8 @@ namespace MediaBrowser.Controller.Entities // Strictly to remove IgnoreDataMember public override ItemImageInfo[] ImageInfos { - get - { - return base.ImageInfos; - } - set - { - base.ImageInfos = value; - } + get => base.ImageInfos; + set => base.ImageInfos = value; } /// @@ -57,15 +51,8 @@ namespace MediaBrowser.Controller.Entities [IgnoreDataMember] public override string Path { - get - { - // Return this so that metadata providers will look in here - return ConfigurationDirectoryPath; - } - set - { - base.Path = value; - } + get => ConfigurationDirectoryPath; + set => base.Path = value; } private string _name; @@ -75,10 +62,7 @@ namespace MediaBrowser.Controller.Entities /// The name. public override string Name { - get - { - return _name; - } + get => _name; set { _name = value; @@ -94,26 +78,14 @@ namespace MediaBrowser.Controller.Entities /// /// The containing folder path. [IgnoreDataMember] - public override string ContainingFolderPath - { - get - { - return Path; - } - } + public override string ContainingFolderPath => Path; /// /// Gets the root folder. /// /// The root folder. [IgnoreDataMember] - public Folder RootFolder - { - get - { - return LibraryManager.GetUserRootFolder(); - } - } + public Folder RootFolder => LibraryManager.GetUserRootFolder(); /// /// Gets or sets the last login date. @@ -146,7 +118,7 @@ namespace MediaBrowser.Controller.Entities return _config; } - set { _config = value; } + set => _config = value; } private volatile UserPolicy _policy; @@ -169,7 +141,7 @@ namespace MediaBrowser.Controller.Entities return _policy; } - set { _policy = value; } + set => _policy = value; } /// @@ -232,13 +204,7 @@ namespace MediaBrowser.Controller.Entities /// /// The configuration directory path. [IgnoreDataMember] - public string ConfigurationDirectoryPath - { - get - { - return GetConfigurationDirectoryPath(Name); - } - } + public string ConfigurationDirectoryPath => GetConfigurationDirectoryPath(Name); public override double GetDefaultPrimaryImageAspectRatio() { @@ -327,13 +293,7 @@ namespace MediaBrowser.Controller.Entities } [IgnoreDataMember] - public override bool SupportsPeople - { - get - { - return false; - } - } + public override bool SupportsPeople => false; public long InternalId { get; set; } diff --git a/MediaBrowser.Controller/Entities/UserItemData.cs b/MediaBrowser.Controller/Entities/UserItemData.cs index 0739d5f57c..8a87aff5f5 100644 --- a/MediaBrowser.Controller/Entities/UserItemData.cs +++ b/MediaBrowser.Controller/Entities/UserItemData.cs @@ -31,10 +31,7 @@ namespace MediaBrowser.Controller.Entities /// Rating;A 0 to 10 rating is required for UserItemData. public double? Rating { - get - { - return _rating; - } + get => _rating; set { if (value.HasValue) diff --git a/MediaBrowser.Controller/Entities/UserRootFolder.cs b/MediaBrowser.Controller/Entities/UserRootFolder.cs index 7b55d8bb98..7fe8df8af3 100644 --- a/MediaBrowser.Controller/Entities/UserRootFolder.cs +++ b/MediaBrowser.Controller/Entities/UserRootFolder.cs @@ -34,22 +34,10 @@ namespace MediaBrowser.Controller.Entities } [IgnoreDataMember] - public override bool SupportsInheritedParentImages - { - get - { - return false; - } - } + public override bool SupportsInheritedParentImages => false; [IgnoreDataMember] - public override bool SupportsPlayedStatus - { - get - { - return false; - } - } + public override bool SupportsPlayedStatus => false; private void ClearCache() { @@ -88,22 +76,10 @@ namespace MediaBrowser.Controller.Entities } [IgnoreDataMember] - protected override bool SupportsShortcutChildren - { - get - { - return true; - } - } + protected override bool SupportsShortcutChildren => true; [IgnoreDataMember] - public override bool IsPreSorted - { - get - { - return true; - } - } + public override bool IsPreSorted => true; protected override IEnumerable GetEligibleChildrenForRecursiveChildren(User user) { diff --git a/MediaBrowser.Controller/Entities/UserView.cs b/MediaBrowser.Controller/Entities/UserView.cs index 9c45a803b3..de4105df97 100644 --- a/MediaBrowser.Controller/Entities/UserView.cs +++ b/MediaBrowser.Controller/Entities/UserView.cs @@ -20,13 +20,7 @@ namespace MediaBrowser.Controller.Entities public static IPlaylistManager PlaylistManager; [IgnoreDataMember] - public string CollectionType - { - get - { - return ViewType; - } - } + public string CollectionType => ViewType; public override IEnumerable GetIdsForAncestorQuery() { @@ -48,22 +42,10 @@ namespace MediaBrowser.Controller.Entities } [IgnoreDataMember] - public override bool SupportsInheritedParentImages - { - get - { - return false; - } - } + public override bool SupportsInheritedParentImages => false; [IgnoreDataMember] - public override bool SupportsPlayedStatus - { - get - { - return false; - } - } + public override bool SupportsPlayedStatus => false; public override int GetChildCount(User user) { @@ -188,12 +170,6 @@ namespace MediaBrowser.Controller.Entities } [IgnoreDataMember] - public override bool SupportsPeople - { - get - { - return false; - } - } + public override bool SupportsPeople => false; } } diff --git a/MediaBrowser.Controller/Entities/Video.cs b/MediaBrowser.Controller/Entities/Video.cs index cc236cbbac..dd4440c3b6 100644 --- a/MediaBrowser.Controller/Entities/Video.cs +++ b/MediaBrowser.Controller/Entities/Video.cs @@ -33,28 +33,13 @@ namespace MediaBrowser.Controller.Entities public LinkedChild[] LinkedAlternateVersions { get; set; } [IgnoreDataMember] - public override bool SupportsPlayedStatus - { - get - { - return true; - } - } + public override bool SupportsPlayedStatus => true; [IgnoreDataMember] - public override bool SupportsPeople - { - get { return true; } - } + public override bool SupportsPeople => true; [IgnoreDataMember] - public override bool SupportsInheritedParentImages - { - get - { - return true; - } - } + public override bool SupportsInheritedParentImages => true; [IgnoreDataMember] public override bool SupportsPositionTicksResume @@ -106,10 +91,7 @@ namespace MediaBrowser.Controller.Entities } [IgnoreDataMember] - public override bool SupportsThemeMedia - { - get { return true; } - } + public override bool SupportsThemeMedia => true; /// /// Gets or sets the timestamp. @@ -199,10 +181,7 @@ namespace MediaBrowser.Controller.Entities } [IgnoreDataMember] - public override bool SupportsAddingToPlaylist - { - get { return true; } - } + public override bool SupportsAddingToPlaylist => true; [IgnoreDataMember] public int MediaSourceCount @@ -222,16 +201,10 @@ namespace MediaBrowser.Controller.Entities } [IgnoreDataMember] - public bool IsStacked - { - get { return AdditionalParts.Length > 0; } - } + public bool IsStacked => AdditionalParts.Length > 0; [IgnoreDataMember] - public override bool HasLocalAlternateVersions - { - get { return LocalAlternateVersions.Length > 0; } - } + public override bool HasLocalAlternateVersions => LocalAlternateVersions.Length > 0; public IEnumerable GetAdditionalPartIds() { @@ -289,13 +262,7 @@ namespace MediaBrowser.Controller.Entities } [IgnoreDataMember] - protected virtual bool EnableDefaultVideoUserDataKeys - { - get - { - return true; - } - } + protected virtual bool EnableDefaultVideoUserDataKeys => true; public override List GetUserDataKeys() { @@ -466,23 +433,14 @@ namespace MediaBrowser.Controller.Entities /// /// true if [is3 D]; otherwise, false. [IgnoreDataMember] - public bool Is3D - { - get { return Video3DFormat.HasValue; } - } + public bool Is3D => Video3DFormat.HasValue; /// /// Gets the type of the media. /// /// The type of the media. [IgnoreDataMember] - public override string MediaType - { - get - { - return Model.Entities.MediaType.Video; - } - } + public override string MediaType => Model.Entities.MediaType.Video; protected override async Task RefreshedOwnedItems(MetadataRefreshOptions options, List fileSystemChildren, CancellationToken cancellationToken) { diff --git a/MediaBrowser.Controller/Entities/Year.cs b/MediaBrowser.Controller/Entities/Year.cs index 054724b21f..643c0ddcf0 100644 --- a/MediaBrowser.Controller/Entities/Year.cs +++ b/MediaBrowser.Controller/Entities/Year.cs @@ -25,13 +25,7 @@ namespace MediaBrowser.Controller.Entities /// /// The containing folder path. [IgnoreDataMember] - public override string ContainingFolderPath - { - get - { - return Path; - } - } + public override string ContainingFolderPath => Path; public override double GetDefaultPrimaryImageAspectRatio() { @@ -42,13 +36,7 @@ namespace MediaBrowser.Controller.Entities } [IgnoreDataMember] - public override bool SupportsAncestors - { - get - { - return false; - } - } + public override bool SupportsAncestors => false; public override bool CanDelete() { @@ -89,13 +77,7 @@ namespace MediaBrowser.Controller.Entities } [IgnoreDataMember] - public override bool SupportsPeople - { - get - { - return false; - } - } + public override bool SupportsPeople => false; public static string GetPath(string name) { diff --git a/MediaBrowser.Controller/Library/ItemResolveArgs.cs b/MediaBrowser.Controller/Library/ItemResolveArgs.cs index dfe23f1930..eb459e8904 100644 --- a/MediaBrowser.Controller/Library/ItemResolveArgs.cs +++ b/MediaBrowser.Controller/Library/ItemResolveArgs.cs @@ -67,13 +67,7 @@ namespace MediaBrowser.Controller.Library /// Gets a value indicating whether this instance is directory. /// /// true if this instance is directory; otherwise, false. - public bool IsDirectory - { - get - { - return FileInfo.IsDirectory; - } - } + public bool IsDirectory => FileInfo.IsDirectory; /// /// Gets a value indicating whether this instance is vf. @@ -103,13 +97,7 @@ namespace MediaBrowser.Controller.Library /// Gets a value indicating whether this instance is physical root. /// /// true if this instance is physical root; otherwise, false. - public bool IsPhysicalRoot - { - get - { - return IsDirectory && BaseItem.FileSystem.AreEqual(Path, _appPaths.RootFolderPath); - } - } + public bool IsPhysicalRoot => IsDirectory && BaseItem.FileSystem.AreEqual(Path, _appPaths.RootFolderPath); /// /// Gets or sets the additional locations. diff --git a/MediaBrowser.Controller/LiveTv/LiveTvChannel.cs b/MediaBrowser.Controller/LiveTv/LiveTvChannel.cs index 93300243b6..55f47aae9b 100644 --- a/MediaBrowser.Controller/LiveTv/LiveTvChannel.cs +++ b/MediaBrowser.Controller/LiveTv/LiveTvChannel.cs @@ -32,28 +32,13 @@ namespace MediaBrowser.Controller.LiveTv } [IgnoreDataMember] - public override bool SupportsPositionTicksResume - { - get - { - return false; - } - } + public override bool SupportsPositionTicksResume => false; [IgnoreDataMember] - public override SourceType SourceType - { - get { return SourceType.LiveTV; } - } + public override SourceType SourceType => SourceType.LiveTV; [IgnoreDataMember] - public override bool EnableRememberingTrackSelections - { - get - { - return false; - } - } + public override bool EnableRememberingTrackSelections => false; /// /// Gets or sets the number. @@ -68,14 +53,7 @@ namespace MediaBrowser.Controller.LiveTv public ChannelType ChannelType { get; set; } [IgnoreDataMember] - public override LocationType LocationType - { - get - { - // TODO: This should be removed - return LocationType.Remote; - } - } + public override LocationType LocationType => LocationType.Remote; protected override string CreateSortName() { @@ -93,13 +71,7 @@ namespace MediaBrowser.Controller.LiveTv } [IgnoreDataMember] - public override string MediaType - { - get - { - return ChannelType == ChannelType.Radio ? Model.Entities.MediaType.Audio : Model.Entities.MediaType.Video; - } - } + public override string MediaType => ChannelType == ChannelType.Radio ? Model.Entities.MediaType.Audio : Model.Entities.MediaType.Video; public override string GetClientTypeName() { @@ -176,13 +148,7 @@ namespace MediaBrowser.Controller.LiveTv /// /// true if this instance is kids; otherwise, false. [IgnoreDataMember] - public bool IsKids - { - get - { - return Tags.Contains("Kids", StringComparer.OrdinalIgnoreCase); - } - } + public bool IsKids => Tags.Contains("Kids", StringComparer.OrdinalIgnoreCase); [IgnoreDataMember] public bool IsRepeat { get; set; } diff --git a/MediaBrowser.Controller/LiveTv/LiveTvProgram.cs b/MediaBrowser.Controller/LiveTv/LiveTvProgram.cs index 15394cc209..8bde6a5da8 100644 --- a/MediaBrowser.Controller/LiveTv/LiveTvProgram.cs +++ b/MediaBrowser.Controller/LiveTv/LiveTvProgram.cs @@ -63,10 +63,7 @@ namespace MediaBrowser.Controller.LiveTv } [IgnoreDataMember] - public override SourceType SourceType - { - get { return SourceType.LiveTV; } - } + public override SourceType SourceType => SourceType.LiveTV; /// /// The start date of the program, in UTC. @@ -103,13 +100,7 @@ namespace MediaBrowser.Controller.LiveTv /// /// true if this instance is sports; otherwise, false. [IgnoreDataMember] - public bool IsSports - { - get - { - return Tags.Contains("Sports", StringComparer.OrdinalIgnoreCase); - } - } + public bool IsSports => Tags.Contains("Sports", StringComparer.OrdinalIgnoreCase); /// /// Gets or sets a value indicating whether this instance is series. @@ -123,52 +114,28 @@ namespace MediaBrowser.Controller.LiveTv /// /// true if this instance is live; otherwise, false. [IgnoreDataMember] - public bool IsLive - { - get - { - return Tags.Contains("Live", StringComparer.OrdinalIgnoreCase); - } - } + public bool IsLive => Tags.Contains("Live", StringComparer.OrdinalIgnoreCase); /// /// Gets or sets a value indicating whether this instance is news. /// /// true if this instance is news; otherwise, false. [IgnoreDataMember] - public bool IsNews - { - get - { - return Tags.Contains("News", StringComparer.OrdinalIgnoreCase); - } - } + public bool IsNews => Tags.Contains("News", StringComparer.OrdinalIgnoreCase); /// /// Gets or sets a value indicating whether this instance is kids. /// /// true if this instance is kids; otherwise, false. [IgnoreDataMember] - public bool IsKids - { - get - { - return Tags.Contains("Kids", StringComparer.OrdinalIgnoreCase); - } - } + public bool IsKids => Tags.Contains("Kids", StringComparer.OrdinalIgnoreCase); /// /// Gets or sets a value indicating whether this instance is premiere. /// /// true if this instance is premiere; otherwise, false. [IgnoreDataMember] - public bool IsPremiere - { - get - { - return Tags.Contains("Premiere", StringComparer.OrdinalIgnoreCase); - } - } + public bool IsPremiere => Tags.Contains("Premiere", StringComparer.OrdinalIgnoreCase); /// /// Returns the folder containing the item. @@ -176,13 +143,7 @@ namespace MediaBrowser.Controller.LiveTv /// /// The containing folder path. [IgnoreDataMember] - public override string ContainingFolderPath - { - get - { - return Path; - } - } + public override string ContainingFolderPath => Path; //[IgnoreDataMember] //public override string MediaType @@ -251,13 +212,7 @@ namespace MediaBrowser.Controller.LiveTv } [IgnoreDataMember] - public override bool SupportsAncestors - { - get - { - return false; - } - } + public override bool SupportsAncestors => false; private LiveTvOptions GetConfiguration() { diff --git a/MediaBrowser.Controller/LiveTv/TimerInfo.cs b/MediaBrowser.Controller/LiveTv/TimerInfo.cs index 8088e73324..d89ec4fbf0 100644 --- a/MediaBrowser.Controller/LiveTv/TimerInfo.cs +++ b/MediaBrowser.Controller/LiveTv/TimerInfo.cs @@ -115,27 +115,11 @@ namespace MediaBrowser.Controller.LiveTv /// The episode number. public int? EpisodeNumber { get; set; } public bool IsMovie { get; set; } - public bool IsKids - { - get - { - return Tags.Contains("Kids", StringComparer.OrdinalIgnoreCase); - } - } - public bool IsSports - { - get - { - return Tags.Contains("Sports", StringComparer.OrdinalIgnoreCase); - } - } - public bool IsNews - { - get - { - return Tags.Contains("News", StringComparer.OrdinalIgnoreCase); - } - } + public bool IsKids => Tags.Contains("Kids", StringComparer.OrdinalIgnoreCase); + + public bool IsSports => Tags.Contains("Sports", StringComparer.OrdinalIgnoreCase); + + public bool IsNews => Tags.Contains("News", StringComparer.OrdinalIgnoreCase); public bool IsSeries { get; set; } /// @@ -143,22 +127,10 @@ namespace MediaBrowser.Controller.LiveTv /// /// true if this instance is live; otherwise, false. [IgnoreDataMember] - public bool IsLive - { - get - { - return Tags.Contains("Live", StringComparer.OrdinalIgnoreCase); - } - } + public bool IsLive => Tags.Contains("Live", StringComparer.OrdinalIgnoreCase); [IgnoreDataMember] - public bool IsPremiere - { - get - { - return Tags.Contains("Premiere", StringComparer.OrdinalIgnoreCase); - } - } + public bool IsPremiere => Tags.Contains("Premiere", StringComparer.OrdinalIgnoreCase); public int? ProductionYear { get; set; } public string EpisodeTitle { get; set; } diff --git a/MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs b/MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs index dd846fafe2..bb09d365e3 100644 --- a/MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs +++ b/MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs @@ -61,53 +61,17 @@ namespace MediaBrowser.Controller.MediaEncoding } } - public bool IgnoreInputDts - { - get - { - return MediaSource.IgnoreDts; - } - } + public bool IgnoreInputDts => MediaSource.IgnoreDts; - public bool IgnoreInputIndex - { - get - { - return MediaSource.IgnoreIndex; - } - } + public bool IgnoreInputIndex => MediaSource.IgnoreIndex; - public bool GenPtsInput - { - get - { - return MediaSource.GenPtsInput; - } - } + public bool GenPtsInput => MediaSource.GenPtsInput; - public bool DiscardCorruptFramesInput - { - get - { - return false; - } - } + public bool DiscardCorruptFramesInput => false; - public bool EnableFastSeekInput - { - get - { - return false; - } - } + public bool EnableFastSeekInput => false; - public bool GenPtsOutput - { - get - { - return false; - } - } + public bool GenPtsOutput => false; public string OutputContainer { get; set; } @@ -142,15 +106,9 @@ namespace MediaBrowser.Controller.MediaEncoding public BaseEncodingJobOptions BaseRequest { get; set; } - public long? StartTimeTicks - { - get { return BaseRequest.StartTimeTicks; } - } + public long? StartTimeTicks => BaseRequest.StartTimeTicks; - public bool CopyTimestamps - { - get { return BaseRequest.CopyTimestamps; } - } + public bool CopyTimestamps => BaseRequest.CopyTimestamps; public int? OutputAudioBitrate; public int? OutputAudioChannels; @@ -323,13 +281,7 @@ namespace MediaBrowser.Controller.MediaEncoding SupportedSubtitleCodecs = Array.Empty(); } - public bool IsSegmentedLiveStream - { - get - { - return TranscodingType != TranscodingJobType.Progressive && !RunTimeTicks.HasValue; - } - } + public bool IsSegmentedLiveStream => TranscodingType != TranscodingJobType.Progressive && !RunTimeTicks.HasValue; public bool EnableBreakOnNonKeyFrames(string videoCodec) { @@ -346,13 +298,7 @@ namespace MediaBrowser.Controller.MediaEncoding return false; } - public int? TotalOutputBitrate - { - get - { - return (OutputAudioBitrate ?? 0) + (OutputVideoBitrate ?? 0); - } - } + public int? TotalOutputBitrate => (OutputAudioBitrate ?? 0) + (OutputVideoBitrate ?? 0); public int? OutputWidth { diff --git a/MediaBrowser.Controller/MediaEncoding/EncodingJobOptions.cs b/MediaBrowser.Controller/MediaEncoding/EncodingJobOptions.cs index 48d2b65adc..625f0b3892 100644 --- a/MediaBrowser.Controller/MediaEncoding/EncodingJobOptions.cs +++ b/MediaBrowser.Controller/MediaEncoding/EncodingJobOptions.cs @@ -20,13 +20,7 @@ namespace MediaBrowser.Controller.MediaEncoding /// Gets a value indicating whether this instance has fixed resolution. /// /// true if this instance has fixed resolution; otherwise, false. - public bool HasFixedResolution - { - get - { - return Width.HasValue || Height.HasValue; - } - } + public bool HasFixedResolution => Width.HasValue || Height.HasValue; private readonly CultureInfo _usCulture = new CultureInfo("en-US"); public EncodingJobOptions(StreamInfo info, DeviceProfile deviceProfile) diff --git a/MediaBrowser.Controller/Net/AuthenticatedAttribute.cs b/MediaBrowser.Controller/Net/AuthenticatedAttribute.cs index 9ef0eb80f9..64c2294e3d 100644 --- a/MediaBrowser.Controller/Net/AuthenticatedAttribute.cs +++ b/MediaBrowser.Controller/Net/AuthenticatedAttribute.cs @@ -44,10 +44,7 @@ namespace MediaBrowser.Controller.Net /// >0 Executed after global request filters /// /// The priority. - public int Priority - { - get { return 0; } - } + public int Priority => 0; public string[] GetRoles() { diff --git a/MediaBrowser.Controller/Net/AuthorizationInfo.cs b/MediaBrowser.Controller/Net/AuthorizationInfo.cs index 2471989a08..3e004763df 100644 --- a/MediaBrowser.Controller/Net/AuthorizationInfo.cs +++ b/MediaBrowser.Controller/Net/AuthorizationInfo.cs @@ -9,13 +9,7 @@ namespace MediaBrowser.Controller.Net /// Gets or sets the user identifier. /// /// The user identifier. - public Guid UserId - { - get - { - return User == null ? Guid.Empty : User.Id; - } - } + public Guid UserId => User == null ? Guid.Empty : User.Id; /// /// Gets or sets the device identifier. diff --git a/MediaBrowser.Controller/Net/BasePeriodicWebSocketListener.cs b/MediaBrowser.Controller/Net/BasePeriodicWebSocketListener.cs index bee53b4c58..4e7e1c8ed2 100644 --- a/MediaBrowser.Controller/Net/BasePeriodicWebSocketListener.cs +++ b/MediaBrowser.Controller/Net/BasePeriodicWebSocketListener.cs @@ -83,13 +83,7 @@ namespace MediaBrowser.Controller.Net protected readonly CultureInfo UsCulture = new CultureInfo("en-US"); - protected virtual bool SendOnTimer - { - get - { - return false; - } - } + protected virtual bool SendOnTimer => false; protected virtual void ParseMessageParams(string[] values) { diff --git a/MediaBrowser.Controller/Playlists/Playlist.cs b/MediaBrowser.Controller/Playlists/Playlist.cs index af8d6cb114..9696436608 100644 --- a/MediaBrowser.Controller/Playlists/Playlist.cs +++ b/MediaBrowser.Controller/Playlists/Playlist.cs @@ -34,13 +34,7 @@ namespace MediaBrowser.Controller.Playlists } [IgnoreDataMember] - public bool IsFile - { - get - { - return IsPlaylistFile(Path); - } - } + public bool IsFile => IsPlaylistFile(Path); public static bool IsPlaylistFile(string path) { @@ -64,49 +58,19 @@ namespace MediaBrowser.Controller.Playlists } [IgnoreDataMember] - protected override bool FilterLinkedChildrenPerUser - { - get - { - return true; - } - } + protected override bool FilterLinkedChildrenPerUser => true; [IgnoreDataMember] - public override bool SupportsInheritedParentImages - { - get - { - return false; - } - } + public override bool SupportsInheritedParentImages => false; [IgnoreDataMember] - public override bool SupportsPlayedStatus - { - get - { - return string.Equals(MediaType, "Video", StringComparison.OrdinalIgnoreCase); - } - } + public override bool SupportsPlayedStatus => string.Equals(MediaType, "Video", StringComparison.OrdinalIgnoreCase); [IgnoreDataMember] - public override bool AlwaysScanInternalMetadataPath - { - get - { - return true; - } - } + public override bool AlwaysScanInternalMetadataPath => true; [IgnoreDataMember] - public override bool SupportsCumulativeRunTimeTicks - { - get - { - return true; - } - } + public override bool SupportsCumulativeRunTimeTicks => true; public override double GetDefaultPrimaryImageAspectRatio() { @@ -229,24 +193,12 @@ namespace MediaBrowser.Controller.Playlists } [IgnoreDataMember] - public override bool IsPreSorted - { - get - { - return true; - } - } + public override bool IsPreSorted => true; public string PlaylistMediaType { get; set; } [IgnoreDataMember] - public override string MediaType - { - get - { - return PlaylistMediaType; - } - } + public override string MediaType => PlaylistMediaType; public void SetMediaType(string value) { diff --git a/MediaBrowser.Controller/Resolvers/BaseItemResolver.cs b/MediaBrowser.Controller/Resolvers/BaseItemResolver.cs index 1016535e1c..637a7e3f05 100644 --- a/MediaBrowser.Controller/Resolvers/BaseItemResolver.cs +++ b/MediaBrowser.Controller/Resolvers/BaseItemResolver.cs @@ -24,13 +24,7 @@ namespace MediaBrowser.Controller.Resolvers /// Gets the priority. /// /// The priority. - public virtual ResolverPriority Priority - { - get - { - return ResolverPriority.First; - } - } + public virtual ResolverPriority Priority => ResolverPriority.First; /// /// Sets initial values on the newly resolved item diff --git a/MediaBrowser.LocalMetadata/BaseXmlProvider.cs b/MediaBrowser.LocalMetadata/BaseXmlProvider.cs index 2e4de4d933..e67b3ebacd 100644 --- a/MediaBrowser.LocalMetadata/BaseXmlProvider.cs +++ b/MediaBrowser.LocalMetadata/BaseXmlProvider.cs @@ -67,32 +67,13 @@ namespace MediaBrowser.LocalMetadata return file.Exists && FileSystem.GetLastWriteTimeUtc(file) > item.DateLastSaved; } - public string Name - { - get - { - return XmlProviderUtils.Name; - } - } + public string Name => XmlProviderUtils.Name; - public virtual int Order - { - get - { - // After Nfo - return 1; - } - } + public virtual int Order => 1; } static class XmlProviderUtils { - public static string Name - { - get - { - return "Emby Xml"; - } - } + public static string Name => "Emby Xml"; } } diff --git a/MediaBrowser.LocalMetadata/Images/CollectionFolderImageProvider.cs b/MediaBrowser.LocalMetadata/Images/CollectionFolderImageProvider.cs index 73f9b69c86..f5e028ab81 100644 --- a/MediaBrowser.LocalMetadata/Images/CollectionFolderImageProvider.cs +++ b/MediaBrowser.LocalMetadata/Images/CollectionFolderImageProvider.cs @@ -14,24 +14,14 @@ namespace MediaBrowser.LocalMetadata.Images _fileSystem = fileSystem; } - public string Name - { - get { return "Collection Folder Images"; } - } + public string Name => "Collection Folder Images"; public bool Supports(BaseItem item) { return item is CollectionFolder && item.SupportsLocalMetadata; } - public int Order - { - get - { - // Run after LocalImageProvider - return 1; - } - } + public int Order => 1; public List GetImages(BaseItem item, IDirectoryService directoryService) { diff --git a/MediaBrowser.LocalMetadata/Images/EpisodeLocalImageProvider.cs b/MediaBrowser.LocalMetadata/Images/EpisodeLocalImageProvider.cs index 589cbf4dfe..894f461296 100644 --- a/MediaBrowser.LocalMetadata/Images/EpisodeLocalImageProvider.cs +++ b/MediaBrowser.LocalMetadata/Images/EpisodeLocalImageProvider.cs @@ -18,15 +18,9 @@ namespace MediaBrowser.LocalMetadata.Images _fileSystem = fileSystem; } - public string Name - { - get { return "Local Images"; } - } + public string Name => "Local Images"; - public int Order - { - get { return 0; } - } + public int Order => 0; public bool Supports(BaseItem item) { diff --git a/MediaBrowser.LocalMetadata/Images/InternalMetadataFolderImageProvider.cs b/MediaBrowser.LocalMetadata/Images/InternalMetadataFolderImageProvider.cs index 23d65e5ac4..2a2f36fbd6 100644 --- a/MediaBrowser.LocalMetadata/Images/InternalMetadataFolderImageProvider.cs +++ b/MediaBrowser.LocalMetadata/Images/InternalMetadataFolderImageProvider.cs @@ -19,10 +19,7 @@ namespace MediaBrowser.LocalMetadata.Images _fileSystem = fileSystem; } - public string Name - { - get { return "Internal Images"; } - } + public string Name => "Internal Images"; public bool Supports(BaseItem item) { @@ -50,14 +47,7 @@ namespace MediaBrowser.LocalMetadata.Images return true; } - public int Order - { - get - { - // Make sure this is last so that all other locations are scanned first - return 1000; - } - } + public int Order => 1000; public List GetImages(BaseItem item, IDirectoryService directoryService) { diff --git a/MediaBrowser.LocalMetadata/Images/LocalImageProvider.cs b/MediaBrowser.LocalMetadata/Images/LocalImageProvider.cs index 479e13da44..0a4928ed7f 100644 --- a/MediaBrowser.LocalMetadata/Images/LocalImageProvider.cs +++ b/MediaBrowser.LocalMetadata/Images/LocalImageProvider.cs @@ -21,15 +21,9 @@ namespace MediaBrowser.LocalMetadata.Images _fileSystem = fileSystem; } - public string Name - { - get { return "Local Images"; } - } + public string Name => "Local Images"; - public int Order - { - get { return 0; } - } + public int Order => 0; public bool Supports(BaseItem item) { diff --git a/MediaBrowser.LocalMetadata/Savers/BaseXmlSaver.cs b/MediaBrowser.LocalMetadata/Savers/BaseXmlSaver.cs index 4fef3055b1..2ddf922f96 100644 --- a/MediaBrowser.LocalMetadata/Savers/BaseXmlSaver.cs +++ b/MediaBrowser.LocalMetadata/Savers/BaseXmlSaver.cs @@ -42,21 +42,9 @@ namespace MediaBrowser.LocalMetadata.Savers protected ILogger Logger { get; private set; } protected IXmlReaderSettingsFactory XmlReaderSettingsFactory { get; private set; } - protected ItemUpdateType MinimumUpdateType - { - get - { - return ItemUpdateType.MetadataDownload; - } - } + protected ItemUpdateType MinimumUpdateType => ItemUpdateType.MetadataDownload; - public string Name - { - get - { - return XmlProviderUtils.Name; - } - } + public string Name => XmlProviderUtils.Name; public string GetSavePath(BaseItem item) { diff --git a/MediaBrowser.MediaEncoding/Encoder/AudioEncoder.cs b/MediaBrowser.MediaEncoding/Encoder/AudioEncoder.cs index 05a2d84e92..d5773fe315 100644 --- a/MediaBrowser.MediaEncoding/Encoder/AudioEncoder.cs +++ b/MediaBrowser.MediaEncoding/Encoder/AudioEncoder.cs @@ -53,10 +53,6 @@ namespace MediaBrowser.MediaEncoding.Encoder return null; } - protected override bool IsVideoEncoder - { - get { return false; } - } - + protected override bool IsVideoEncoder => false; } } diff --git a/MediaBrowser.MediaEncoding/Encoder/EncodingJob.cs b/MediaBrowser.MediaEncoding/Encoder/EncodingJob.cs index a3a6506bc4..df78d117af 100644 --- a/MediaBrowser.MediaEncoding/Encoder/EncodingJob.cs +++ b/MediaBrowser.MediaEncoding/Encoder/EncodingJob.cs @@ -20,8 +20,8 @@ namespace MediaBrowser.MediaEncoding.Encoder public EncodingJobOptions Options { - get { return (EncodingJobOptions)BaseRequest; } - set { BaseRequest = value; } + get => (EncodingJobOptions)BaseRequest; + set => BaseRequest = value; } public string Id { get; set; } diff --git a/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs b/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs index 7b368923c3..8489cc9b17 100644 --- a/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs +++ b/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs @@ -415,10 +415,7 @@ namespace MediaBrowser.MediaEncoding.Encoder /// Gets the encoder path. /// /// The encoder path. - public string EncoderPath - { - get { return FFMpegPath; } - } + public string EncoderPath => FFMpegPath; /// /// Gets the media info. diff --git a/MediaBrowser.MediaEncoding/Encoder/VideoEncoder.cs b/MediaBrowser.MediaEncoding/Encoder/VideoEncoder.cs index fe315d83c5..bf23a73bd4 100644 --- a/MediaBrowser.MediaEncoding/Encoder/VideoEncoder.cs +++ b/MediaBrowser.MediaEncoding/Encoder/VideoEncoder.cs @@ -54,10 +54,6 @@ namespace MediaBrowser.MediaEncoding.Encoder return null; } - protected override bool IsVideoEncoder - { - get { return true; } - } - + protected override bool IsVideoEncoder => true; } } diff --git a/MediaBrowser.MediaEncoding/Subtitles/OpenSubtitleDownloader.cs b/MediaBrowser.MediaEncoding/Subtitles/OpenSubtitleDownloader.cs index 0e418ecf7e..a1d925881c 100644 --- a/MediaBrowser.MediaEncoding/Subtitles/OpenSubtitleDownloader.cs +++ b/MediaBrowser.MediaEncoding/Subtitles/OpenSubtitleDownloader.cs @@ -83,10 +83,7 @@ namespace MediaBrowser.MediaEncoding.Subtitles return _encryption.DecryptString(password.Substring(2)); } - public string Name - { - get { return "Open Subtitles"; } - } + public string Name => "Open Subtitles"; private SubtitleOptions GetOptions() { diff --git a/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs b/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs index 58a05e2f33..3b75146136 100644 --- a/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs +++ b/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs @@ -60,13 +60,7 @@ namespace MediaBrowser.MediaEncoding.Subtitles _textEncoding = textEncoding; } - private string SubtitleCachePath - { - get - { - return Path.Combine(_appPaths.DataPath, "subtitles"); - } - } + private string SubtitleCachePath => Path.Combine(_appPaths.DataPath, "subtitles"); private Stream ConvertSubtitles(Stream stream, string inputFormat, diff --git a/MediaBrowser.Model/Dlna/SortCriteria.cs b/MediaBrowser.Model/Dlna/SortCriteria.cs index 7465e05f89..b5c1ac408e 100644 --- a/MediaBrowser.Model/Dlna/SortCriteria.cs +++ b/MediaBrowser.Model/Dlna/SortCriteria.cs @@ -4,10 +4,7 @@ namespace MediaBrowser.Model.Dlna { public class SortCriteria { - public SortOrder SortOrder - { - get { return SortOrder.Ascending; } - } + public SortOrder SortOrder => SortOrder.Ascending; public SortCriteria(string value) { diff --git a/MediaBrowser.Model/Dlna/StreamInfo.cs b/MediaBrowser.Model/Dlna/StreamInfo.cs index 2bc6908db5..86d7c9d621 100644 --- a/MediaBrowser.Model/Dlna/StreamInfo.cs +++ b/MediaBrowser.Model/Dlna/StreamInfo.cs @@ -127,22 +127,11 @@ namespace MediaBrowser.Model.Dlna public Dictionary StreamOptions { get; private set; } - public string MediaSourceId - { - get - { - return MediaSource == null ? null : MediaSource.Id; - } - } + public string MediaSourceId => MediaSource == null ? null : MediaSource.Id; - public bool IsDirectStream - { - get - { - return PlayMethod == PlayMethod.DirectStream || - PlayMethod == PlayMethod.DirectPlay; - } - } + public bool IsDirectStream => + PlayMethod == PlayMethod.DirectStream || + PlayMethod == PlayMethod.DirectPlay; public string ToUrl(string baseUrl, string accessToken) { @@ -911,13 +900,7 @@ namespace MediaBrowser.Model.Dlna } } - public int? TargetTotalBitrate - { - get - { - return (TargetAudioBitrate ?? 0) + (TargetVideoBitrate ?? 0); - } - } + public int? TargetTotalBitrate => (TargetAudioBitrate ?? 0) + (TargetVideoBitrate ?? 0); public bool? IsTargetAnamorphic { diff --git a/MediaBrowser.Model/Drawing/ImageSize.cs b/MediaBrowser.Model/Drawing/ImageSize.cs index b6866d38e3..b27df346cb 100644 --- a/MediaBrowser.Model/Drawing/ImageSize.cs +++ b/MediaBrowser.Model/Drawing/ImageSize.cs @@ -16,14 +16,8 @@ namespace MediaBrowser.Model.Drawing /// The height. public double Height { - get - { - return _height; - } - set - { - _height = value; - } + get => _height; + set => _height = value; } /// @@ -32,8 +26,8 @@ namespace MediaBrowser.Model.Drawing /// The width. public double Width { - get { return _width; } - set { _width = value; } + get => _width; + set => _width = value; } public bool Equals(ImageSize size) diff --git a/MediaBrowser.Model/Dto/BaseItemPerson.cs b/MediaBrowser.Model/Dto/BaseItemPerson.cs index f42ef4c915..7011ff8ea5 100644 --- a/MediaBrowser.Model/Dto/BaseItemPerson.cs +++ b/MediaBrowser.Model/Dto/BaseItemPerson.cs @@ -42,12 +42,6 @@ namespace MediaBrowser.Model.Dto /// /// true if this instance has primary image; otherwise, false. [IgnoreDataMember] - public bool HasPrimaryImage - { - get - { - return PrimaryImageTag != null; - } - } + public bool HasPrimaryImage => PrimaryImageTag != null; } } diff --git a/MediaBrowser.Model/Entities/LibraryUpdateInfo.cs b/MediaBrowser.Model/Entities/LibraryUpdateInfo.cs index 9c9b3ef676..b83df87e23 100644 --- a/MediaBrowser.Model/Entities/LibraryUpdateInfo.cs +++ b/MediaBrowser.Model/Entities/LibraryUpdateInfo.cs @@ -38,13 +38,7 @@ namespace MediaBrowser.Model.Entities public string[] CollectionFolders { get; set; } - public bool IsEmpty - { - get - { - return FoldersAddedTo.Length == 0 && FoldersRemovedFrom.Length == 0 && ItemsAdded.Length == 0 && ItemsRemoved.Length == 0 && ItemsUpdated.Length == 0 && CollectionFolders.Length == 0; - } - } + public bool IsEmpty => FoldersAddedTo.Length == 0 && FoldersRemovedFrom.Length == 0 && ItemsAdded.Length == 0 && ItemsRemoved.Length == 0 && ItemsUpdated.Length == 0 && CollectionFolders.Length == 0; /// /// Initializes a new instance of the class. diff --git a/MediaBrowser.Model/Services/QueryParamCollection.cs b/MediaBrowser.Model/Services/QueryParamCollection.cs index 05ba6f18d3..4297b97c66 100644 --- a/MediaBrowser.Model/Services/QueryParamCollection.cs +++ b/MediaBrowser.Model/Services/QueryParamCollection.cs @@ -177,40 +177,8 @@ namespace MediaBrowser.Model.Services /// The query parameter value or array of values public string this[string name] { - get { return Get(name); } - set - { - Set(name, value); - //var parameters = this.Where(p => p.Name == name).ToArray(); - //var values = new[] { value }; - - //for (int i = 0; ; i++) - //{ - // if (i < parameters.Length && i < values.Length) - // { - // if (values[i] == null) - // Remove(parameters[i]); - // else if (values[i] is NameValuePair) - // this[IndexOf(parameters[i])] = (NameValuePair)values[i]; - // else - // parameters[i].Value = values[i]; - // } - // else if (i < parameters.Length) - // Remove(parameters[i]); - // else if (i < values.Length) - // { - // if (values[i] != null) - // { - // if (values[i] is NameValuePair) - // Add((NameValuePair)values[i]); - // else - // Add(name, values[i]); - // } - // } - // else - // break; - //} - } + get => Get(name); + set => Set(name, value); } private string GetQueryStringValue(NameValuePair pair) diff --git a/MediaBrowser.Model/Updates/CheckForUpdateResult.cs b/MediaBrowser.Model/Updates/CheckForUpdateResult.cs index 79558b0cf9..ed6ed22a06 100644 --- a/MediaBrowser.Model/Updates/CheckForUpdateResult.cs +++ b/MediaBrowser.Model/Updates/CheckForUpdateResult.cs @@ -18,7 +18,7 @@ namespace MediaBrowser.Model.Updates /// The available version. public string AvailableVersion { - get { return Package != null ? Package.versionStr : "0.0.0.1"; } + get => Package != null ? Package.versionStr : "0.0.0.1"; set { } // need this for the serializer } diff --git a/MediaBrowser.Model/Updates/PackageVersionInfo.cs b/MediaBrowser.Model/Updates/PackageVersionInfo.cs index 570fb3e022..be531770d4 100644 --- a/MediaBrowser.Model/Updates/PackageVersionInfo.cs +++ b/MediaBrowser.Model/Updates/PackageVersionInfo.cs @@ -36,10 +36,7 @@ namespace MediaBrowser.Model.Updates /// /// The version. [IgnoreDataMember] - public Version version - { - get { return _version ?? (_version = new Version(ValueOrDefault(versionStr, "0.0.0.1"))); } - } + public Version version => _version ?? (_version = new Version(ValueOrDefault(versionStr, "0.0.0.1"))); /// /// Values the or default. diff --git a/MediaBrowser.Providers/BoxSets/BoxSetMetadataService.cs b/MediaBrowser.Providers/BoxSets/BoxSetMetadataService.cs index 99fbddf098..693edb1435 100644 --- a/MediaBrowser.Providers/BoxSets/BoxSetMetadataService.cs +++ b/MediaBrowser.Providers/BoxSets/BoxSetMetadataService.cs @@ -52,36 +52,12 @@ namespace MediaBrowser.Providers.BoxSets { } - protected override bool EnableUpdatingGenresFromChildren - { - get - { - return true; - } - } + protected override bool EnableUpdatingGenresFromChildren => true; - protected override bool EnableUpdatingOfficialRatingFromChildren - { - get - { - return true; - } - } + protected override bool EnableUpdatingOfficialRatingFromChildren => true; - protected override bool EnableUpdatingStudiosFromChildren - { - get - { - return true; - } - } + protected override bool EnableUpdatingStudiosFromChildren => true; - protected override bool EnableUpdatingPremiereDateFromChildren - { - get - { - return true; - } - } + protected override bool EnableUpdatingPremiereDateFromChildren => true; } } diff --git a/MediaBrowser.Providers/BoxSets/MovieDbBoxSetImageProvider.cs b/MediaBrowser.Providers/BoxSets/MovieDbBoxSetImageProvider.cs index 6619ea980e..c6c1a2a945 100644 --- a/MediaBrowser.Providers/BoxSets/MovieDbBoxSetImageProvider.cs +++ b/MediaBrowser.Providers/BoxSets/MovieDbBoxSetImageProvider.cs @@ -23,15 +23,9 @@ namespace MediaBrowser.Providers.BoxSets _httpClient = httpClient; } - public string Name - { - get { return ProviderName; } - } + public string Name => ProviderName; - public static string ProviderName - { - get { return "TheMovieDb"; } - } + public static string ProviderName => "TheMovieDb"; public bool Supports(BaseItem item) { @@ -150,10 +144,7 @@ namespace MediaBrowser.Providers.BoxSets .ThenByDescending(i => i.vote_count); } - public int Order - { - get { return 0; } - } + public int Order => 0; public Task GetImageResponse(string url, CancellationToken cancellationToken) { diff --git a/MediaBrowser.Providers/BoxSets/MovieDbBoxSetProvider.cs b/MediaBrowser.Providers/BoxSets/MovieDbBoxSetProvider.cs index a832606a9a..e06d93520a 100644 --- a/MediaBrowser.Providers/BoxSets/MovieDbBoxSetProvider.cs +++ b/MediaBrowser.Providers/BoxSets/MovieDbBoxSetProvider.cs @@ -241,10 +241,7 @@ namespace MediaBrowser.Providers.BoxSets return DownloadInfo(tmdbId, preferredMetadataLanguage, cancellationToken); } - public string Name - { - get { return "TheMovieDb"; } - } + public string Name => "TheMovieDb"; private static string GetDataFilePath(IApplicationPaths appPaths, string tmdbId, string preferredLanguage) { diff --git a/MediaBrowser.Providers/Folders/FolderMetadataService.cs b/MediaBrowser.Providers/Folders/FolderMetadataService.cs index 39f6e04a50..c839befff8 100644 --- a/MediaBrowser.Providers/Folders/FolderMetadataService.cs +++ b/MediaBrowser.Providers/Folders/FolderMetadataService.cs @@ -11,14 +11,7 @@ namespace MediaBrowser.Providers.Folders { public class FolderMetadataService : MetadataService { - public override int Order - { - get - { - // Make sure the type-specific services get picked first - return 10; - } - } + public override int Order => 10; protected override void MergeData(MetadataResult source, MetadataResult target, MetadataFields[] lockedFields, bool replaceData, bool mergeMetadataSettings) { diff --git a/MediaBrowser.Providers/Manager/GenericPriorityQueue.cs b/MediaBrowser.Providers/Manager/GenericPriorityQueue.cs index 7d921d8641..2b73fdcd37 100644 --- a/MediaBrowser.Providers/Manager/GenericPriorityQueue.cs +++ b/MediaBrowser.Providers/Manager/GenericPriorityQueue.cs @@ -41,25 +41,13 @@ namespace Priority_Queue /// Returns the number of nodes in the queue. /// O(1) /// - public int Count - { - get - { - return _numNodes; - } - } + public int Count => _numNodes; /// /// Returns the maximum number of items that can be enqueued at once in this queue. Once you hit this number (ie. once Count == MaxSize), /// attempting to enqueue another item will cause undefined behavior. O(1) /// - public int MaxSize - { - get - { - return _nodes.Length - 1; - } - } + public int MaxSize => _nodes.Length - 1; /// /// Removes every node from the queue. diff --git a/MediaBrowser.Providers/Manager/MetadataService.cs b/MediaBrowser.Providers/Manager/MetadataService.cs index 7a713b4e5c..3322582cc8 100644 --- a/MediaBrowser.Providers/Manager/MetadataService.cs +++ b/MediaBrowser.Providers/Manager/MetadataService.cs @@ -441,34 +441,13 @@ namespace MediaBrowser.Providers.Manager return updateType; } - protected virtual bool EnableUpdatingPremiereDateFromChildren - { - get - { - return false; - } - } - protected virtual bool EnableUpdatingGenresFromChildren - { - get - { - return false; - } - } - protected virtual bool EnableUpdatingStudiosFromChildren - { - get - { - return false; - } - } - protected virtual bool EnableUpdatingOfficialRatingFromChildren - { - get - { - return false; - } - } + protected virtual bool EnableUpdatingPremiereDateFromChildren => false; + + protected virtual bool EnableUpdatingGenresFromChildren => false; + + protected virtual bool EnableUpdatingStudiosFromChildren => false; + + protected virtual bool EnableUpdatingOfficialRatingFromChildren => false; private ItemUpdateType UpdatePremiereDate(TItemType item, IList children) { @@ -926,13 +905,7 @@ namespace MediaBrowser.Providers.Manager bool replaceData, bool mergeMetadataSettings); - public virtual int Order - { - get - { - return 0; - } - } + public virtual int Order => 0; private bool HasChanged(BaseItem item, IHasItemChangeMonitor changeMonitor, IDirectoryService directoryService) { diff --git a/MediaBrowser.Providers/MediaInfo/AudioImageProvider.cs b/MediaBrowser.Providers/MediaInfo/AudioImageProvider.cs index ffbb2d7c16..0b902ccecb 100644 --- a/MediaBrowser.Providers/MediaInfo/AudioImageProvider.cs +++ b/MediaBrowser.Providers/MediaInfo/AudioImageProvider.cs @@ -119,18 +119,9 @@ namespace MediaBrowser.Providers.MediaInfo return Path.Combine(AudioImagesPath, prefix, filename); } - public string AudioImagesPath - { - get - { - return Path.Combine(_config.ApplicationPaths.CachePath, "extracted-audio-images"); - } - } + public string AudioImagesPath => Path.Combine(_config.ApplicationPaths.CachePath, "extracted-audio-images"); - public string Name - { - get { return "Image Extractor"; } - } + public string Name => "Image Extractor"; public bool Supports(BaseItem item) { diff --git a/MediaBrowser.Providers/MediaInfo/FFProbeProvider.cs b/MediaBrowser.Providers/MediaInfo/FFProbeProvider.cs index 31be4d6d3e..70bf862fb7 100644 --- a/MediaBrowser.Providers/MediaInfo/FFProbeProvider.cs +++ b/MediaBrowser.Providers/MediaInfo/FFProbeProvider.cs @@ -53,10 +53,7 @@ namespace MediaBrowser.Providers.MediaInfo private readonly IChannelManager _channelManager; private readonly IMediaSourceManager _mediaSourceManager; - public string Name - { - get { return "ffprobe"; } - } + public string Name => "ffprobe"; public bool HasChanged(BaseItem item, IDirectoryService directoryService) { @@ -227,13 +224,6 @@ namespace MediaBrowser.Providers.MediaInfo return prober.Probe(item, options, cancellationToken); } - public int Order - { - get - { - // Run last - return 100; - } - } + public int Order => 100; } } diff --git a/MediaBrowser.Providers/MediaInfo/SubtitleScheduledTask.cs b/MediaBrowser.Providers/MediaInfo/SubtitleScheduledTask.cs index c5a47836fd..b7598ef22f 100644 --- a/MediaBrowser.Providers/MediaInfo/SubtitleScheduledTask.cs +++ b/MediaBrowser.Providers/MediaInfo/SubtitleScheduledTask.cs @@ -36,20 +36,11 @@ namespace MediaBrowser.Providers.MediaInfo _json = json; } - public string Name - { - get { return "Download missing subtitles"; } - } + public string Name => "Download missing subtitles"; - public string Description - { - get { return "Searches the internet for missing subtitles based on metadata configuration."; } - } + public string Description => "Searches the internet for missing subtitles based on metadata configuration."; - public string Category - { - get { return "Library"; } - } + public string Category => "Library"; private SubtitleOptions GetOptions() { @@ -213,9 +204,6 @@ namespace MediaBrowser.Providers.MediaInfo }; } - public string Key - { - get { return "DownloadSubtitles"; } - } + public string Key => "DownloadSubtitles"; } } diff --git a/MediaBrowser.Providers/MediaInfo/VideoImageProvider.cs b/MediaBrowser.Providers/MediaInfo/VideoImageProvider.cs index e0b6d97ce7..6aaad41f75 100644 --- a/MediaBrowser.Providers/MediaInfo/VideoImageProvider.cs +++ b/MediaBrowser.Providers/MediaInfo/VideoImageProvider.cs @@ -120,10 +120,7 @@ namespace MediaBrowser.Providers.MediaInfo }; } - public string Name - { - get { return "Screen Grabber"; } - } + public string Name => "Screen Grabber"; public bool Supports(BaseItem item) { @@ -146,13 +143,6 @@ namespace MediaBrowser.Providers.MediaInfo return false; } - public int Order - { - get - { - // Make sure this comes after internet image providers - return 100; - } - } + public int Order => 100; } } diff --git a/MediaBrowser.Providers/Movies/FanartMovieImageProvider.cs b/MediaBrowser.Providers/Movies/FanartMovieImageProvider.cs index d495ffed10..79e61f6a71 100644 --- a/MediaBrowser.Providers/Movies/FanartMovieImageProvider.cs +++ b/MediaBrowser.Providers/Movies/FanartMovieImageProvider.cs @@ -45,15 +45,9 @@ namespace MediaBrowser.Providers.Movies Current = this; } - public string Name - { - get { return ProviderName; } - } + public string Name => ProviderName; - public static string ProviderName - { - get { return "FanArt"; } - } + public static string ProviderName => "FanArt"; public bool Supports(BaseItem item) { @@ -199,10 +193,7 @@ namespace MediaBrowser.Providers.Movies }).Where(i => i != null)); } - public int Order - { - get { return 1; } - } + public int Order => 1; public Task GetImageResponse(string url, CancellationToken cancellationToken) { diff --git a/MediaBrowser.Providers/Movies/MovieDbImageProvider.cs b/MediaBrowser.Providers/Movies/MovieDbImageProvider.cs index 0c7c5cecf7..b9c5d7ce59 100644 --- a/MediaBrowser.Providers/Movies/MovieDbImageProvider.cs +++ b/MediaBrowser.Providers/Movies/MovieDbImageProvider.cs @@ -29,15 +29,9 @@ namespace MediaBrowser.Providers.Movies _fileSystem = fileSystem; } - public string Name - { - get { return ProviderName; } - } + public string Name => ProviderName; - public static string ProviderName - { - get { return "TheMovieDb"; } - } + public static string ProviderName => "TheMovieDb"; public bool Supports(BaseItem item) { @@ -199,10 +193,7 @@ namespace MediaBrowser.Providers.Movies return null; } - public int Order - { - get { return 0; } - } + public int Order => 0; public Task GetImageResponse(string url, CancellationToken cancellationToken) { diff --git a/MediaBrowser.Providers/Movies/MovieDbProvider.cs b/MediaBrowser.Providers/Movies/MovieDbProvider.cs index d85d777019..ef5c781dc0 100644 --- a/MediaBrowser.Providers/Movies/MovieDbProvider.cs +++ b/MediaBrowser.Providers/Movies/MovieDbProvider.cs @@ -122,10 +122,7 @@ namespace MediaBrowser.Providers.Movies return movieDb.GetMetadata(id, cancellationToken); } - public string Name - { - get { return "TheMovieDb"; } - } + public string Name => "TheMovieDb"; /// /// The _TMDB settings task @@ -633,13 +630,7 @@ namespace MediaBrowser.Providers.Movies } } - public int Order - { - get - { - return 1; - } - } + public int Order => 1; public Task GetImageResponse(string url, CancellationToken cancellationToken) { diff --git a/MediaBrowser.Providers/Movies/MovieDbTrailerProvider.cs b/MediaBrowser.Providers/Movies/MovieDbTrailerProvider.cs index 485e6a2f95..2a3cdf097e 100644 --- a/MediaBrowser.Providers/Movies/MovieDbTrailerProvider.cs +++ b/MediaBrowser.Providers/Movies/MovieDbTrailerProvider.cs @@ -27,18 +27,9 @@ namespace MediaBrowser.Providers.Movies return MovieDbProvider.Current.GetItemMetadata(info, cancellationToken); } - public string Name - { - get { return MovieDbProvider.Current.Name; } - } + public string Name => MovieDbProvider.Current.Name; - public int Order - { - get - { - return 0; - } - } + public int Order => 0; public Task GetImageResponse(string url, CancellationToken cancellationToken) { diff --git a/MediaBrowser.Providers/Movies/MovieExternalIds.cs b/MediaBrowser.Providers/Movies/MovieExternalIds.cs index 63bcd9e2df..3783c50324 100644 --- a/MediaBrowser.Providers/Movies/MovieExternalIds.cs +++ b/MediaBrowser.Providers/Movies/MovieExternalIds.cs @@ -11,20 +11,11 @@ namespace MediaBrowser.Providers.Movies { public const string BaseMovieDbUrl = "https://www.themoviedb.org/"; - public string Name - { - get { return "TheMovieDb"; } - } + public string Name => "TheMovieDb"; - public string Key - { - get { return MetadataProviders.Tmdb.ToString(); } - } + public string Key => MetadataProviders.Tmdb.ToString(); - public string UrlFormatString - { - get { return BaseMovieDbUrl + "movie/{0}"; } - } + public string UrlFormatString => BaseMovieDbUrl + "movie/{0}"; public bool Supports(IHasProviderIds item) { @@ -41,20 +32,11 @@ namespace MediaBrowser.Providers.Movies public class MovieDbSeriesExternalId : IExternalId { - public string Name - { - get { return "TheMovieDb"; } - } + public string Name => "TheMovieDb"; - public string Key - { - get { return MetadataProviders.Tmdb.ToString(); } - } + public string Key => MetadataProviders.Tmdb.ToString(); - public string UrlFormatString - { - get { return MovieDbMovieExternalId.BaseMovieDbUrl + "tv/{0}"; } - } + public string UrlFormatString => MovieDbMovieExternalId.BaseMovieDbUrl + "tv/{0}"; public bool Supports(IHasProviderIds item) { @@ -64,20 +46,11 @@ namespace MediaBrowser.Providers.Movies public class MovieDbMovieCollectionExternalId : IExternalId { - public string Name - { - get { return "TheMovieDb Collection"; } - } + public string Name => "TheMovieDb Collection"; - public string Key - { - get { return MetadataProviders.TmdbCollection.ToString(); } - } + public string Key => MetadataProviders.TmdbCollection.ToString(); - public string UrlFormatString - { - get { return MovieDbMovieExternalId.BaseMovieDbUrl + "collection/{0}"; } - } + public string UrlFormatString => MovieDbMovieExternalId.BaseMovieDbUrl + "collection/{0}"; public bool Supports(IHasProviderIds item) { @@ -87,20 +60,11 @@ namespace MediaBrowser.Providers.Movies public class MovieDbPersonExternalId : IExternalId { - public string Name - { - get { return "TheMovieDb"; } - } + public string Name => "TheMovieDb"; - public string Key - { - get { return MetadataProviders.Tmdb.ToString(); } - } + public string Key => MetadataProviders.Tmdb.ToString(); - public string UrlFormatString - { - get { return MovieDbMovieExternalId.BaseMovieDbUrl + "person/{0}"; } - } + public string UrlFormatString => MovieDbMovieExternalId.BaseMovieDbUrl + "person/{0}"; public bool Supports(IHasProviderIds item) { @@ -110,20 +74,11 @@ namespace MediaBrowser.Providers.Movies public class MovieDbCollectionExternalId : IExternalId { - public string Name - { - get { return "TheMovieDb"; } - } + public string Name => "TheMovieDb"; - public string Key - { - get { return MetadataProviders.Tmdb.ToString(); } - } + public string Key => MetadataProviders.Tmdb.ToString(); - public string UrlFormatString - { - get { return MovieDbMovieExternalId.BaseMovieDbUrl + "collection/{0}"; } - } + public string UrlFormatString => MovieDbMovieExternalId.BaseMovieDbUrl + "collection/{0}"; public bool Supports(IHasProviderIds item) { @@ -133,20 +88,11 @@ namespace MediaBrowser.Providers.Movies public class ImdbExternalId : IExternalId { - public string Name - { - get { return "IMDb"; } - } + public string Name => "IMDb"; - public string Key - { - get { return MetadataProviders.Imdb.ToString(); } - } + public string Key => MetadataProviders.Imdb.ToString(); - public string UrlFormatString - { - get { return "https://www.imdb.com/title/{0}"; } - } + public string UrlFormatString => "https://www.imdb.com/title/{0}"; public bool Supports(IHasProviderIds item) { @@ -164,20 +110,11 @@ namespace MediaBrowser.Providers.Movies public class ImdbPersonExternalId : IExternalId { - public string Name - { - get { return "IMDb"; } - } + public string Name => "IMDb"; - public string Key - { - get { return MetadataProviders.Imdb.ToString(); } - } + public string Key => MetadataProviders.Imdb.ToString(); - public string UrlFormatString - { - get { return "https://www.imdb.com/name/{0}"; } - } + public string UrlFormatString => "https://www.imdb.com/name/{0}"; public bool Supports(IHasProviderIds item) { diff --git a/MediaBrowser.Providers/Music/AlbumMetadataService.cs b/MediaBrowser.Providers/Music/AlbumMetadataService.cs index d4ade56869..33a6c2fa36 100644 --- a/MediaBrowser.Providers/Music/AlbumMetadataService.cs +++ b/MediaBrowser.Providers/Music/AlbumMetadataService.cs @@ -50,29 +50,11 @@ namespace MediaBrowser.Providers.Music return updateType; } - protected override bool EnableUpdatingPremiereDateFromChildren - { - get - { - return true; - } - } + protected override bool EnableUpdatingPremiereDateFromChildren => true; - protected override bool EnableUpdatingGenresFromChildren - { - get - { - return true; - } - } + protected override bool EnableUpdatingGenresFromChildren => true; - protected override bool EnableUpdatingStudiosFromChildren - { - get - { - return true; - } - } + protected override bool EnableUpdatingStudiosFromChildren => true; private ItemUpdateType SetAlbumArtistFromSongs(MusicAlbum item, IEnumerable