From ec1f5dc317182582ebff843c9e8a4d5277405469 Mon Sep 17 00:00:00 2001 From: Erwin de Haan Date: Sun, 6 Jan 2019 21:50:43 +0100 Subject: Mayor code cleanup Add Argument*Exceptions now use proper nameof operators. Added exception messages to quite a few Argument*Exceptions. Fixed rethorwing to be proper syntax. Added a ton of null checkes. (This is only a start, there are about 500 places that need proper null handling) Added some TODOs to log certain exceptions. Fix sln again. Fixed all AssemblyInfo's and added proper copyright (where I could find them) We live in *current year*. Fixed the use of braces. Fixed a ton of properties, and made a fair amount of functions static that should be and can be static. Made more Methods that should be static static. You can now use static to find bad functions! Removed unused variable. And added one more proper XML comment. --- MediaBrowser.Controller/Entities/UserRootFolder.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'MediaBrowser.Controller/Entities/UserRootFolder.cs') diff --git a/MediaBrowser.Controller/Entities/UserRootFolder.cs b/MediaBrowser.Controller/Entities/UserRootFolder.cs index f8e843d92..abfcd7984 100644 --- a/MediaBrowser.Controller/Entities/UserRootFolder.cs +++ b/MediaBrowser.Controller/Entities/UserRootFolder.cs @@ -1,4 +1,4 @@ -using MediaBrowser.Model.Serialization; +using MediaBrowser.Model.Serialization; using MediaBrowser.Controller.Providers; using MediaBrowser.Model.Library; using MediaBrowser.Model.Querying; @@ -78,7 +78,7 @@ namespace MediaBrowser.Controller.Entities return new QueryResult { TotalRecordCount = totalCount, - Items = itemsArray + Items = itemsArray //TODO Fix The co-variant conversion between Folder[] and BaseItem[], this can generate runtime issues. }; } -- cgit v1.2.3 From 26ca4b607b98b78b44a7300bcf9890360e598393 Mon Sep 17 00:00:00 2001 From: Erwin de Haan Date: Sun, 13 Jan 2019 20:25:32 +0100 Subject: Visual Studio Reformat: MediaBrowser.Controller --- MediaBrowser.Controller/Channels/Channel.cs | 10 ++--- .../Channels/ChannelItemInfo.cs | 8 ++-- MediaBrowser.Controller/Channels/IChannel.cs | 6 +-- .../Channels/IChannelManager.cs | 6 +-- .../Channels/InternalChannelFeatures.cs | 3 +- .../Channels/InternalChannelItemQuery.cs | 4 +- .../Collections/CollectionCreationOptions.cs | 4 +- .../Collections/CollectionEvents.cs | 6 +-- .../Collections/ICollectionManager.cs | 7 ++-- MediaBrowser.Controller/Devices/IDeviceManager.cs | 10 ++--- MediaBrowser.Controller/Dlna/IDlnaManager.cs | 6 +-- MediaBrowser.Controller/Drawing/IImageProcessor.cs | 6 +-- MediaBrowser.Controller/Drawing/ImageHelper.cs | 3 +- .../Drawing/ImageProcessingOptions.cs | 9 ++--- MediaBrowser.Controller/Drawing/ImageStream.cs | 4 +- MediaBrowser.Controller/Dto/DtoOptions.cs | 8 ++-- MediaBrowser.Controller/Dto/IDtoService.cs | 4 +- .../Entities/AggregateFolder.cs | 6 +-- MediaBrowser.Controller/Entities/Audio/Audio.cs | 8 ++-- .../Entities/Audio/IHasMusicGenres.cs | 4 +- .../Entities/Audio/MusicAlbum.cs | 10 ++--- .../Entities/Audio/MusicArtist.cs | 12 +++--- .../Entities/Audio/MusicGenre.cs | 2 +- MediaBrowser.Controller/Entities/AudioBook.cs | 1 - MediaBrowser.Controller/Entities/BaseItem.cs | 44 +++++++++++----------- .../Entities/BaseItemExtensions.cs | 12 +----- MediaBrowser.Controller/Entities/Book.cs | 1 - .../Entities/CollectionFolder.cs | 2 - .../Entities/DayOfWeekHelper.cs | 4 +- MediaBrowser.Controller/Entities/Extensions.cs | 7 ++-- MediaBrowser.Controller/Entities/Folder.cs | 20 ++++------ MediaBrowser.Controller/Entities/GameGenre.cs | 2 +- MediaBrowser.Controller/Entities/GameSystem.cs | 6 +-- MediaBrowser.Controller/Entities/Genre.cs | 6 +-- .../Entities/ICollectionFolder.cs | 2 - .../Entities/IHasMediaSources.cs | 4 +- MediaBrowser.Controller/Entities/IHasTrailers.cs | 4 +- .../Entities/IMetadataContainer.cs | 4 +- .../Entities/InternalItemsQuery.cs | 6 +-- .../Entities/InternalPeopleQuery.cs | 1 - MediaBrowser.Controller/Entities/ItemImageInfo.cs | 4 +- MediaBrowser.Controller/Entities/Movies/BoxSet.cs | 11 +++--- MediaBrowser.Controller/Entities/Movies/Movie.cs | 14 +++---- MediaBrowser.Controller/Entities/MusicVideo.cs | 5 +-- MediaBrowser.Controller/Entities/PeopleHelper.cs | 2 +- MediaBrowser.Controller/Entities/Person.cs | 4 +- MediaBrowser.Controller/Entities/Share.cs | 4 +- MediaBrowser.Controller/Entities/Studio.cs | 2 +- MediaBrowser.Controller/Entities/TV/Episode.cs | 12 +++--- MediaBrowser.Controller/Entities/TV/Season.cs | 7 ++-- MediaBrowser.Controller/Entities/TV/Series.cs | 12 +++--- MediaBrowser.Controller/Entities/TagExtensions.cs | 2 +- MediaBrowser.Controller/Entities/Trailer.cs | 6 +-- MediaBrowser.Controller/Entities/User.cs | 10 ++--- MediaBrowser.Controller/Entities/UserRootFolder.cs | 8 ++-- MediaBrowser.Controller/Entities/UserView.cs | 10 ++--- .../Entities/UserViewBuilder.cs | 15 +++----- MediaBrowser.Controller/Entities/Video.cs | 19 +++++----- MediaBrowser.Controller/IO/FileData.cs | 8 ++-- MediaBrowser.Controller/IResourceFileManager.cs | 18 +-------- MediaBrowser.Controller/IServerApplicationHost.cs | 9 ++--- MediaBrowser.Controller/Library/IIntroProvider.cs | 4 +- MediaBrowser.Controller/Library/ILibraryManager.cs | 17 ++++----- MediaBrowser.Controller/Library/ILiveStream.cs | 5 +-- .../Library/IMediaSourceManager.cs | 12 +++--- .../Library/IMediaSourceProvider.cs | 7 ++-- MediaBrowser.Controller/Library/IMetadataSaver.cs | 4 +- MediaBrowser.Controller/Library/IMusicManager.cs | 6 +-- .../Library/IUserDataManager.cs | 6 +-- MediaBrowser.Controller/Library/IUserManager.cs | 12 +++--- .../Library/IUserViewManager.cs | 10 ++--- MediaBrowser.Controller/Library/ItemResolveArgs.cs | 4 +- .../Library/MetadataConfigurationStore.cs | 4 +- .../Library/PlaybackProgressEventArgs.cs | 6 +-- MediaBrowser.Controller/Library/Profiler.cs | 4 +- MediaBrowser.Controller/Library/TVUtils.cs | 3 +- .../Library/UserDataSaveEventArgs.cs | 6 +-- .../LiveTv/IListingsProvider.cs | 6 +-- MediaBrowser.Controller/LiveTv/ILiveTvManager.cs | 11 +++--- MediaBrowser.Controller/LiveTv/ILiveTvService.cs | 5 +-- MediaBrowser.Controller/LiveTv/ITunerHost.cs | 6 +-- MediaBrowser.Controller/LiveTv/LiveTvChannel.cs | 10 ++--- MediaBrowser.Controller/LiveTv/LiveTvProgram.cs | 12 +++--- .../LiveTv/LiveTvServiceStatusInfo.cs | 4 +- MediaBrowser.Controller/LiveTv/LiveTvTunerInfo.cs | 4 +- MediaBrowser.Controller/LiveTv/ProgramInfo.cs | 7 ++-- MediaBrowser.Controller/LiveTv/RecordingInfo.cs | 4 +- .../LiveTv/RecordingStatusChangedEventArgs.cs | 4 +- MediaBrowser.Controller/LiveTv/TimerInfo.cs | 4 +- .../MediaEncoding/EncodingHelper.cs | 2 +- .../MediaEncoding/EncodingJobInfo.cs | 8 ++-- .../MediaEncoding/IEncodingManager.cs | 2 +- .../MediaEncoding/IMediaEncoder.cs | 6 +-- .../MediaEncoding/ISubtitleEncoder.cs | 4 +- MediaBrowser.Controller/MediaEncoding/JobLogger.cs | 2 +- .../MediaEncoding/MediaEncoderHelpers.cs | 10 ++--- .../MediaEncoding/MediaInfoRequest.cs | 9 ++--- .../Net/AuthenticatedAttribute.cs | 2 +- MediaBrowser.Controller/Net/AuthorizationInfo.cs | 10 +++-- .../Net/BasePeriodicWebSocketListener.cs | 8 ++-- MediaBrowser.Controller/Net/IHttpServer.cs | 2 +- MediaBrowser.Controller/Net/ISessionContext.cs | 1 - .../Net/IWebSocketConnection.cs | 8 ++-- .../Notifications/INotificationManager.cs | 8 ++-- .../Notifications/INotificationService.cs | 4 +- .../Notifications/INotificationTypeFactory.cs | 4 +- .../Notifications/UserNotification.cs | 4 +- .../Persistence/IDisplayPreferencesRepository.cs | 6 +-- .../Persistence/IItemRepository.cs | 6 +-- .../Persistence/IUserDataRepository.cs | 3 +- .../Persistence/IUserRepository.cs | 3 +- .../Persistence/MediaStreamQuery.cs | 4 +- .../Playlists/IPlaylistManager.cs | 6 +-- MediaBrowser.Controller/Playlists/Playlist.cs | 14 +++---- .../Plugins/IPluginConfigurationPage.cs | 4 +- .../Providers/DirectoryService.cs | 4 +- .../Providers/ICustomMetadataProvider.cs | 6 +-- .../Providers/IImageEnhancer.cs | 4 +- .../Providers/ILocalMetadataProvider.cs | 4 +- .../Providers/IMetadataService.cs | 4 +- .../Providers/IProviderManager.cs | 14 +++---- .../Providers/IRemoteImageProvider.cs | 8 ++-- .../Providers/IRemoteMetadataProvider.cs | 6 +-- .../Providers/ImageRefreshOptions.cs | 3 +- .../Providers/ItemLookupInfo.cs | 4 +- .../Providers/LocalImageInfo.cs | 2 - .../Providers/MetadataRefreshOptions.cs | 2 - .../Providers/MetadataResult.cs | 2 +- MediaBrowser.Controller/Resolvers/IItemResolver.cs | 6 +-- .../Resolvers/IResolverIgnoreRule.cs | 1 - .../Security/AuthenticationInfo.cs | 2 +- .../Security/IAuthenticationRepository.cs | 1 - MediaBrowser.Controller/Session/ISessionManager.cs | 10 ++--- MediaBrowser.Controller/Session/SessionInfo.cs | 8 ++-- .../Sorting/IBaseItemComparer.cs | 4 +- .../Subtitles/ISubtitleManager.cs | 6 +-- .../Subtitles/ISubtitleProvider.cs | 7 ++-- .../Subtitles/SubtitleSearchRequest.cs | 6 +-- MediaBrowser.Controller/Sync/IHasDynamicAccess.cs | 4 +- .../Sync/IServerSyncProvider.cs | 7 ++-- MediaBrowser.Controller/Sync/ISyncProvider.cs | 4 +- MediaBrowser.Controller/Sync/SyncedFileInfo.cs | 4 +- MediaBrowser.Controller/TV/ITVSeriesManager.cs | 5 +-- 143 files changed, 420 insertions(+), 499 deletions(-) (limited to 'MediaBrowser.Controller/Entities/UserRootFolder.cs') diff --git a/MediaBrowser.Controller/Channels/Channel.cs b/MediaBrowser.Controller/Channels/Channel.cs index 9cd50db17..540ac347a 100644 --- a/MediaBrowser.Controller/Channels/Channel.cs +++ b/MediaBrowser.Controller/Channels/Channel.cs @@ -1,12 +1,10 @@ -using MediaBrowser.Controller.Entities; -using MediaBrowser.Model.Channels; -using MediaBrowser.Model.Querying; -using System; +using System; using System.Linq; -using MediaBrowser.Model.Serialization; using System.Threading; -using System.Threading.Tasks; using MediaBrowser.Common.Progress; +using MediaBrowser.Controller.Entities; +using MediaBrowser.Model.Querying; +using MediaBrowser.Model.Serialization; namespace MediaBrowser.Controller.Channels { diff --git a/MediaBrowser.Controller/Channels/ChannelItemInfo.cs b/MediaBrowser.Controller/Channels/ChannelItemInfo.cs index 0de2b9a0c..968816bc5 100644 --- a/MediaBrowser.Controller/Channels/ChannelItemInfo.cs +++ b/MediaBrowser.Controller/Channels/ChannelItemInfo.cs @@ -1,9 +1,9 @@ -using MediaBrowser.Controller.Entities; -using MediaBrowser.Model.Channels; -using MediaBrowser.Model.Entities; -using System; +using System; using System.Collections.Generic; +using MediaBrowser.Controller.Entities; +using MediaBrowser.Model.Channels; using MediaBrowser.Model.Dto; +using MediaBrowser.Model.Entities; namespace MediaBrowser.Controller.Channels { diff --git a/MediaBrowser.Controller/Channels/IChannel.cs b/MediaBrowser.Controller/Channels/IChannel.cs index dc1d9b00a..ed9a217f9 100644 --- a/MediaBrowser.Controller/Channels/IChannel.cs +++ b/MediaBrowser.Controller/Channels/IChannel.cs @@ -1,8 +1,8 @@ -using MediaBrowser.Controller.Providers; -using MediaBrowser.Model.Entities; -using System.Collections.Generic; +using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; +using MediaBrowser.Controller.Providers; +using MediaBrowser.Model.Entities; namespace MediaBrowser.Controller.Channels { diff --git a/MediaBrowser.Controller/Channels/IChannelManager.cs b/MediaBrowser.Controller/Channels/IChannelManager.cs index b345001a6..df508fbe2 100644 --- a/MediaBrowser.Controller/Channels/IChannelManager.cs +++ b/MediaBrowser.Controller/Channels/IChannelManager.cs @@ -1,11 +1,11 @@ using System; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; using MediaBrowser.Controller.Entities; using MediaBrowser.Model.Channels; using MediaBrowser.Model.Dto; using MediaBrowser.Model.Querying; -using System.Collections.Generic; -using System.Threading; -using System.Threading.Tasks; namespace MediaBrowser.Controller.Channels { diff --git a/MediaBrowser.Controller/Channels/InternalChannelFeatures.cs b/MediaBrowser.Controller/Channels/InternalChannelFeatures.cs index 976808aad..fa7c658ab 100644 --- a/MediaBrowser.Controller/Channels/InternalChannelFeatures.cs +++ b/MediaBrowser.Controller/Channels/InternalChannelFeatures.cs @@ -1,6 +1,5 @@ -using System; +using System.Collections.Generic; using MediaBrowser.Model.Channels; -using System.Collections.Generic; namespace MediaBrowser.Controller.Channels { diff --git a/MediaBrowser.Controller/Channels/InternalChannelItemQuery.cs b/MediaBrowser.Controller/Channels/InternalChannelItemQuery.cs index c69a1f6c3..fe2f5a221 100644 --- a/MediaBrowser.Controller/Channels/InternalChannelItemQuery.cs +++ b/MediaBrowser.Controller/Channels/InternalChannelItemQuery.cs @@ -1,5 +1,5 @@ -using MediaBrowser.Model.Channels; -using System; +using System; +using MediaBrowser.Model.Channels; namespace MediaBrowser.Controller.Channels diff --git a/MediaBrowser.Controller/Collections/CollectionCreationOptions.cs b/MediaBrowser.Controller/Collections/CollectionCreationOptions.cs index 5363e035c..bc758a503 100644 --- a/MediaBrowser.Controller/Collections/CollectionCreationOptions.cs +++ b/MediaBrowser.Controller/Collections/CollectionCreationOptions.cs @@ -1,6 +1,6 @@ -using MediaBrowser.Model.Entities; -using System; +using System; using System.Collections.Generic; +using MediaBrowser.Model.Entities; namespace MediaBrowser.Controller.Collections { diff --git a/MediaBrowser.Controller/Collections/CollectionEvents.cs b/MediaBrowser.Controller/Collections/CollectionEvents.cs index 80f66a444..c3f0c11da 100644 --- a/MediaBrowser.Controller/Collections/CollectionEvents.cs +++ b/MediaBrowser.Controller/Collections/CollectionEvents.cs @@ -1,7 +1,7 @@ -using MediaBrowser.Controller.Entities; -using MediaBrowser.Controller.Entities.Movies; -using System; +using System; using System.Collections.Generic; +using MediaBrowser.Controller.Entities; +using MediaBrowser.Controller.Entities.Movies; namespace MediaBrowser.Controller.Collections { diff --git a/MediaBrowser.Controller/Collections/ICollectionManager.cs b/MediaBrowser.Controller/Collections/ICollectionManager.cs index 05bc927ba..10abede68 100644 --- a/MediaBrowser.Controller/Collections/ICollectionManager.cs +++ b/MediaBrowser.Controller/Collections/ICollectionManager.cs @@ -1,8 +1,7 @@ -using MediaBrowser.Controller.Entities; -using MediaBrowser.Controller.Entities.Movies; -using System; +using System; using System.Collections.Generic; -using System.Threading.Tasks; +using MediaBrowser.Controller.Entities; +using MediaBrowser.Controller.Entities.Movies; namespace MediaBrowser.Controller.Collections { diff --git a/MediaBrowser.Controller/Devices/IDeviceManager.cs b/MediaBrowser.Controller/Devices/IDeviceManager.cs index d29fb8ded..4f40a42c6 100644 --- a/MediaBrowser.Controller/Devices/IDeviceManager.cs +++ b/MediaBrowser.Controller/Devices/IDeviceManager.cs @@ -1,11 +1,11 @@ -using MediaBrowser.Model.Devices; -using MediaBrowser.Model.Events; -using MediaBrowser.Model.Querying; -using MediaBrowser.Model.Session; -using System; +using System; using System.IO; using System.Threading.Tasks; using MediaBrowser.Controller.Entities; +using MediaBrowser.Model.Devices; +using MediaBrowser.Model.Events; +using MediaBrowser.Model.Querying; +using MediaBrowser.Model.Session; namespace MediaBrowser.Controller.Devices { diff --git a/MediaBrowser.Controller/Dlna/IDlnaManager.cs b/MediaBrowser.Controller/Dlna/IDlnaManager.cs index 70529d062..04ddd7212 100644 --- a/MediaBrowser.Controller/Dlna/IDlnaManager.cs +++ b/MediaBrowser.Controller/Dlna/IDlnaManager.cs @@ -1,6 +1,6 @@ -using MediaBrowser.Controller.Drawing; +using System.Collections.Generic; +using MediaBrowser.Controller.Drawing; using MediaBrowser.Model.Dlna; -using System.Collections.Generic; namespace MediaBrowser.Controller.Dlna { @@ -17,7 +17,7 @@ namespace MediaBrowser.Controller.Dlna /// /// The headers. /// DeviceProfile. - DeviceProfile GetProfile(IDictionary headers); + DeviceProfile GetProfile(IDictionary headers); /// /// Gets the default profile. diff --git a/MediaBrowser.Controller/Drawing/IImageProcessor.cs b/MediaBrowser.Controller/Drawing/IImageProcessor.cs index fdf10e223..7297b9109 100644 --- a/MediaBrowser.Controller/Drawing/IImageProcessor.cs +++ b/MediaBrowser.Controller/Drawing/IImageProcessor.cs @@ -1,11 +1,11 @@ using System; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Providers; using MediaBrowser.Model.Drawing; using MediaBrowser.Model.Entities; -using System.Collections.Generic; -using System.IO; -using System.Threading.Tasks; namespace MediaBrowser.Controller.Drawing { diff --git a/MediaBrowser.Controller/Drawing/ImageHelper.cs b/MediaBrowser.Controller/Drawing/ImageHelper.cs index 6fb9f256e..08fcf556b 100644 --- a/MediaBrowser.Controller/Drawing/ImageHelper.cs +++ b/MediaBrowser.Controller/Drawing/ImageHelper.cs @@ -1,5 +1,4 @@ -using System; -using MediaBrowser.Controller.Entities; +using MediaBrowser.Controller.Entities; using MediaBrowser.Model.Drawing; using MediaBrowser.Model.Entities; diff --git a/MediaBrowser.Controller/Drawing/ImageProcessingOptions.cs b/MediaBrowser.Controller/Drawing/ImageProcessingOptions.cs index ffc3e6cc0..bf31a192c 100644 --- a/MediaBrowser.Controller/Drawing/ImageProcessingOptions.cs +++ b/MediaBrowser.Controller/Drawing/ImageProcessingOptions.cs @@ -1,10 +1,9 @@ -using MediaBrowser.Controller.Entities; -using MediaBrowser.Controller.Providers; -using MediaBrowser.Model.Drawing; -using System; -using System.Collections.Generic; +using System; using System.IO; using System.Linq; +using MediaBrowser.Controller.Entities; +using MediaBrowser.Controller.Providers; +using MediaBrowser.Model.Drawing; namespace MediaBrowser.Controller.Drawing { diff --git a/MediaBrowser.Controller/Drawing/ImageStream.cs b/MediaBrowser.Controller/Drawing/ImageStream.cs index 353abaca3..dbc62fce1 100644 --- a/MediaBrowser.Controller/Drawing/ImageStream.cs +++ b/MediaBrowser.Controller/Drawing/ImageStream.cs @@ -1,6 +1,6 @@ -using MediaBrowser.Model.Drawing; -using System; +using System; using System.IO; +using MediaBrowser.Model.Drawing; namespace MediaBrowser.Controller.Drawing { diff --git a/MediaBrowser.Controller/Dto/DtoOptions.cs b/MediaBrowser.Controller/Dto/DtoOptions.cs index b5ce09028..1c5948369 100644 --- a/MediaBrowser.Controller/Dto/DtoOptions.cs +++ b/MediaBrowser.Controller/Dto/DtoOptions.cs @@ -1,13 +1,13 @@ -using MediaBrowser.Model.Entities; -using MediaBrowser.Model.Querying; -using System; +using System; using System.Linq; +using MediaBrowser.Model.Entities; +using MediaBrowser.Model.Querying; namespace MediaBrowser.Controller.Dto { public class DtoOptions { - private static readonly ItemFields[] DefaultExcludedFields = new [] + private static readonly ItemFields[] DefaultExcludedFields = new[] { ItemFields.SeasonUserData, ItemFields.RefreshState diff --git a/MediaBrowser.Controller/Dto/IDtoService.cs b/MediaBrowser.Controller/Dto/IDtoService.cs index 37e83e45a..0f2b7cfa8 100644 --- a/MediaBrowser.Controller/Dto/IDtoService.cs +++ b/MediaBrowser.Controller/Dto/IDtoService.cs @@ -1,7 +1,7 @@ -using MediaBrowser.Controller.Entities; +using System.Collections.Generic; +using MediaBrowser.Controller.Entities; using MediaBrowser.Model.Dto; using MediaBrowser.Model.Querying; -using System.Collections.Generic; namespace MediaBrowser.Controller.Dto { diff --git a/MediaBrowser.Controller/Entities/AggregateFolder.cs b/MediaBrowser.Controller/Entities/AggregateFolder.cs index 6425fa41b..9c2194fdc 100644 --- a/MediaBrowser.Controller/Entities/AggregateFolder.cs +++ b/MediaBrowser.Controller/Entities/AggregateFolder.cs @@ -1,11 +1,11 @@ -using MediaBrowser.Controller.IO; -using MediaBrowser.Controller.Library; -using System; +using System; using System.Collections.Concurrent; using System.Collections.Generic; using System.Linq; using System.Threading; using System.Threading.Tasks; +using MediaBrowser.Controller.IO; +using MediaBrowser.Controller.Library; using MediaBrowser.Controller.Providers; using MediaBrowser.Model.IO; using MediaBrowser.Model.Serialization; diff --git a/MediaBrowser.Controller/Entities/Audio/Audio.cs b/MediaBrowser.Controller/Entities/Audio/Audio.cs index 1aeae6052..be399da56 100644 --- a/MediaBrowser.Controller/Entities/Audio/Audio.cs +++ b/MediaBrowser.Controller/Entities/Audio/Audio.cs @@ -1,10 +1,10 @@ -using MediaBrowser.Controller.Providers; +using System; +using System.Collections.Generic; +using MediaBrowser.Controller.Persistence; +using MediaBrowser.Controller.Providers; using MediaBrowser.Model.Configuration; using MediaBrowser.Model.Dto; using MediaBrowser.Model.Entities; -using System; -using System.Collections.Generic; -using MediaBrowser.Controller.Persistence; using MediaBrowser.Model.Serialization; namespace MediaBrowser.Controller.Entities.Audio diff --git a/MediaBrowser.Controller/Entities/Audio/IHasMusicGenres.cs b/MediaBrowser.Controller/Entities/Audio/IHasMusicGenres.cs index 2200d4b75..a6cb7e59c 100644 --- a/MediaBrowser.Controller/Entities/Audio/IHasMusicGenres.cs +++ b/MediaBrowser.Controller/Entities/Audio/IHasMusicGenres.cs @@ -1,6 +1,4 @@ -using System.Collections.Generic; - -namespace MediaBrowser.Controller.Entities.Audio +namespace MediaBrowser.Controller.Entities.Audio { public interface IHasMusicGenres { diff --git a/MediaBrowser.Controller/Entities/Audio/MusicAlbum.cs b/MediaBrowser.Controller/Entities/Audio/MusicAlbum.cs index 870e6e07e..5d4dc565d 100644 --- a/MediaBrowser.Controller/Entities/Audio/MusicAlbum.cs +++ b/MediaBrowser.Controller/Entities/Audio/MusicAlbum.cs @@ -1,15 +1,15 @@ using System; -using MediaBrowser.Controller.Providers; -using MediaBrowser.Model.Configuration; -using MediaBrowser.Model.Entities; -using MediaBrowser.Model.Users; using System.Collections.Generic; using System.Linq; -using MediaBrowser.Model.Serialization; using System.Threading; using System.Threading.Tasks; using MediaBrowser.Controller.Dto; using MediaBrowser.Controller.Library; +using MediaBrowser.Controller.Providers; +using MediaBrowser.Model.Configuration; +using MediaBrowser.Model.Entities; +using MediaBrowser.Model.Serialization; +using MediaBrowser.Model.Users; namespace MediaBrowser.Controller.Entities.Audio { diff --git a/MediaBrowser.Controller/Entities/Audio/MusicArtist.cs b/MediaBrowser.Controller/Entities/Audio/MusicArtist.cs index 56ed10ced..8dc91c2be 100644 --- a/MediaBrowser.Controller/Entities/Audio/MusicArtist.cs +++ b/MediaBrowser.Controller/Entities/Audio/MusicArtist.cs @@ -1,14 +1,14 @@ -using MediaBrowser.Controller.Providers; -using MediaBrowser.Model.Configuration; -using MediaBrowser.Model.Entities; -using MediaBrowser.Model.Users; -using System; +using System; using System.Collections.Generic; using System.Linq; -using MediaBrowser.Model.Serialization; using System.Threading; using System.Threading.Tasks; using MediaBrowser.Controller.Extensions; +using MediaBrowser.Controller.Providers; +using MediaBrowser.Model.Configuration; +using MediaBrowser.Model.Entities; +using MediaBrowser.Model.Serialization; +using MediaBrowser.Model.Users; using Microsoft.Extensions.Logging; namespace MediaBrowser.Controller.Entities.Audio diff --git a/MediaBrowser.Controller/Entities/Audio/MusicGenre.cs b/MediaBrowser.Controller/Entities/Audio/MusicGenre.cs index ec68eaf8b..5777463e2 100644 --- a/MediaBrowser.Controller/Entities/Audio/MusicGenre.cs +++ b/MediaBrowser.Controller/Entities/Audio/MusicGenre.cs @@ -1,7 +1,7 @@ using System; using System.Collections.Generic; -using MediaBrowser.Model.Serialization; using MediaBrowser.Controller.Extensions; +using MediaBrowser.Model.Serialization; using Microsoft.Extensions.Logging; namespace MediaBrowser.Controller.Entities.Audio diff --git a/MediaBrowser.Controller/Entities/AudioBook.cs b/MediaBrowser.Controller/Entities/AudioBook.cs index 679facf64..653115bd1 100644 --- a/MediaBrowser.Controller/Entities/AudioBook.cs +++ b/MediaBrowser.Controller/Entities/AudioBook.cs @@ -2,7 +2,6 @@ using MediaBrowser.Controller.Providers; using MediaBrowser.Model.Configuration; using MediaBrowser.Model.Serialization; -using MediaBrowser.Model.Entities; namespace MediaBrowser.Controller.Entities { diff --git a/MediaBrowser.Controller/Entities/BaseItem.cs b/MediaBrowser.Controller/Entities/BaseItem.cs index 8298f4087..f8d45bf93 100644 --- a/MediaBrowser.Controller/Entities/BaseItem.cs +++ b/MediaBrowser.Controller/Entities/BaseItem.cs @@ -1,31 +1,31 @@ -using MediaBrowser.Common.Extensions; +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using MediaBrowser.Common.Extensions; using MediaBrowser.Controller.Channels; using MediaBrowser.Controller.Configuration; using MediaBrowser.Controller.Dto; +using MediaBrowser.Controller.Extensions; using MediaBrowser.Controller.Library; using MediaBrowser.Controller.Persistence; using MediaBrowser.Controller.Providers; +using MediaBrowser.Controller.Sorting; using MediaBrowser.Model.Configuration; using MediaBrowser.Model.Dto; using MediaBrowser.Model.Entities; -using MediaBrowser.Model.Library; -using MediaBrowser.Model.Users; -using System; -using System.Collections.Generic; -using System.Globalization; -using System.Linq; -using System.Text; -using System.Threading; -using System.Threading.Tasks; -using MediaBrowser.Controller.Extensions; -using MediaBrowser.Controller.Sorting; using MediaBrowser.Model.Extensions; using MediaBrowser.Model.Globalization; using MediaBrowser.Model.IO; +using MediaBrowser.Model.Library; using MediaBrowser.Model.LiveTv; +using MediaBrowser.Model.MediaInfo; using MediaBrowser.Model.Providers; using MediaBrowser.Model.Serialization; -using MediaBrowser.Model.MediaInfo; +using MediaBrowser.Model.Users; using Microsoft.Extensions.Logging; namespace MediaBrowser.Controller.Entities @@ -2101,7 +2101,7 @@ namespace MediaBrowser.Controller.Entities else { var list = - Studios = current.Concat(new [] { name }).ToArray(); + Studios = current.Concat(new[] { name }).ToArray(); } } } @@ -2241,7 +2241,7 @@ namespace MediaBrowser.Controller.Entities else { var currentCount = ImageInfos.Length; - ImageInfos = ImageInfos.Concat(new [] { image }) .ToArray(); + ImageInfos = ImageInfos.Concat(new[] { image }).ToArray(); } } @@ -2256,7 +2256,7 @@ namespace MediaBrowser.Controller.Entities if (image == null) { - ImageInfos = ImageInfos.Concat(new [] { GetImageInfo(file, type) }) .ToArray(); + ImageInfos = ImageInfos.Concat(new[] { GetImageInfo(file, type) }).ToArray(); } else { @@ -2915,14 +2915,15 @@ namespace MediaBrowser.Controller.Entities return GetExtras(); } - public virtual bool IsHD { + public virtual bool IsHD + { get { return Height >= 720; } } - public bool IsShortcut{ get; set;} - public string ShortcutPath{ get; set;} + public bool IsShortcut { get; set; } + public string ShortcutPath { get; set; } public int Width { get; set; } public int Height { get; set; } public Guid[] ExtraIds { get; set; } @@ -2931,10 +2932,11 @@ namespace MediaBrowser.Controller.Entities return RunTimeTicks ?? 0; } // what does this do? - public static ExtraType[] DisplayExtraTypes = new[] {Model.Entities.ExtraType.ThemeSong, Model.Entities.ExtraType.ThemeVideo }; + public static ExtraType[] DisplayExtraTypes = new[] { Model.Entities.ExtraType.ThemeSong, Model.Entities.ExtraType.ThemeVideo }; public virtual bool SupportsExternalTransfer { - get { + get + { return false; } } diff --git a/MediaBrowser.Controller/Entities/BaseItemExtensions.cs b/MediaBrowser.Controller/Entities/BaseItemExtensions.cs index bfd832d34..fbab18e92 100644 --- a/MediaBrowser.Controller/Entities/BaseItemExtensions.cs +++ b/MediaBrowser.Controller/Entities/BaseItemExtensions.cs @@ -1,14 +1,6 @@ -using System; -using System.Linq; -using System.Collections.Generic; -using System.Threading; -using System.Threading.Tasks; -using MediaBrowser.Controller.Library; -using MediaBrowser.Controller.Providers; +using System.Linq; using MediaBrowser.Model.Entities; using MediaBrowser.Model.IO; -using MediaBrowser.Model.Dto; -using MediaBrowser.Model.Querying; namespace MediaBrowser.Controller.Entities { @@ -72,7 +64,7 @@ namespace MediaBrowser.Controller.Entities where T : BaseItem where TU : BaseItem { - var sourceProps = typeof (T).GetProperties().Where(x => x.CanRead).ToList(); + var sourceProps = typeof(T).GetProperties().Where(x => x.CanRead).ToList(); var destProps = typeof(TU).GetProperties() .Where(x => x.CanWrite) .ToList(); diff --git a/MediaBrowser.Controller/Entities/Book.cs b/MediaBrowser.Controller/Entities/Book.cs index 6814570c3..b7e62f06c 100644 --- a/MediaBrowser.Controller/Entities/Book.cs +++ b/MediaBrowser.Controller/Entities/Book.cs @@ -3,7 +3,6 @@ using System.Linq; using MediaBrowser.Controller.Providers; using MediaBrowser.Model.Configuration; using MediaBrowser.Model.Serialization; -using MediaBrowser.Model.Entities; namespace MediaBrowser.Controller.Entities { diff --git a/MediaBrowser.Controller/Entities/CollectionFolder.cs b/MediaBrowser.Controller/Entities/CollectionFolder.cs index 75d6b9381..66654dec4 100644 --- a/MediaBrowser.Controller/Entities/CollectionFolder.cs +++ b/MediaBrowser.Controller/Entities/CollectionFolder.cs @@ -8,9 +8,7 @@ using System.Threading.Tasks; using MediaBrowser.Controller.IO; using MediaBrowser.Controller.Library; using MediaBrowser.Controller.Providers; -using MediaBrowser.Controller.Configuration; using MediaBrowser.Model.Configuration; -using MediaBrowser.Model.Entities; using MediaBrowser.Model.Extensions; using MediaBrowser.Model.IO; using MediaBrowser.Model.Serialization; diff --git a/MediaBrowser.Controller/Entities/DayOfWeekHelper.cs b/MediaBrowser.Controller/Entities/DayOfWeekHelper.cs index 166ef66d4..d871daf3c 100644 --- a/MediaBrowser.Controller/Entities/DayOfWeekHelper.cs +++ b/MediaBrowser.Controller/Entities/DayOfWeekHelper.cs @@ -1,6 +1,6 @@ -using MediaBrowser.Model.Configuration; -using System; +using System; using System.Collections.Generic; +using MediaBrowser.Model.Configuration; namespace MediaBrowser.Controller.Entities { diff --git a/MediaBrowser.Controller/Entities/Extensions.cs b/MediaBrowser.Controller/Entities/Extensions.cs index 91f78b902..dea2fdc5e 100644 --- a/MediaBrowser.Controller/Entities/Extensions.cs +++ b/MediaBrowser.Controller/Entities/Extensions.cs @@ -1,7 +1,6 @@ -using MediaBrowser.Model.Entities; -using System; +using System; using System.Linq; -using MediaBrowser.Model.Extensions; +using MediaBrowser.Model.Entities; namespace MediaBrowser.Controller.Entities { @@ -35,7 +34,7 @@ namespace MediaBrowser.Controller.Entities } else { - item.RemoteTrailers = item.RemoteTrailers.Concat(new [] { mediaUrl }).ToArray(); + item.RemoteTrailers = item.RemoteTrailers.Concat(new[] { mediaUrl }).ToArray(); } } } diff --git a/MediaBrowser.Controller/Entities/Folder.cs b/MediaBrowser.Controller/Entities/Folder.cs index d9952cea8..007977322 100644 --- a/MediaBrowser.Controller/Entities/Folder.cs +++ b/MediaBrowser.Controller/Entities/Folder.cs @@ -1,27 +1,23 @@ -using MediaBrowser.Common.Progress; -using MediaBrowser.Controller.Library; -using MediaBrowser.Controller.Providers; -using MediaBrowser.Model.Dto; -using MediaBrowser.Model.Entities; -using MediaBrowser.Model.Querying; -using System; +using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Threading; using System.Threading.Tasks; +using MediaBrowser.Common.Progress; using MediaBrowser.Controller.Channels; +using MediaBrowser.Controller.Collections; +using MediaBrowser.Controller.Configuration; using MediaBrowser.Controller.Dto; using MediaBrowser.Controller.Entities.Audio; using MediaBrowser.Controller.Entities.Movies; using MediaBrowser.Controller.Entities.TV; -using MediaBrowser.Controller.IO; -using MediaBrowser.Model.Channels; +using MediaBrowser.Controller.Library; +using MediaBrowser.Controller.Providers; +using MediaBrowser.Model.Dto; using MediaBrowser.Model.IO; +using MediaBrowser.Model.Querying; using MediaBrowser.Model.Serialization; -using MediaBrowser.Model.Extensions; -using MediaBrowser.Controller.Collections; -using MediaBrowser.Controller.Configuration; using Microsoft.Extensions.Logging; namespace MediaBrowser.Controller.Entities diff --git a/MediaBrowser.Controller/Entities/GameGenre.cs b/MediaBrowser.Controller/Entities/GameGenre.cs index ba178d3c3..b31b3187d 100644 --- a/MediaBrowser.Controller/Entities/GameGenre.cs +++ b/MediaBrowser.Controller/Entities/GameGenre.cs @@ -1,7 +1,7 @@ using System; using System.Collections.Generic; -using MediaBrowser.Model.Serialization; using MediaBrowser.Controller.Extensions; +using MediaBrowser.Model.Serialization; using Microsoft.Extensions.Logging; namespace MediaBrowser.Controller.Entities diff --git a/MediaBrowser.Controller/Entities/GameSystem.cs b/MediaBrowser.Controller/Entities/GameSystem.cs index fb60ce83a..3e0844675 100644 --- a/MediaBrowser.Controller/Entities/GameSystem.cs +++ b/MediaBrowser.Controller/Entities/GameSystem.cs @@ -1,8 +1,8 @@ -using MediaBrowser.Model.Serialization; +using System; +using System.Collections.Generic; using MediaBrowser.Controller.Providers; using MediaBrowser.Model.Configuration; -using System; -using System.Collections.Generic; +using MediaBrowser.Model.Serialization; using MediaBrowser.Model.Users; namespace MediaBrowser.Controller.Entities diff --git a/MediaBrowser.Controller/Entities/Genre.cs b/MediaBrowser.Controller/Entities/Genre.cs index 57ffe2744..8ac9b31e6 100644 --- a/MediaBrowser.Controller/Entities/Genre.cs +++ b/MediaBrowser.Controller/Entities/Genre.cs @@ -1,8 +1,8 @@ -using MediaBrowser.Model.Serialization; -using MediaBrowser.Controller.Entities.Audio; -using System; +using System; using System.Collections.Generic; +using MediaBrowser.Controller.Entities.Audio; using MediaBrowser.Controller.Extensions; +using MediaBrowser.Model.Serialization; using Microsoft.Extensions.Logging; namespace MediaBrowser.Controller.Entities diff --git a/MediaBrowser.Controller/Entities/ICollectionFolder.cs b/MediaBrowser.Controller/Entities/ICollectionFolder.cs index b61e7b339..bd3c9df7d 100644 --- a/MediaBrowser.Controller/Entities/ICollectionFolder.cs +++ b/MediaBrowser.Controller/Entities/ICollectionFolder.cs @@ -1,6 +1,4 @@ using System; -using System.Collections.Generic; -using System.Linq; namespace MediaBrowser.Controller.Entities { diff --git a/MediaBrowser.Controller/Entities/IHasMediaSources.cs b/MediaBrowser.Controller/Entities/IHasMediaSources.cs index a13c95942..d44b2d4ec 100644 --- a/MediaBrowser.Controller/Entities/IHasMediaSources.cs +++ b/MediaBrowser.Controller/Entities/IHasMediaSources.cs @@ -1,7 +1,7 @@ -using MediaBrowser.Model.Dto; +using System; using System.Collections.Generic; +using MediaBrowser.Model.Dto; using MediaBrowser.Model.Entities; -using System; namespace MediaBrowser.Controller.Entities { diff --git a/MediaBrowser.Controller/Entities/IHasTrailers.cs b/MediaBrowser.Controller/Entities/IHasTrailers.cs index 8e7c4e007..e70948175 100644 --- a/MediaBrowser.Controller/Entities/IHasTrailers.cs +++ b/MediaBrowser.Controller/Entities/IHasTrailers.cs @@ -1,7 +1,7 @@ -using MediaBrowser.Model.Entities; -using System; +using System; using System.Collections.Generic; using System.Linq; +using MediaBrowser.Model.Entities; namespace MediaBrowser.Controller.Entities { diff --git a/MediaBrowser.Controller/Entities/IMetadataContainer.cs b/MediaBrowser.Controller/Entities/IMetadataContainer.cs index 33aa08425..a3b67bf25 100644 --- a/MediaBrowser.Controller/Entities/IMetadataContainer.cs +++ b/MediaBrowser.Controller/Entities/IMetadataContainer.cs @@ -1,7 +1,7 @@ -using MediaBrowser.Controller.Providers; -using System; +using System; using System.Threading; using System.Threading.Tasks; +using MediaBrowser.Controller.Providers; namespace MediaBrowser.Controller.Entities { diff --git a/MediaBrowser.Controller/Entities/InternalItemsQuery.cs b/MediaBrowser.Controller/Entities/InternalItemsQuery.cs index b35e36e1b..92dd6ff34 100644 --- a/MediaBrowser.Controller/Entities/InternalItemsQuery.cs +++ b/MediaBrowser.Controller/Entities/InternalItemsQuery.cs @@ -1,9 +1,9 @@ -using MediaBrowser.Model.Entities; -using System; +using System; using System.Collections.Generic; -using MediaBrowser.Model.Configuration; using System.Linq; using MediaBrowser.Controller.Dto; +using MediaBrowser.Model.Configuration; +using MediaBrowser.Model.Entities; namespace MediaBrowser.Controller.Entities { diff --git a/MediaBrowser.Controller/Entities/InternalPeopleQuery.cs b/MediaBrowser.Controller/Entities/InternalPeopleQuery.cs index ce3e9e070..31a1446da 100644 --- a/MediaBrowser.Controller/Entities/InternalPeopleQuery.cs +++ b/MediaBrowser.Controller/Entities/InternalPeopleQuery.cs @@ -1,5 +1,4 @@ using System; -using System.Collections.Generic; namespace MediaBrowser.Controller.Entities { diff --git a/MediaBrowser.Controller/Entities/ItemImageInfo.cs b/MediaBrowser.Controller/Entities/ItemImageInfo.cs index bd0011c4b..8e5f2d08f 100644 --- a/MediaBrowser.Controller/Entities/ItemImageInfo.cs +++ b/MediaBrowser.Controller/Entities/ItemImageInfo.cs @@ -1,5 +1,5 @@ -using MediaBrowser.Model.Entities; -using System; +using System; +using MediaBrowser.Model.Entities; using MediaBrowser.Model.Serialization; namespace MediaBrowser.Controller.Entities diff --git a/MediaBrowser.Controller/Entities/Movies/BoxSet.cs b/MediaBrowser.Controller/Entities/Movies/BoxSet.cs index 51fb73df7..141397473 100644 --- a/MediaBrowser.Controller/Entities/Movies/BoxSet.cs +++ b/MediaBrowser.Controller/Entities/Movies/BoxSet.cs @@ -1,13 +1,12 @@ -using MediaBrowser.Controller.Providers; +using System; +using System.Collections.Generic; +using System.Linq; +using MediaBrowser.Controller.Providers; using MediaBrowser.Model.Configuration; using MediaBrowser.Model.Entities; using MediaBrowser.Model.Querying; -using MediaBrowser.Model.Users; -using System; -using System.Collections.Generic; -using System.Linq; using MediaBrowser.Model.Serialization; -using MediaBrowser.Model.Extensions; +using MediaBrowser.Model.Users; namespace MediaBrowser.Controller.Entities.Movies { diff --git a/MediaBrowser.Controller/Entities/Movies/Movie.cs b/MediaBrowser.Controller/Entities/Movies/Movie.cs index 1d7e1cff1..3e8f3678b 100644 --- a/MediaBrowser.Controller/Entities/Movies/Movie.cs +++ b/MediaBrowser.Controller/Entities/Movies/Movie.cs @@ -1,11 +1,11 @@ -using MediaBrowser.Controller.Providers; -using MediaBrowser.Model.Configuration; -using MediaBrowser.Model.Entities; -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Threading; using System.Threading.Tasks; +using MediaBrowser.Controller.Providers; +using MediaBrowser.Model.Configuration; +using MediaBrowser.Model.Entities; using MediaBrowser.Model.IO; using MediaBrowser.Model.Providers; using MediaBrowser.Model.Serialization; @@ -21,10 +21,10 @@ namespace MediaBrowser.Controller.Entities.Movies public Movie() { - SpecialFeatureIds = new Guid[] {}; + SpecialFeatureIds = new Guid[] { }; RemoteTrailers = EmptyMediaUrlArray; - LocalTrailerIds = new Guid[] {}; - RemoteTrailerIds = new Guid[] {}; + LocalTrailerIds = new Guid[] { }; + RemoteTrailerIds = new Guid[] { }; } public Guid[] LocalTrailerIds { get; set; } diff --git a/MediaBrowser.Controller/Entities/MusicVideo.cs b/MediaBrowser.Controller/Entities/MusicVideo.cs index 4015a1178..d192a5520 100644 --- a/MediaBrowser.Controller/Entities/MusicVideo.cs +++ b/MediaBrowser.Controller/Entities/MusicVideo.cs @@ -1,9 +1,8 @@ -using MediaBrowser.Controller.Entities.Audio; +using System; +using MediaBrowser.Controller.Entities.Audio; using MediaBrowser.Controller.Providers; using MediaBrowser.Model.Configuration; -using System.Collections.Generic; using MediaBrowser.Model.Serialization; -using System; namespace MediaBrowser.Controller.Entities { diff --git a/MediaBrowser.Controller/Entities/PeopleHelper.cs b/MediaBrowser.Controller/Entities/PeopleHelper.cs index d09ef3a15..2fb613768 100644 --- a/MediaBrowser.Controller/Entities/PeopleHelper.cs +++ b/MediaBrowser.Controller/Entities/PeopleHelper.cs @@ -1,7 +1,7 @@ -using MediaBrowser.Model.Entities; using System; using System.Collections.Generic; using System.Linq; +using MediaBrowser.Model.Entities; namespace MediaBrowser.Controller.Entities { diff --git a/MediaBrowser.Controller/Entities/Person.cs b/MediaBrowser.Controller/Entities/Person.cs index 5c35a7411..fc7e9b339 100644 --- a/MediaBrowser.Controller/Entities/Person.cs +++ b/MediaBrowser.Controller/Entities/Person.cs @@ -1,7 +1,7 @@ -using MediaBrowser.Controller.Providers; -using System; +using System; using System.Collections.Generic; using MediaBrowser.Controller.Extensions; +using MediaBrowser.Controller.Providers; using MediaBrowser.Model.Entities; using MediaBrowser.Model.Serialization; using Microsoft.Extensions.Logging; diff --git a/MediaBrowser.Controller/Entities/Share.cs b/MediaBrowser.Controller/Entities/Share.cs index 4ea0b1ea6..fb22b65e8 100644 --- a/MediaBrowser.Controller/Entities/Share.cs +++ b/MediaBrowser.Controller/Entities/Share.cs @@ -1,6 +1,4 @@ -using System.Collections.Generic; - -namespace MediaBrowser.Controller.Entities +namespace MediaBrowser.Controller.Entities { public interface IHasShares { diff --git a/MediaBrowser.Controller/Entities/Studio.cs b/MediaBrowser.Controller/Entities/Studio.cs index c076cd680..83e369e32 100644 --- a/MediaBrowser.Controller/Entities/Studio.cs +++ b/MediaBrowser.Controller/Entities/Studio.cs @@ -1,7 +1,7 @@ using System; using System.Collections.Generic; -using MediaBrowser.Model.Serialization; using MediaBrowser.Controller.Extensions; +using MediaBrowser.Model.Serialization; using Microsoft.Extensions.Logging; namespace MediaBrowser.Controller.Entities diff --git a/MediaBrowser.Controller/Entities/TV/Episode.cs b/MediaBrowser.Controller/Entities/TV/Episode.cs index 0a367c594..8a04d7a8d 100644 --- a/MediaBrowser.Controller/Entities/TV/Episode.cs +++ b/MediaBrowser.Controller/Entities/TV/Episode.cs @@ -1,10 +1,10 @@ -using MediaBrowser.Controller.Providers; -using MediaBrowser.Model.Configuration; -using MediaBrowser.Model.Entities; using System; using System.Collections.Generic; using System.Globalization; using System.Linq; +using MediaBrowser.Controller.Providers; +using MediaBrowser.Model.Configuration; +using MediaBrowser.Model.Entities; using MediaBrowser.Model.IO; using MediaBrowser.Model.Serialization; using Microsoft.Extensions.Logging; @@ -143,7 +143,8 @@ namespace MediaBrowser.Controller.Entities.TV get { var seriesId = SeriesId; - if (seriesId.Equals(Guid.Empty)) { + if (seriesId.Equals(Guid.Empty)) + { seriesId = FindSeriesId(); } return !seriesId.Equals(Guid.Empty) ? (LibraryManager.GetItemById(seriesId) as Series) : null; @@ -156,7 +157,8 @@ namespace MediaBrowser.Controller.Entities.TV get { var seasonId = SeasonId; - if (seasonId.Equals(Guid.Empty)) { + if (seasonId.Equals(Guid.Empty)) + { seasonId = FindSeasonId(); } return !seasonId.Equals(Guid.Empty) ? (LibraryManager.GetItemById(seasonId) as Season) : null; diff --git a/MediaBrowser.Controller/Entities/TV/Season.cs b/MediaBrowser.Controller/Entities/TV/Season.cs index cb3a7f345..e1d48afa2 100644 --- a/MediaBrowser.Controller/Entities/TV/Season.cs +++ b/MediaBrowser.Controller/Entities/TV/Season.cs @@ -1,13 +1,12 @@ using System; -using MediaBrowser.Controller.Providers; -using MediaBrowser.Model.Querying; -using MediaBrowser.Model.Users; using System.Collections.Generic; using System.Linq; -using System.Threading.Tasks; using MediaBrowser.Controller.Dto; +using MediaBrowser.Controller.Providers; using MediaBrowser.Model.Configuration; +using MediaBrowser.Model.Querying; using MediaBrowser.Model.Serialization; +using MediaBrowser.Model.Users; namespace MediaBrowser.Controller.Entities.TV { diff --git a/MediaBrowser.Controller/Entities/TV/Series.cs b/MediaBrowser.Controller/Entities/TV/Series.cs index d4a62626e..69f467363 100644 --- a/MediaBrowser.Controller/Entities/TV/Series.cs +++ b/MediaBrowser.Controller/Entities/TV/Series.cs @@ -1,17 +1,17 @@ -using MediaBrowser.Controller.Providers; -using MediaBrowser.Model.Configuration; -using MediaBrowser.Model.Entities; -using MediaBrowser.Model.Querying; -using MediaBrowser.Model.Users; -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Threading; using System.Threading.Tasks; using MediaBrowser.Controller.Dto; +using MediaBrowser.Controller.Providers; +using MediaBrowser.Model.Configuration; +using MediaBrowser.Model.Entities; using MediaBrowser.Model.Extensions; using MediaBrowser.Model.Providers; +using MediaBrowser.Model.Querying; using MediaBrowser.Model.Serialization; +using MediaBrowser.Model.Users; namespace MediaBrowser.Controller.Entities.TV { diff --git a/MediaBrowser.Controller/Entities/TagExtensions.cs b/MediaBrowser.Controller/Entities/TagExtensions.cs index 3e079a2a8..810571634 100644 --- a/MediaBrowser.Controller/Entities/TagExtensions.cs +++ b/MediaBrowser.Controller/Entities/TagExtensions.cs @@ -22,7 +22,7 @@ namespace MediaBrowser.Controller.Entities } else { - item.Tags = current.Concat(new [] { name }).ToArray(); + item.Tags = current.Concat(new[] { name }).ToArray(); } } } diff --git a/MediaBrowser.Controller/Entities/Trailer.cs b/MediaBrowser.Controller/Entities/Trailer.cs index d84ac187b..091215c88 100644 --- a/MediaBrowser.Controller/Entities/Trailer.cs +++ b/MediaBrowser.Controller/Entities/Trailer.cs @@ -1,10 +1,10 @@ -using MediaBrowser.Controller.Providers; +using System; +using System.Collections.Generic; +using MediaBrowser.Controller.Providers; using MediaBrowser.Model.Configuration; using MediaBrowser.Model.Entities; -using System.Collections.Generic; using MediaBrowser.Model.Providers; using MediaBrowser.Model.Serialization; -using System; namespace MediaBrowser.Controller.Entities { diff --git a/MediaBrowser.Controller/Entities/User.cs b/MediaBrowser.Controller/Entities/User.cs index 57e3210a1..b6b9a154d 100644 --- a/MediaBrowser.Controller/Entities/User.cs +++ b/MediaBrowser.Controller/Entities/User.cs @@ -1,12 +1,12 @@ -using MediaBrowser.Controller.Library; +using System; +using System.Threading; +using System.Threading.Tasks; +using MediaBrowser.Controller.Library; using MediaBrowser.Controller.Providers; using MediaBrowser.Model.Configuration; using MediaBrowser.Model.Connect; using MediaBrowser.Model.Serialization; using MediaBrowser.Model.Users; -using System; -using System.Threading; -using System.Threading.Tasks; namespace MediaBrowser.Controller.Entities { @@ -335,7 +335,7 @@ namespace MediaBrowser.Controller.Entities } } - public long InternalId { get; set;} + public long InternalId { get; set; } } diff --git a/MediaBrowser.Controller/Entities/UserRootFolder.cs b/MediaBrowser.Controller/Entities/UserRootFolder.cs index abfcd7984..7b55d8bb9 100644 --- a/MediaBrowser.Controller/Entities/UserRootFolder.cs +++ b/MediaBrowser.Controller/Entities/UserRootFolder.cs @@ -1,12 +1,12 @@ -using MediaBrowser.Model.Serialization; -using MediaBrowser.Controller.Providers; -using MediaBrowser.Model.Library; -using MediaBrowser.Model.Querying; using System; using System.Collections.Generic; using System.Linq; using System.Threading; using System.Threading.Tasks; +using MediaBrowser.Controller.Providers; +using MediaBrowser.Model.Library; +using MediaBrowser.Model.Querying; +using MediaBrowser.Model.Serialization; namespace MediaBrowser.Controller.Entities { diff --git a/MediaBrowser.Controller/Entities/UserView.cs b/MediaBrowser.Controller/Entities/UserView.cs index b7c9884ff..baa31a1db 100644 --- a/MediaBrowser.Controller/Entities/UserView.cs +++ b/MediaBrowser.Controller/Entities/UserView.cs @@ -1,11 +1,11 @@ -using MediaBrowser.Controller.Playlists; -using MediaBrowser.Controller.TV; -using MediaBrowser.Model.Querying; -using System; +using System; using System.Collections.Generic; using System.Linq; -using MediaBrowser.Model.Serialization; using System.Threading.Tasks; +using MediaBrowser.Controller.Playlists; +using MediaBrowser.Controller.TV; +using MediaBrowser.Model.Querying; +using MediaBrowser.Model.Serialization; namespace MediaBrowser.Controller.Entities { diff --git a/MediaBrowser.Controller/Entities/UserViewBuilder.cs b/MediaBrowser.Controller/Entities/UserViewBuilder.cs index 284ff2a53..6f98fcd8d 100644 --- a/MediaBrowser.Controller/Entities/UserViewBuilder.cs +++ b/MediaBrowser.Controller/Entities/UserViewBuilder.cs @@ -1,20 +1,15 @@ -using MediaBrowser.Controller.Entities.Audio; +using System; +using System.Collections.Generic; +using System.Linq; +using MediaBrowser.Controller.Configuration; using MediaBrowser.Controller.Entities.Movies; using MediaBrowser.Controller.Entities.TV; using MediaBrowser.Controller.Library; using MediaBrowser.Controller.Playlists; using MediaBrowser.Controller.TV; using MediaBrowser.Model.Entities; -using Microsoft.Extensions.Logging; using MediaBrowser.Model.Querying; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading; -using System.Threading.Tasks; -using MediaBrowser.Controller.Configuration; -using MediaBrowser.Controller.Collections; -using MediaBrowser.Model.Extensions; +using Microsoft.Extensions.Logging; namespace MediaBrowser.Controller.Entities { diff --git a/MediaBrowser.Controller/Entities/Video.cs b/MediaBrowser.Controller/Entities/Video.cs index 2db200ee2..6ffd26f6d 100644 --- a/MediaBrowser.Controller/Entities/Video.cs +++ b/MediaBrowser.Controller/Entities/Video.cs @@ -1,20 +1,19 @@ -using MediaBrowser.Controller.Library; -using MediaBrowser.Controller.Persistence; -using MediaBrowser.Controller.Providers; -using MediaBrowser.Model.Dto; -using MediaBrowser.Model.Entities; -using MediaBrowser.Model.MediaInfo; -using System; +using System; using System.Collections.Generic; using System.Globalization; using System.Linq; using System.Threading; using System.Threading.Tasks; +using MediaBrowser.Controller.Library; +using MediaBrowser.Controller.LiveTv; +using MediaBrowser.Controller.MediaEncoding; +using MediaBrowser.Controller.Persistence; +using MediaBrowser.Controller.Providers; +using MediaBrowser.Model.Dto; +using MediaBrowser.Model.Entities; using MediaBrowser.Model.IO; +using MediaBrowser.Model.MediaInfo; using MediaBrowser.Model.Serialization; -using MediaBrowser.Model.Extensions; -using MediaBrowser.Controller.MediaEncoding; -using MediaBrowser.Controller.LiveTv; namespace MediaBrowser.Controller.Entities { diff --git a/MediaBrowser.Controller/IO/FileData.cs b/MediaBrowser.Controller/IO/FileData.cs index a95d562a2..9b40d0e0b 100644 --- a/MediaBrowser.Controller/IO/FileData.cs +++ b/MediaBrowser.Controller/IO/FileData.cs @@ -1,9 +1,9 @@ -using MediaBrowser.Controller.Library; -using MediaBrowser.Controller.Providers; -using Microsoft.Extensions.Logging; -using System; +using System; using System.Collections.Generic; +using MediaBrowser.Controller.Library; +using MediaBrowser.Controller.Providers; using MediaBrowser.Model.IO; +using Microsoft.Extensions.Logging; namespace MediaBrowser.Controller.IO { diff --git a/MediaBrowser.Controller/IResourceFileManager.cs b/MediaBrowser.Controller/IResourceFileManager.cs index 64f1b9f7a..7151cda29 100644 --- a/MediaBrowser.Controller/IResourceFileManager.cs +++ b/MediaBrowser.Controller/IResourceFileManager.cs @@ -1,22 +1,6 @@ -using MediaBrowser.Common.Extensions; -using MediaBrowser.Controller; -using MediaBrowser.Controller.Configuration; -using MediaBrowser.Controller.Net; -using MediaBrowser.Controller.Plugins; -using MediaBrowser.Model.Extensions; -using Microsoft.Extensions.Logging; -using MediaBrowser.Model.Net; -using MediaBrowser.Model.Serialization; -using System; -using System.Collections.Generic; +using System; using System.IO; -using System.Linq; using System.Threading.Tasks; -using MediaBrowser.Common.Plugins; -using MediaBrowser.Model.IO; -using MediaBrowser.Model.Globalization; -using MediaBrowser.Model.Plugins; -using MediaBrowser.Model.Reflection; using MediaBrowser.Model.Services; namespace MediaBrowser.Controller diff --git a/MediaBrowser.Controller/IServerApplicationHost.cs b/MediaBrowser.Controller/IServerApplicationHost.cs index 57a3bbc0a..f0d7e5b71 100644 --- a/MediaBrowser.Controller/IServerApplicationHost.cs +++ b/MediaBrowser.Controller/IServerApplicationHost.cs @@ -1,11 +1,10 @@ -using MediaBrowser.Common; -using MediaBrowser.Model.System; -using System; +using System; using System.Collections.Generic; -using System.Net; +using System.Threading; using System.Threading.Tasks; +using MediaBrowser.Common; using MediaBrowser.Model.Net; -using System.Threading; +using MediaBrowser.Model.System; namespace MediaBrowser.Controller { diff --git a/MediaBrowser.Controller/Library/IIntroProvider.cs b/MediaBrowser.Controller/Library/IIntroProvider.cs index 611aab387..a39f5d995 100644 --- a/MediaBrowser.Controller/Library/IIntroProvider.cs +++ b/MediaBrowser.Controller/Library/IIntroProvider.cs @@ -1,6 +1,6 @@ -using MediaBrowser.Controller.Entities; -using System.Collections.Generic; +using System.Collections.Generic; using System.Threading.Tasks; +using MediaBrowser.Controller.Entities; namespace MediaBrowser.Controller.Library { diff --git a/MediaBrowser.Controller/Library/ILibraryManager.cs b/MediaBrowser.Controller/Library/ILibraryManager.cs index cefa9ebdf..0ada91b2e 100644 --- a/MediaBrowser.Controller/Library/ILibraryManager.cs +++ b/MediaBrowser.Controller/Library/ILibraryManager.cs @@ -1,22 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using MediaBrowser.Controller.Dto; using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Entities.Audio; using MediaBrowser.Controller.Entities.TV; using MediaBrowser.Controller.Providers; using MediaBrowser.Controller.Resolvers; using MediaBrowser.Controller.Sorting; -using MediaBrowser.Model.Entities; -using MediaBrowser.Model.Querying; -using System; -using System.Collections.Generic; -using System.Threading; -using System.Threading.Tasks; - -using MediaBrowser.Controller.Configuration; -using MediaBrowser.Controller.Dto; -using MediaBrowser.Controller.IO; using MediaBrowser.Model.Configuration; using MediaBrowser.Model.Dto; +using MediaBrowser.Model.Entities; using MediaBrowser.Model.IO; +using MediaBrowser.Model.Querying; namespace MediaBrowser.Controller.Library { diff --git a/MediaBrowser.Controller/Library/ILiveStream.cs b/MediaBrowser.Controller/Library/ILiveStream.cs index e00da7340..2d776c798 100644 --- a/MediaBrowser.Controller/Library/ILiveStream.cs +++ b/MediaBrowser.Controller/Library/ILiveStream.cs @@ -1,7 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Threading; +using System.Threading; using System.Threading.Tasks; using MediaBrowser.Model.Dto; diff --git a/MediaBrowser.Controller/Library/IMediaSourceManager.cs b/MediaBrowser.Controller/Library/IMediaSourceManager.cs index 8541c4fd9..a81972f2a 100644 --- a/MediaBrowser.Controller/Library/IMediaSourceManager.cs +++ b/MediaBrowser.Controller/Library/IMediaSourceManager.cs @@ -1,13 +1,13 @@ -using MediaBrowser.Controller.Entities; +using System; +using System.Collections.Generic; +using System.IO; +using System.Threading; +using System.Threading.Tasks; +using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Persistence; using MediaBrowser.Model.Dto; using MediaBrowser.Model.Entities; using MediaBrowser.Model.MediaInfo; -using System; -using System.Collections.Generic; -using System.Threading; -using System.Threading.Tasks; -using System.IO; namespace MediaBrowser.Controller.Library { diff --git a/MediaBrowser.Controller/Library/IMediaSourceProvider.cs b/MediaBrowser.Controller/Library/IMediaSourceProvider.cs index eec138532..530ad3332 100644 --- a/MediaBrowser.Controller/Library/IMediaSourceProvider.cs +++ b/MediaBrowser.Controller/Library/IMediaSourceProvider.cs @@ -1,9 +1,8 @@ -using MediaBrowser.Controller.Entities; -using MediaBrowser.Model.Dto; -using System.Collections.Generic; +using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; -using System; +using MediaBrowser.Controller.Entities; +using MediaBrowser.Model.Dto; namespace MediaBrowser.Controller.Library { diff --git a/MediaBrowser.Controller/Library/IMetadataSaver.cs b/MediaBrowser.Controller/Library/IMetadataSaver.cs index f71afa656..08167c3bb 100644 --- a/MediaBrowser.Controller/Library/IMetadataSaver.cs +++ b/MediaBrowser.Controller/Library/IMetadataSaver.cs @@ -1,5 +1,5 @@ -using MediaBrowser.Controller.Entities; -using System.Threading; +using System.Threading; +using MediaBrowser.Controller.Entities; namespace MediaBrowser.Controller.Library { diff --git a/MediaBrowser.Controller/Library/IMusicManager.cs b/MediaBrowser.Controller/Library/IMusicManager.cs index 535e6df7e..88390412d 100644 --- a/MediaBrowser.Controller/Library/IMusicManager.cs +++ b/MediaBrowser.Controller/Library/IMusicManager.cs @@ -1,7 +1,7 @@ -using MediaBrowser.Controller.Entities; -using MediaBrowser.Controller.Entities.Audio; -using System.Collections.Generic; +using System.Collections.Generic; using MediaBrowser.Controller.Dto; +using MediaBrowser.Controller.Entities; +using MediaBrowser.Controller.Entities.Audio; namespace MediaBrowser.Controller.Library { diff --git a/MediaBrowser.Controller/Library/IUserDataManager.cs b/MediaBrowser.Controller/Library/IUserDataManager.cs index f3f81378b..084865393 100644 --- a/MediaBrowser.Controller/Library/IUserDataManager.cs +++ b/MediaBrowser.Controller/Library/IUserDataManager.cs @@ -1,10 +1,10 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; +using System.Threading; using MediaBrowser.Controller.Dto; using MediaBrowser.Controller.Entities; using MediaBrowser.Model.Dto; using MediaBrowser.Model.Entities; -using System; -using System.Threading; namespace MediaBrowser.Controller.Library { diff --git a/MediaBrowser.Controller/Library/IUserManager.cs b/MediaBrowser.Controller/Library/IUserManager.cs index 154ef3b05..95df5843c 100644 --- a/MediaBrowser.Controller/Library/IUserManager.cs +++ b/MediaBrowser.Controller/Library/IUserManager.cs @@ -1,13 +1,13 @@ -using MediaBrowser.Controller.Entities; -using MediaBrowser.Model.Configuration; -using MediaBrowser.Model.Dto; -using MediaBrowser.Model.Events; -using System; +using System; using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; -using MediaBrowser.Model.Users; using MediaBrowser.Controller.Authentication; +using MediaBrowser.Controller.Entities; +using MediaBrowser.Model.Configuration; +using MediaBrowser.Model.Dto; +using MediaBrowser.Model.Events; +using MediaBrowser.Model.Users; namespace MediaBrowser.Controller.Library { diff --git a/MediaBrowser.Controller/Library/IUserViewManager.cs b/MediaBrowser.Controller/Library/IUserViewManager.cs index f4649777c..f31699ee1 100644 --- a/MediaBrowser.Controller/Library/IUserViewManager.cs +++ b/MediaBrowser.Controller/Library/IUserViewManager.cs @@ -1,11 +1,9 @@ -using MediaBrowser.Controller.Entities; -using MediaBrowser.Model.Library; -using MediaBrowser.Model.Querying; -using System; +using System; using System.Collections.Generic; -using System.Threading; -using System.Threading.Tasks; using MediaBrowser.Controller.Dto; +using MediaBrowser.Controller.Entities; +using MediaBrowser.Model.Library; +using MediaBrowser.Model.Querying; namespace MediaBrowser.Controller.Library { diff --git a/MediaBrowser.Controller/Library/ItemResolveArgs.cs b/MediaBrowser.Controller/Library/ItemResolveArgs.cs index 4d1a4ed2f..dfe23f193 100644 --- a/MediaBrowser.Controller/Library/ItemResolveArgs.cs +++ b/MediaBrowser.Controller/Library/ItemResolveArgs.cs @@ -1,8 +1,8 @@ -using MediaBrowser.Controller.Entities; -using MediaBrowser.Controller.Providers; using System; using System.Collections.Generic; using System.Linq; +using MediaBrowser.Controller.Entities; +using MediaBrowser.Controller.Providers; using MediaBrowser.Model.Configuration; using MediaBrowser.Model.IO; diff --git a/MediaBrowser.Controller/Library/MetadataConfigurationStore.cs b/MediaBrowser.Controller/Library/MetadataConfigurationStore.cs index dc2fa0f99..662d11117 100644 --- a/MediaBrowser.Controller/Library/MetadataConfigurationStore.cs +++ b/MediaBrowser.Controller/Library/MetadataConfigurationStore.cs @@ -1,6 +1,6 @@ -using MediaBrowser.Common.Configuration; +using System.Collections.Generic; +using MediaBrowser.Common.Configuration; using MediaBrowser.Model.Configuration; -using System.Collections.Generic; namespace MediaBrowser.Controller.Library { diff --git a/MediaBrowser.Controller/Library/PlaybackProgressEventArgs.cs b/MediaBrowser.Controller/Library/PlaybackProgressEventArgs.cs index 00d9932a7..c563e09c3 100644 --- a/MediaBrowser.Controller/Library/PlaybackProgressEventArgs.cs +++ b/MediaBrowser.Controller/Library/PlaybackProgressEventArgs.cs @@ -1,8 +1,8 @@ -using MediaBrowser.Controller.Entities; -using MediaBrowser.Model.Dto; -using System; +using System; using System.Collections.Generic; +using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Session; +using MediaBrowser.Model.Dto; namespace MediaBrowser.Controller.Library { diff --git a/MediaBrowser.Controller/Library/Profiler.cs b/MediaBrowser.Controller/Library/Profiler.cs index 745e49920..c2831d1cf 100644 --- a/MediaBrowser.Controller/Library/Profiler.cs +++ b/MediaBrowser.Controller/Library/Profiler.cs @@ -1,6 +1,6 @@ -using Microsoft.Extensions.Logging; -using System; +using System; using System.Diagnostics; +using Microsoft.Extensions.Logging; namespace MediaBrowser.Controller.Library { diff --git a/MediaBrowser.Controller/Library/TVUtils.cs b/MediaBrowser.Controller/Library/TVUtils.cs index 162ebc75e..15a47700a 100644 --- a/MediaBrowser.Controller/Library/TVUtils.cs +++ b/MediaBrowser.Controller/Library/TVUtils.cs @@ -1,5 +1,4 @@ using System; -using System.Collections.Generic; namespace MediaBrowser.Controller.Library { @@ -51,7 +50,7 @@ namespace MediaBrowser.Controller.Library }; } - return new DayOfWeek[]{}; + return new DayOfWeek[] { }; } return null; } diff --git a/MediaBrowser.Controller/Library/UserDataSaveEventArgs.cs b/MediaBrowser.Controller/Library/UserDataSaveEventArgs.cs index d921a7077..2769071f7 100644 --- a/MediaBrowser.Controller/Library/UserDataSaveEventArgs.cs +++ b/MediaBrowser.Controller/Library/UserDataSaveEventArgs.cs @@ -1,7 +1,7 @@ -using MediaBrowser.Controller.Entities; -using MediaBrowser.Model.Entities; -using System; +using System; using System.Collections.Generic; +using MediaBrowser.Controller.Entities; +using MediaBrowser.Model.Entities; namespace MediaBrowser.Controller.Library { diff --git a/MediaBrowser.Controller/LiveTv/IListingsProvider.cs b/MediaBrowser.Controller/LiveTv/IListingsProvider.cs index faf4a34df..bb4bf8426 100644 --- a/MediaBrowser.Controller/LiveTv/IListingsProvider.cs +++ b/MediaBrowser.Controller/LiveTv/IListingsProvider.cs @@ -1,9 +1,9 @@ -using MediaBrowser.Model.Dto; -using MediaBrowser.Model.LiveTv; -using System; +using System; using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; +using MediaBrowser.Model.Dto; +using MediaBrowser.Model.LiveTv; namespace MediaBrowser.Controller.LiveTv { diff --git a/MediaBrowser.Controller/LiveTv/ILiveTvManager.cs b/MediaBrowser.Controller/LiveTv/ILiveTvManager.cs index a7f675034..566fa9700 100644 --- a/MediaBrowser.Controller/LiveTv/ILiveTvManager.cs +++ b/MediaBrowser.Controller/LiveTv/ILiveTvManager.cs @@ -1,15 +1,14 @@ using System; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; using MediaBrowser.Controller.Dto; using MediaBrowser.Controller.Entities; +using MediaBrowser.Controller.Library; using MediaBrowser.Model.Dto; -using MediaBrowser.Model.Entities; +using MediaBrowser.Model.Events; using MediaBrowser.Model.LiveTv; using MediaBrowser.Model.Querying; -using System.Collections.Generic; -using System.Threading; -using System.Threading.Tasks; -using MediaBrowser.Model.Events; -using MediaBrowser.Controller.Library; namespace MediaBrowser.Controller.LiveTv { diff --git a/MediaBrowser.Controller/LiveTv/ILiveTvService.cs b/MediaBrowser.Controller/LiveTv/ILiveTvService.cs index 5986474d8..9b8bc28f7 100644 --- a/MediaBrowser.Controller/LiveTv/ILiveTvService.cs +++ b/MediaBrowser.Controller/LiveTv/ILiveTvService.cs @@ -1,10 +1,9 @@ -using MediaBrowser.Controller.Drawing; -using MediaBrowser.Model.Dto; -using System; +using System; using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; using MediaBrowser.Controller.Library; +using MediaBrowser.Model.Dto; namespace MediaBrowser.Controller.LiveTv { diff --git a/MediaBrowser.Controller/LiveTv/ITunerHost.cs b/MediaBrowser.Controller/LiveTv/ITunerHost.cs index d5a0e2115..1efbca4a8 100644 --- a/MediaBrowser.Controller/LiveTv/ITunerHost.cs +++ b/MediaBrowser.Controller/LiveTv/ITunerHost.cs @@ -1,9 +1,9 @@ -using MediaBrowser.Model.Dto; -using MediaBrowser.Model.LiveTv; -using System.Collections.Generic; +using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; using MediaBrowser.Controller.Library; +using MediaBrowser.Model.Dto; +using MediaBrowser.Model.LiveTv; namespace MediaBrowser.Controller.LiveTv { diff --git a/MediaBrowser.Controller/LiveTv/LiveTvChannel.cs b/MediaBrowser.Controller/LiveTv/LiveTvChannel.cs index 9e2d29eb6..1d2710081 100644 --- a/MediaBrowser.Controller/LiveTv/LiveTvChannel.cs +++ b/MediaBrowser.Controller/LiveTv/LiveTvChannel.cs @@ -1,14 +1,14 @@ -using MediaBrowser.Controller.Entities; +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using MediaBrowser.Controller.Entities; using MediaBrowser.Model.Configuration; using MediaBrowser.Model.Dto; using MediaBrowser.Model.Entities; using MediaBrowser.Model.LiveTv; using MediaBrowser.Model.MediaInfo; -using System.Collections.Generic; -using System.Globalization; using MediaBrowser.Model.Serialization; -using System; -using System.Linq; namespace MediaBrowser.Controller.LiveTv { diff --git a/MediaBrowser.Controller/LiveTv/LiveTvProgram.cs b/MediaBrowser.Controller/LiveTv/LiveTvProgram.cs index c4a75d199..752944f10 100644 --- a/MediaBrowser.Controller/LiveTv/LiveTvProgram.cs +++ b/MediaBrowser.Controller/LiveTv/LiveTvProgram.cs @@ -1,12 +1,12 @@ -using MediaBrowser.Controller.Entities; -using MediaBrowser.Controller.Providers; -using MediaBrowser.Model.Configuration; -using MediaBrowser.Model.LiveTv; -using System; +using System; using System.Collections.Generic; using System.Linq; using MediaBrowser.Common.Configuration; +using MediaBrowser.Controller.Entities; +using MediaBrowser.Controller.Providers; +using MediaBrowser.Model.Configuration; using MediaBrowser.Model.Entities; +using MediaBrowser.Model.LiveTv; using MediaBrowser.Model.Providers; using MediaBrowser.Model.Serialization; @@ -313,6 +313,6 @@ namespace MediaBrowser.Controller.LiveTv return list; } - public string SeriesName { get; set;} + public string SeriesName { get; set; } } } diff --git a/MediaBrowser.Controller/LiveTv/LiveTvServiceStatusInfo.cs b/MediaBrowser.Controller/LiveTv/LiveTvServiceStatusInfo.cs index 20e5d228b..5a290a4ba 100644 --- a/MediaBrowser.Controller/LiveTv/LiveTvServiceStatusInfo.cs +++ b/MediaBrowser.Controller/LiveTv/LiveTvServiceStatusInfo.cs @@ -1,5 +1,5 @@ -using MediaBrowser.Model.LiveTv; -using System.Collections.Generic; +using System.Collections.Generic; +using MediaBrowser.Model.LiveTv; namespace MediaBrowser.Controller.LiveTv { diff --git a/MediaBrowser.Controller/LiveTv/LiveTvTunerInfo.cs b/MediaBrowser.Controller/LiveTv/LiveTvTunerInfo.cs index ade25abdc..498848441 100644 --- a/MediaBrowser.Controller/LiveTv/LiveTvTunerInfo.cs +++ b/MediaBrowser.Controller/LiveTv/LiveTvTunerInfo.cs @@ -1,5 +1,5 @@ -using MediaBrowser.Model.LiveTv; -using System.Collections.Generic; +using System.Collections.Generic; +using MediaBrowser.Model.LiveTv; namespace MediaBrowser.Controller.LiveTv { diff --git a/MediaBrowser.Controller/LiveTv/ProgramInfo.cs b/MediaBrowser.Controller/LiveTv/ProgramInfo.cs index 9e3cbdded..02d5d17e8 100644 --- a/MediaBrowser.Controller/LiveTv/ProgramInfo.cs +++ b/MediaBrowser.Controller/LiveTv/ProgramInfo.cs @@ -1,7 +1,6 @@ -using MediaBrowser.Model.LiveTv; -using System; +using System; using System.Collections.Generic; -using MediaBrowser.Model.Entities; +using MediaBrowser.Model.LiveTv; namespace MediaBrowser.Controller.LiveTv { @@ -161,7 +160,7 @@ namespace MediaBrowser.Controller.LiveTv /// Gets or sets a value indicating whether this instance is premiere. /// /// true if this instance is premiere; otherwise, false. - public bool IsPremiere { get; set; } + public bool IsPremiere { get; set; } /// /// Gets or sets the production year. diff --git a/MediaBrowser.Controller/LiveTv/RecordingInfo.cs b/MediaBrowser.Controller/LiveTv/RecordingInfo.cs index 0ca4749d7..6a2e72a42 100644 --- a/MediaBrowser.Controller/LiveTv/RecordingInfo.cs +++ b/MediaBrowser.Controller/LiveTv/RecordingInfo.cs @@ -1,6 +1,6 @@ -using MediaBrowser.Model.LiveTv; -using System; +using System; using System.Collections.Generic; +using MediaBrowser.Model.LiveTv; namespace MediaBrowser.Controller.LiveTv { diff --git a/MediaBrowser.Controller/LiveTv/RecordingStatusChangedEventArgs.cs b/MediaBrowser.Controller/LiveTv/RecordingStatusChangedEventArgs.cs index 90ea329fe..efae9fd29 100644 --- a/MediaBrowser.Controller/LiveTv/RecordingStatusChangedEventArgs.cs +++ b/MediaBrowser.Controller/LiveTv/RecordingStatusChangedEventArgs.cs @@ -1,5 +1,5 @@ -using MediaBrowser.Model.LiveTv; -using System; +using System; +using MediaBrowser.Model.LiveTv; namespace MediaBrowser.Controller.LiveTv { diff --git a/MediaBrowser.Controller/LiveTv/TimerInfo.cs b/MediaBrowser.Controller/LiveTv/TimerInfo.cs index c9eb6fee6..bfe0e7b40 100644 --- a/MediaBrowser.Controller/LiveTv/TimerInfo.cs +++ b/MediaBrowser.Controller/LiveTv/TimerInfo.cs @@ -1,7 +1,7 @@ -using MediaBrowser.Model.LiveTv; -using System; +using System; using System.Collections.Generic; using System.Linq; +using MediaBrowser.Model.LiveTv; using MediaBrowser.Model.Serialization; namespace MediaBrowser.Controller.LiveTv diff --git a/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs b/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs index 5dca45c1e..3bc43143f 100644 --- a/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs +++ b/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs @@ -8,9 +8,9 @@ using MediaBrowser.Model.Configuration; using MediaBrowser.Model.Dlna; using MediaBrowser.Model.Dto; using MediaBrowser.Model.Entities; +using MediaBrowser.Model.Extensions; using MediaBrowser.Model.IO; using MediaBrowser.Model.MediaInfo; -using MediaBrowser.Model.Extensions; namespace MediaBrowser.Controller.MediaEncoding { diff --git a/MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs b/MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs index 3f6da59d8..972463d8d 100644 --- a/MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs +++ b/MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs @@ -5,11 +5,11 @@ using System.Linq; using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Library; using MediaBrowser.Model.Dlna; +using MediaBrowser.Model.Drawing; using MediaBrowser.Model.Dto; using MediaBrowser.Model.Entities; using MediaBrowser.Model.IO; using MediaBrowser.Model.MediaInfo; -using MediaBrowser.Model.Drawing; using MediaBrowser.Model.Session; using Microsoft.Extensions.Logging; @@ -745,11 +745,13 @@ namespace MediaBrowser.Controller.MediaEncoding } public IProgress Progress { get; set; } - public virtual void ReportTranscodingProgress(TimeSpan? transcodingPosition, float framerate, double? percentComplete, long bytesTranscoded, int? bitRate) { + public virtual void ReportTranscodingProgress(TimeSpan? transcodingPosition, float framerate, double? percentComplete, long bytesTranscoded, int? bitRate) + { Progress.Report(percentComplete.Value); } - public virtual void Dispose () { + public virtual void Dispose() + { } } diff --git a/MediaBrowser.Controller/MediaEncoding/IEncodingManager.cs b/MediaBrowser.Controller/MediaEncoding/IEncodingManager.cs index 7d50efd5e..8fc591566 100644 --- a/MediaBrowser.Controller/MediaEncoding/IEncodingManager.cs +++ b/MediaBrowser.Controller/MediaEncoding/IEncodingManager.cs @@ -2,8 +2,8 @@ using System.Threading; using System.Threading.Tasks; using MediaBrowser.Controller.Entities; -using MediaBrowser.Model.Entities; using MediaBrowser.Controller.Providers; +using MediaBrowser.Model.Entities; namespace MediaBrowser.Controller.MediaEncoding { diff --git a/MediaBrowser.Controller/MediaEncoding/IMediaEncoder.cs b/MediaBrowser.Controller/MediaEncoding/IMediaEncoder.cs index 2b85b8975..348e3ff96 100644 --- a/MediaBrowser.Controller/MediaEncoding/IMediaEncoder.cs +++ b/MediaBrowser.Controller/MediaEncoding/IMediaEncoder.cs @@ -1,11 +1,11 @@ -using MediaBrowser.Model.Entities; -using MediaBrowser.Model.MediaInfo; -using System; +using System; using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; using MediaBrowser.Model.Dlna; +using MediaBrowser.Model.Entities; using MediaBrowser.Model.IO; +using MediaBrowser.Model.MediaInfo; namespace MediaBrowser.Controller.MediaEncoding { diff --git a/MediaBrowser.Controller/MediaEncoding/ISubtitleEncoder.cs b/MediaBrowser.Controller/MediaEncoding/ISubtitleEncoder.cs index de7496d42..0624130d7 100644 --- a/MediaBrowser.Controller/MediaEncoding/ISubtitleEncoder.cs +++ b/MediaBrowser.Controller/MediaEncoding/ISubtitleEncoder.cs @@ -1,8 +1,8 @@ -using MediaBrowser.Model.MediaInfo; -using System.IO; +using System.IO; using System.Threading; using System.Threading.Tasks; using MediaBrowser.Controller.Entities; +using MediaBrowser.Model.MediaInfo; namespace MediaBrowser.Controller.MediaEncoding { diff --git a/MediaBrowser.Controller/MediaEncoding/JobLogger.cs b/MediaBrowser.Controller/MediaEncoding/JobLogger.cs index 0554822a8..a379efafa 100644 --- a/MediaBrowser.Controller/MediaEncoding/JobLogger.cs +++ b/MediaBrowser.Controller/MediaEncoding/JobLogger.cs @@ -1,9 +1,9 @@ -using MediaBrowser.Model.Extensions; using System; using System.Globalization; using System.IO; using System.Linq; using System.Text; +using MediaBrowser.Model.Extensions; using Microsoft.Extensions.Logging; namespace MediaBrowser.Controller.MediaEncoding diff --git a/MediaBrowser.Controller/MediaEncoding/MediaEncoderHelpers.cs b/MediaBrowser.Controller/MediaEncoding/MediaEncoderHelpers.cs index 70e4db84f..db91f9919 100644 --- a/MediaBrowser.Controller/MediaEncoding/MediaEncoderHelpers.cs +++ b/MediaBrowser.Controller/MediaEncoding/MediaEncoderHelpers.cs @@ -1,8 +1,8 @@ -using MediaBrowser.Model.IO; -using MediaBrowser.Model.MediaInfo; -using System; +using System; using System.IO; using System.Linq; +using MediaBrowser.Model.IO; +using MediaBrowser.Model.MediaInfo; namespace MediaBrowser.Controller.MediaEncoding { @@ -31,14 +31,14 @@ namespace MediaBrowser.Controller.MediaEncoding return GetPlayableStreamFiles(fileSystem, isoMount.MountedPath, playableStreamFileNames); } - return new[] {videoPath}; + return new[] { videoPath }; } private static string[] GetPlayableStreamFiles(IFileSystem fileSystem, string rootPath, string[] filenames) { if (filenames.Length == 0) { - return new string[]{}; + return new string[] { }; } var allFiles = fileSystem diff --git a/MediaBrowser.Controller/MediaEncoding/MediaInfoRequest.cs b/MediaBrowser.Controller/MediaEncoding/MediaInfoRequest.cs index b191f9905..c068e4d13 100644 --- a/MediaBrowser.Controller/MediaEncoding/MediaInfoRequest.cs +++ b/MediaBrowser.Controller/MediaEncoding/MediaInfoRequest.cs @@ -1,10 +1,7 @@ -using MediaBrowser.Model.Dlna; -using MediaBrowser.Model.Entities; -using MediaBrowser.Model.IO; -using MediaBrowser.Model.MediaInfo; -using System.Collections.Generic; +using System; +using MediaBrowser.Model.Dlna; using MediaBrowser.Model.Dto; -using System; +using MediaBrowser.Model.IO; namespace MediaBrowser.Controller.MediaEncoding { diff --git a/MediaBrowser.Controller/Net/AuthenticatedAttribute.cs b/MediaBrowser.Controller/Net/AuthenticatedAttribute.cs index 2f31b8e66..a71d1ae90 100644 --- a/MediaBrowser.Controller/Net/AuthenticatedAttribute.cs +++ b/MediaBrowser.Controller/Net/AuthenticatedAttribute.cs @@ -51,7 +51,7 @@ namespace MediaBrowser.Controller.Net public string[] GetRoles() { - return (Roles ?? string.Empty).Split(new []{ ',' }, StringSplitOptions.RemoveEmptyEntries); + return (Roles ?? string.Empty).Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries); } public bool AllowLocalOnly { get; set; } diff --git a/MediaBrowser.Controller/Net/AuthorizationInfo.cs b/MediaBrowser.Controller/Net/AuthorizationInfo.cs index 86c7b7e0f..4af0480f6 100644 --- a/MediaBrowser.Controller/Net/AuthorizationInfo.cs +++ b/MediaBrowser.Controller/Net/AuthorizationInfo.cs @@ -1,5 +1,5 @@ -using MediaBrowser.Controller.Entities; -using System; +using System; +using MediaBrowser.Controller.Entities; namespace MediaBrowser.Controller.Net { @@ -9,8 +9,10 @@ namespace MediaBrowser.Controller.Net /// Gets or sets the user identifier. /// /// The user identifier. - public Guid UserId { - get { + public Guid UserId + { + get + { return User == null ? Guid.Empty : User.Id; } } diff --git a/MediaBrowser.Controller/Net/BasePeriodicWebSocketListener.cs b/MediaBrowser.Controller/Net/BasePeriodicWebSocketListener.cs index b97b2f97d..bee53b4c5 100644 --- a/MediaBrowser.Controller/Net/BasePeriodicWebSocketListener.cs +++ b/MediaBrowser.Controller/Net/BasePeriodicWebSocketListener.cs @@ -1,12 +1,12 @@ -using MediaBrowser.Model.Net; -using MediaBrowser.Model.Threading; +using System; using System.Collections.Generic; using System.Globalization; using System.Linq; using System.Net.WebSockets; -using System.Threading.Tasks; using System.Threading; -using System; +using System.Threading.Tasks; +using MediaBrowser.Model.Net; +using MediaBrowser.Model.Threading; using Microsoft.Extensions.Logging; namespace MediaBrowser.Controller.Net diff --git a/MediaBrowser.Controller/Net/IHttpServer.cs b/MediaBrowser.Controller/Net/IHttpServer.cs index d2ebadcfa..f41303007 100644 --- a/MediaBrowser.Controller/Net/IHttpServer.cs +++ b/MediaBrowser.Controller/Net/IHttpServer.cs @@ -1,7 +1,7 @@ using System; using System.Collections.Generic; -using MediaBrowser.Model.Services; using MediaBrowser.Model.Events; +using MediaBrowser.Model.Services; namespace MediaBrowser.Controller.Net { diff --git a/MediaBrowser.Controller/Net/ISessionContext.cs b/MediaBrowser.Controller/Net/ISessionContext.cs index 40e76c252..b9ee371b2 100644 --- a/MediaBrowser.Controller/Net/ISessionContext.cs +++ b/MediaBrowser.Controller/Net/ISessionContext.cs @@ -1,6 +1,5 @@ using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Session; -using System.Threading.Tasks; using MediaBrowser.Model.Services; namespace MediaBrowser.Controller.Net diff --git a/MediaBrowser.Controller/Net/IWebSocketConnection.cs b/MediaBrowser.Controller/Net/IWebSocketConnection.cs index 816e9afca..824b8f44c 100644 --- a/MediaBrowser.Controller/Net/IWebSocketConnection.cs +++ b/MediaBrowser.Controller/Net/IWebSocketConnection.cs @@ -1,9 +1,9 @@ -using MediaBrowser.Model.Net; -using MediaBrowser.Model.Services; +using System; using System.Net.WebSockets; -using System.Threading.Tasks; using System.Threading; -using System; +using System.Threading.Tasks; +using MediaBrowser.Model.Net; +using MediaBrowser.Model.Services; namespace MediaBrowser.Controller.Net { diff --git a/MediaBrowser.Controller/Notifications/INotificationManager.cs b/MediaBrowser.Controller/Notifications/INotificationManager.cs index 161f0ffba..23fa36239 100644 --- a/MediaBrowser.Controller/Notifications/INotificationManager.cs +++ b/MediaBrowser.Controller/Notifications/INotificationManager.cs @@ -1,9 +1,9 @@ -using MediaBrowser.Controller.Entities; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using MediaBrowser.Controller.Entities; using MediaBrowser.Model.Dto; using MediaBrowser.Model.Notifications; -using System.Collections.Generic; -using System.Threading.Tasks; -using System.Threading; namespace MediaBrowser.Controller.Notifications { diff --git a/MediaBrowser.Controller/Notifications/INotificationService.cs b/MediaBrowser.Controller/Notifications/INotificationService.cs index b1e313b87..a9cf41de2 100644 --- a/MediaBrowser.Controller/Notifications/INotificationService.cs +++ b/MediaBrowser.Controller/Notifications/INotificationService.cs @@ -1,6 +1,6 @@ -using MediaBrowser.Controller.Entities; -using System.Threading; +using System.Threading; using System.Threading.Tasks; +using MediaBrowser.Controller.Entities; namespace MediaBrowser.Controller.Notifications { diff --git a/MediaBrowser.Controller/Notifications/INotificationTypeFactory.cs b/MediaBrowser.Controller/Notifications/INotificationTypeFactory.cs index bf92aae2d..43b18101c 100644 --- a/MediaBrowser.Controller/Notifications/INotificationTypeFactory.cs +++ b/MediaBrowser.Controller/Notifications/INotificationTypeFactory.cs @@ -1,5 +1,5 @@ -using MediaBrowser.Model.Notifications; -using System.Collections.Generic; +using System.Collections.Generic; +using MediaBrowser.Model.Notifications; namespace MediaBrowser.Controller.Notifications { diff --git a/MediaBrowser.Controller/Notifications/UserNotification.cs b/MediaBrowser.Controller/Notifications/UserNotification.cs index d035a3995..6f71fb79c 100644 --- a/MediaBrowser.Controller/Notifications/UserNotification.cs +++ b/MediaBrowser.Controller/Notifications/UserNotification.cs @@ -1,6 +1,6 @@ -using MediaBrowser.Controller.Entities; +using System; +using MediaBrowser.Controller.Entities; using MediaBrowser.Model.Notifications; -using System; namespace MediaBrowser.Controller.Notifications { diff --git a/MediaBrowser.Controller/Persistence/IDisplayPreferencesRepository.cs b/MediaBrowser.Controller/Persistence/IDisplayPreferencesRepository.cs index 25aba6bd9..7763db828 100644 --- a/MediaBrowser.Controller/Persistence/IDisplayPreferencesRepository.cs +++ b/MediaBrowser.Controller/Persistence/IDisplayPreferencesRepository.cs @@ -1,7 +1,7 @@ -using System.Collections.Generic; -using MediaBrowser.Model.Entities; -using System; +using System; +using System.Collections.Generic; using System.Threading; +using MediaBrowser.Model.Entities; namespace MediaBrowser.Controller.Persistence { diff --git a/MediaBrowser.Controller/Persistence/IItemRepository.cs b/MediaBrowser.Controller/Persistence/IItemRepository.cs index 7905ea1aa..e1d886861 100644 --- a/MediaBrowser.Controller/Persistence/IItemRepository.cs +++ b/MediaBrowser.Controller/Persistence/IItemRepository.cs @@ -1,9 +1,9 @@ -using MediaBrowser.Controller.Entities; -using MediaBrowser.Model.Entities; -using System; +using System; using System.Collections.Generic; using System.Threading; +using MediaBrowser.Controller.Entities; using MediaBrowser.Model.Dto; +using MediaBrowser.Model.Entities; using MediaBrowser.Model.Querying; namespace MediaBrowser.Controller.Persistence diff --git a/MediaBrowser.Controller/Persistence/IUserDataRepository.cs b/MediaBrowser.Controller/Persistence/IUserDataRepository.cs index 5ab3f0943..acb9159ab 100644 --- a/MediaBrowser.Controller/Persistence/IUserDataRepository.cs +++ b/MediaBrowser.Controller/Persistence/IUserDataRepository.cs @@ -1,7 +1,6 @@ using System.Collections.Generic; -using MediaBrowser.Controller.Entities; -using System; using System.Threading; +using MediaBrowser.Controller.Entities; namespace MediaBrowser.Controller.Persistence { diff --git a/MediaBrowser.Controller/Persistence/IUserRepository.cs b/MediaBrowser.Controller/Persistence/IUserRepository.cs index 7d56924b6..cd23e5223 100644 --- a/MediaBrowser.Controller/Persistence/IUserRepository.cs +++ b/MediaBrowser.Controller/Persistence/IUserRepository.cs @@ -1,6 +1,5 @@ -using MediaBrowser.Controller.Entities; using System.Collections.Generic; -using System.Threading; +using MediaBrowser.Controller.Entities; namespace MediaBrowser.Controller.Persistence { diff --git a/MediaBrowser.Controller/Persistence/MediaStreamQuery.cs b/MediaBrowser.Controller/Persistence/MediaStreamQuery.cs index 10985f57d..5758208ba 100644 --- a/MediaBrowser.Controller/Persistence/MediaStreamQuery.cs +++ b/MediaBrowser.Controller/Persistence/MediaStreamQuery.cs @@ -1,5 +1,5 @@ -using MediaBrowser.Model.Entities; -using System; +using System; +using MediaBrowser.Model.Entities; namespace MediaBrowser.Controller.Persistence { diff --git a/MediaBrowser.Controller/Playlists/IPlaylistManager.cs b/MediaBrowser.Controller/Playlists/IPlaylistManager.cs index d481bf7c5..e6f37de33 100644 --- a/MediaBrowser.Controller/Playlists/IPlaylistManager.cs +++ b/MediaBrowser.Controller/Playlists/IPlaylistManager.cs @@ -1,8 +1,8 @@ -using MediaBrowser.Controller.Entities; -using MediaBrowser.Model.Playlists; +using System; using System.Collections.Generic; using System.Threading.Tasks; -using System; +using MediaBrowser.Controller.Entities; +using MediaBrowser.Model.Playlists; namespace MediaBrowser.Controller.Playlists { diff --git a/MediaBrowser.Controller/Playlists/Playlist.cs b/MediaBrowser.Controller/Playlists/Playlist.cs index 642dfde80..33d7b3b3d 100644 --- a/MediaBrowser.Controller/Playlists/Playlist.cs +++ b/MediaBrowser.Controller/Playlists/Playlist.cs @@ -1,15 +1,15 @@ -using MediaBrowser.Controller.Entities; -using MediaBrowser.Controller.Entities.Audio; -using MediaBrowser.Model.Entities; -using MediaBrowser.Model.Querying; -using System; +using System; using System.Collections.Generic; using System.Linq; -using MediaBrowser.Model.Serialization; +using System.Threading; using System.Threading.Tasks; using MediaBrowser.Controller.Dto; +using MediaBrowser.Controller.Entities; +using MediaBrowser.Controller.Entities.Audio; using MediaBrowser.Controller.Providers; -using System.Threading; +using MediaBrowser.Model.Entities; +using MediaBrowser.Model.Querying; +using MediaBrowser.Model.Serialization; namespace MediaBrowser.Controller.Playlists { diff --git a/MediaBrowser.Controller/Plugins/IPluginConfigurationPage.cs b/MediaBrowser.Controller/Plugins/IPluginConfigurationPage.cs index 5feaf798c..40f940d99 100644 --- a/MediaBrowser.Controller/Plugins/IPluginConfigurationPage.cs +++ b/MediaBrowser.Controller/Plugins/IPluginConfigurationPage.cs @@ -1,5 +1,5 @@ -using MediaBrowser.Common.Plugins; -using System.IO; +using System.IO; +using MediaBrowser.Common.Plugins; namespace MediaBrowser.Controller.Plugins { diff --git a/MediaBrowser.Controller/Providers/DirectoryService.cs b/MediaBrowser.Controller/Providers/DirectoryService.cs index 9bb2f5bed..02e65bdfd 100644 --- a/MediaBrowser.Controller/Providers/DirectoryService.cs +++ b/MediaBrowser.Controller/Providers/DirectoryService.cs @@ -1,8 +1,8 @@ -using Microsoft.Extensions.Logging; -using System; +using System; using System.Collections.Generic; using System.Linq; using MediaBrowser.Model.IO; +using Microsoft.Extensions.Logging; namespace MediaBrowser.Controller.Providers { diff --git a/MediaBrowser.Controller/Providers/ICustomMetadataProvider.cs b/MediaBrowser.Controller/Providers/ICustomMetadataProvider.cs index af1838d74..a79d59314 100644 --- a/MediaBrowser.Controller/Providers/ICustomMetadataProvider.cs +++ b/MediaBrowser.Controller/Providers/ICustomMetadataProvider.cs @@ -1,7 +1,7 @@ -using MediaBrowser.Controller.Entities; -using MediaBrowser.Controller.Library; -using System.Threading; +using System.Threading; using System.Threading.Tasks; +using MediaBrowser.Controller.Entities; +using MediaBrowser.Controller.Library; namespace MediaBrowser.Controller.Providers { diff --git a/MediaBrowser.Controller/Providers/IImageEnhancer.cs b/MediaBrowser.Controller/Providers/IImageEnhancer.cs index c8ea25335..579dc023b 100644 --- a/MediaBrowser.Controller/Providers/IImageEnhancer.cs +++ b/MediaBrowser.Controller/Providers/IImageEnhancer.cs @@ -1,7 +1,7 @@ -using MediaBrowser.Controller.Entities; +using System.Threading.Tasks; +using MediaBrowser.Controller.Entities; using MediaBrowser.Model.Drawing; using MediaBrowser.Model.Entities; -using System.Threading.Tasks; namespace MediaBrowser.Controller.Providers { diff --git a/MediaBrowser.Controller/Providers/ILocalMetadataProvider.cs b/MediaBrowser.Controller/Providers/ILocalMetadataProvider.cs index 68f1ae589..54b3a36aa 100644 --- a/MediaBrowser.Controller/Providers/ILocalMetadataProvider.cs +++ b/MediaBrowser.Controller/Providers/ILocalMetadataProvider.cs @@ -1,6 +1,6 @@ -using MediaBrowser.Controller.Entities; -using System.Threading; +using System.Threading; using System.Threading.Tasks; +using MediaBrowser.Controller.Entities; namespace MediaBrowser.Controller.Providers { diff --git a/MediaBrowser.Controller/Providers/IMetadataService.cs b/MediaBrowser.Controller/Providers/IMetadataService.cs index 1c9c4b71a..361004d15 100644 --- a/MediaBrowser.Controller/Providers/IMetadataService.cs +++ b/MediaBrowser.Controller/Providers/IMetadataService.cs @@ -1,8 +1,8 @@ using System; -using MediaBrowser.Controller.Entities; -using MediaBrowser.Controller.Library; using System.Threading; using System.Threading.Tasks; +using MediaBrowser.Controller.Entities; +using MediaBrowser.Controller.Library; namespace MediaBrowser.Controller.Providers { diff --git a/MediaBrowser.Controller/Providers/IProviderManager.cs b/MediaBrowser.Controller/Providers/IProviderManager.cs index f1930ee2f..0bc012ca0 100644 --- a/MediaBrowser.Controller/Providers/IProviderManager.cs +++ b/MediaBrowser.Controller/Providers/IProviderManager.cs @@ -1,15 +1,15 @@ -using MediaBrowser.Common.Net; -using MediaBrowser.Controller.Entities; -using MediaBrowser.Controller.Library; -using MediaBrowser.Model.Configuration; -using MediaBrowser.Model.Entities; -using MediaBrowser.Model.Providers; -using System; +using System; using System.Collections.Generic; using System.IO; using System.Threading; using System.Threading.Tasks; +using MediaBrowser.Common.Net; +using MediaBrowser.Controller.Entities; +using MediaBrowser.Controller.Library; +using MediaBrowser.Model.Configuration; +using MediaBrowser.Model.Entities; using MediaBrowser.Model.Events; +using MediaBrowser.Model.Providers; namespace MediaBrowser.Controller.Providers { diff --git a/MediaBrowser.Controller/Providers/IRemoteImageProvider.cs b/MediaBrowser.Controller/Providers/IRemoteImageProvider.cs index 32f51c650..e8faa9b85 100644 --- a/MediaBrowser.Controller/Providers/IRemoteImageProvider.cs +++ b/MediaBrowser.Controller/Providers/IRemoteImageProvider.cs @@ -1,10 +1,10 @@ -using MediaBrowser.Common.Net; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using MediaBrowser.Common.Net; using MediaBrowser.Controller.Entities; using MediaBrowser.Model.Entities; using MediaBrowser.Model.Providers; -using System.Collections.Generic; -using System.Threading; -using System.Threading.Tasks; namespace MediaBrowser.Controller.Providers { diff --git a/MediaBrowser.Controller/Providers/IRemoteMetadataProvider.cs b/MediaBrowser.Controller/Providers/IRemoteMetadataProvider.cs index 695d488ed..4bea8886a 100644 --- a/MediaBrowser.Controller/Providers/IRemoteMetadataProvider.cs +++ b/MediaBrowser.Controller/Providers/IRemoteMetadataProvider.cs @@ -1,8 +1,8 @@ -using MediaBrowser.Controller.Entities; -using MediaBrowser.Model.Providers; -using System.Collections.Generic; +using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; +using MediaBrowser.Controller.Entities; +using MediaBrowser.Model.Providers; namespace MediaBrowser.Controller.Providers { diff --git a/MediaBrowser.Controller/Providers/ImageRefreshOptions.cs b/MediaBrowser.Controller/Providers/ImageRefreshOptions.cs index 6cc8a691e..aac41369c 100644 --- a/MediaBrowser.Controller/Providers/ImageRefreshOptions.cs +++ b/MediaBrowser.Controller/Providers/ImageRefreshOptions.cs @@ -1,7 +1,6 @@ -using System.Collections.Generic; -using MediaBrowser.Model.Entities; using System; using System.Linq; +using MediaBrowser.Model.Entities; namespace MediaBrowser.Controller.Providers { diff --git a/MediaBrowser.Controller/Providers/ItemLookupInfo.cs b/MediaBrowser.Controller/Providers/ItemLookupInfo.cs index dc7a04135..93eb8bbd1 100644 --- a/MediaBrowser.Controller/Providers/ItemLookupInfo.cs +++ b/MediaBrowser.Controller/Providers/ItemLookupInfo.cs @@ -1,6 +1,6 @@ -using MediaBrowser.Model.Entities; -using System; +using System; using System.Collections.Generic; +using MediaBrowser.Model.Entities; namespace MediaBrowser.Controller.Providers { diff --git a/MediaBrowser.Controller/Providers/LocalImageInfo.cs b/MediaBrowser.Controller/Providers/LocalImageInfo.cs index 5e6efe9f6..086ca6828 100644 --- a/MediaBrowser.Controller/Providers/LocalImageInfo.cs +++ b/MediaBrowser.Controller/Providers/LocalImageInfo.cs @@ -1,5 +1,3 @@ - -using MediaBrowser.Controller.IO; using MediaBrowser.Model.Entities; using MediaBrowser.Model.IO; diff --git a/MediaBrowser.Controller/Providers/MetadataRefreshOptions.cs b/MediaBrowser.Controller/Providers/MetadataRefreshOptions.cs index 3dbcc5305..259c413cc 100644 --- a/MediaBrowser.Controller/Providers/MetadataRefreshOptions.cs +++ b/MediaBrowser.Controller/Providers/MetadataRefreshOptions.cs @@ -1,8 +1,6 @@ using System; using System.Linq; using MediaBrowser.Controller.Entities; -using MediaBrowser.Model.IO; -using Microsoft.Extensions.Logging; using MediaBrowser.Model.Providers; namespace MediaBrowser.Controller.Providers diff --git a/MediaBrowser.Controller/Providers/MetadataResult.cs b/MediaBrowser.Controller/Providers/MetadataResult.cs index 271f784d7..f4b915c06 100644 --- a/MediaBrowser.Controller/Providers/MetadataResult.cs +++ b/MediaBrowser.Controller/Providers/MetadataResult.cs @@ -1,6 +1,6 @@ -using MediaBrowser.Controller.Entities; using System; using System.Collections.Generic; +using MediaBrowser.Controller.Entities; namespace MediaBrowser.Controller.Providers { diff --git a/MediaBrowser.Controller/Resolvers/IItemResolver.cs b/MediaBrowser.Controller/Resolvers/IItemResolver.cs index 298ec248a..9b063771a 100644 --- a/MediaBrowser.Controller/Resolvers/IItemResolver.cs +++ b/MediaBrowser.Controller/Resolvers/IItemResolver.cs @@ -1,9 +1,7 @@ -using MediaBrowser.Controller.Entities; +using System.Collections.Generic; +using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Library; using MediaBrowser.Controller.Providers; -using System.Collections.Generic; - -using MediaBrowser.Controller.IO; using MediaBrowser.Model.IO; namespace MediaBrowser.Controller.Resolvers diff --git a/MediaBrowser.Controller/Resolvers/IResolverIgnoreRule.cs b/MediaBrowser.Controller/Resolvers/IResolverIgnoreRule.cs index 25537193a..40b11887a 100644 --- a/MediaBrowser.Controller/Resolvers/IResolverIgnoreRule.cs +++ b/MediaBrowser.Controller/Resolvers/IResolverIgnoreRule.cs @@ -1,6 +1,5 @@  using MediaBrowser.Controller.Entities; -using MediaBrowser.Controller.IO; using MediaBrowser.Model.IO; namespace MediaBrowser.Controller.Resolvers diff --git a/MediaBrowser.Controller/Security/AuthenticationInfo.cs b/MediaBrowser.Controller/Security/AuthenticationInfo.cs index ecb3866d0..9383c8dcf 100644 --- a/MediaBrowser.Controller/Security/AuthenticationInfo.cs +++ b/MediaBrowser.Controller/Security/AuthenticationInfo.cs @@ -65,6 +65,6 @@ namespace MediaBrowser.Controller.Security public DateTime? DateRevoked { get; set; } public DateTime DateLastActivity { get; set; } - public string UserName { get; set;} + public string UserName { get; set; } } } diff --git a/MediaBrowser.Controller/Security/IAuthenticationRepository.cs b/MediaBrowser.Controller/Security/IAuthenticationRepository.cs index 4f454f895..6a9625613 100644 --- a/MediaBrowser.Controller/Security/IAuthenticationRepository.cs +++ b/MediaBrowser.Controller/Security/IAuthenticationRepository.cs @@ -1,6 +1,5 @@ using MediaBrowser.Model.Devices; using MediaBrowser.Model.Querying; -using System.Threading; namespace MediaBrowser.Controller.Security { diff --git a/MediaBrowser.Controller/Session/ISessionManager.cs b/MediaBrowser.Controller/Session/ISessionManager.cs index 1b51ddc16..317237cf1 100644 --- a/MediaBrowser.Controller/Session/ISessionManager.cs +++ b/MediaBrowser.Controller/Session/ISessionManager.cs @@ -1,14 +1,14 @@ -using MediaBrowser.Controller.Authentication; +using System; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using MediaBrowser.Controller.Authentication; using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Library; using MediaBrowser.Controller.Security; using MediaBrowser.Model.Dto; using MediaBrowser.Model.Events; using MediaBrowser.Model.Session; -using System; -using System.Collections.Generic; -using System.Threading; -using System.Threading.Tasks; namespace MediaBrowser.Controller.Session { diff --git a/MediaBrowser.Controller/Session/SessionInfo.cs b/MediaBrowser.Controller/Session/SessionInfo.cs index 77e786ead..d698795dd 100644 --- a/MediaBrowser.Controller/Session/SessionInfo.cs +++ b/MediaBrowser.Controller/Session/SessionInfo.cs @@ -1,11 +1,11 @@ +using System; +using System.Linq; using MediaBrowser.Controller.Entities; using MediaBrowser.Model.Dto; using MediaBrowser.Model.Serialization; using MediaBrowser.Model.Session; -using System; -using Microsoft.Extensions.Logging; using MediaBrowser.Model.Threading; -using System.Linq; +using Microsoft.Extensions.Logging; namespace MediaBrowser.Controller.Session { @@ -142,7 +142,7 @@ namespace MediaBrowser.Controller.Session { if (Capabilities == null) { - return new string[] {}; + return new string[] { }; } return Capabilities.SupportedCommands; } diff --git a/MediaBrowser.Controller/Sorting/IBaseItemComparer.cs b/MediaBrowser.Controller/Sorting/IBaseItemComparer.cs index 6d0b95bcb..2421ac507 100644 --- a/MediaBrowser.Controller/Sorting/IBaseItemComparer.cs +++ b/MediaBrowser.Controller/Sorting/IBaseItemComparer.cs @@ -1,5 +1,5 @@ -using MediaBrowser.Controller.Entities; -using System.Collections.Generic; +using System.Collections.Generic; +using MediaBrowser.Controller.Entities; namespace MediaBrowser.Controller.Sorting { diff --git a/MediaBrowser.Controller/Subtitles/ISubtitleManager.cs b/MediaBrowser.Controller/Subtitles/ISubtitleManager.cs index e41826be5..a70a005d8 100644 --- a/MediaBrowser.Controller/Subtitles/ISubtitleManager.cs +++ b/MediaBrowser.Controller/Subtitles/ISubtitleManager.cs @@ -1,10 +1,10 @@ -using MediaBrowser.Controller.Entities; -using MediaBrowser.Model.Providers; -using System; +using System; using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; +using MediaBrowser.Controller.Entities; using MediaBrowser.Model.Configuration; +using MediaBrowser.Model.Providers; namespace MediaBrowser.Controller.Subtitles { diff --git a/MediaBrowser.Controller/Subtitles/ISubtitleProvider.cs b/MediaBrowser.Controller/Subtitles/ISubtitleProvider.cs index 2502d685d..3a0e17d63 100644 --- a/MediaBrowser.Controller/Subtitles/ISubtitleProvider.cs +++ b/MediaBrowser.Controller/Subtitles/ISubtitleProvider.cs @@ -1,9 +1,8 @@ -using MediaBrowser.Controller.Providers; -using MediaBrowser.Model.Dto; -using MediaBrowser.Model.Providers; -using System.Collections.Generic; +using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; +using MediaBrowser.Controller.Providers; +using MediaBrowser.Model.Providers; namespace MediaBrowser.Controller.Subtitles { diff --git a/MediaBrowser.Controller/Subtitles/SubtitleSearchRequest.cs b/MediaBrowser.Controller/Subtitles/SubtitleSearchRequest.cs index daef6db79..b0423d278 100644 --- a/MediaBrowser.Controller/Subtitles/SubtitleSearchRequest.cs +++ b/MediaBrowser.Controller/Subtitles/SubtitleSearchRequest.cs @@ -1,7 +1,7 @@ -using MediaBrowser.Controller.Providers; -using MediaBrowser.Model.Entities; -using System; +using System; using System.Collections.Generic; +using MediaBrowser.Controller.Providers; +using MediaBrowser.Model.Entities; namespace MediaBrowser.Controller.Subtitles { diff --git a/MediaBrowser.Controller/Sync/IHasDynamicAccess.cs b/MediaBrowser.Controller/Sync/IHasDynamicAccess.cs index cf868a381..eac8cac6a 100644 --- a/MediaBrowser.Controller/Sync/IHasDynamicAccess.cs +++ b/MediaBrowser.Controller/Sync/IHasDynamicAccess.cs @@ -1,6 +1,6 @@ -using MediaBrowser.Model.Sync; -using System.Threading; +using System.Threading; using System.Threading.Tasks; +using MediaBrowser.Model.Sync; namespace MediaBrowser.Controller.Sync { diff --git a/MediaBrowser.Controller/Sync/IServerSyncProvider.cs b/MediaBrowser.Controller/Sync/IServerSyncProvider.cs index 335fea296..a7f6e7976 100644 --- a/MediaBrowser.Controller/Sync/IServerSyncProvider.cs +++ b/MediaBrowser.Controller/Sync/IServerSyncProvider.cs @@ -1,11 +1,10 @@ -using MediaBrowser.Model.Querying; -using MediaBrowser.Model.Sync; -using System; +using System; using System.IO; using System.Threading; using System.Threading.Tasks; using MediaBrowser.Model.IO; -using MediaBrowser.Controller.Entities; +using MediaBrowser.Model.Querying; +using MediaBrowser.Model.Sync; namespace MediaBrowser.Controller.Sync { diff --git a/MediaBrowser.Controller/Sync/ISyncProvider.cs b/MediaBrowser.Controller/Sync/ISyncProvider.cs index 0b2fcc95e..1a911ad65 100644 --- a/MediaBrowser.Controller/Sync/ISyncProvider.cs +++ b/MediaBrowser.Controller/Sync/ISyncProvider.cs @@ -1,5 +1,5 @@ -using MediaBrowser.Model.Sync; -using System.Collections.Generic; +using System.Collections.Generic; +using MediaBrowser.Model.Sync; namespace MediaBrowser.Controller.Sync { diff --git a/MediaBrowser.Controller/Sync/SyncedFileInfo.cs b/MediaBrowser.Controller/Sync/SyncedFileInfo.cs index 1c87551f1..885a94253 100644 --- a/MediaBrowser.Controller/Sync/SyncedFileInfo.cs +++ b/MediaBrowser.Controller/Sync/SyncedFileInfo.cs @@ -1,5 +1,5 @@ -using MediaBrowser.Model.MediaInfo; -using System.Collections.Generic; +using System.Collections.Generic; +using MediaBrowser.Model.MediaInfo; namespace MediaBrowser.Controller.Sync { diff --git a/MediaBrowser.Controller/TV/ITVSeriesManager.cs b/MediaBrowser.Controller/TV/ITVSeriesManager.cs index 56e06bcfa..f8e4475f0 100644 --- a/MediaBrowser.Controller/TV/ITVSeriesManager.cs +++ b/MediaBrowser.Controller/TV/ITVSeriesManager.cs @@ -1,7 +1,6 @@ -using MediaBrowser.Controller.Entities; +using MediaBrowser.Controller.Dto; +using MediaBrowser.Controller.Entities; using MediaBrowser.Model.Querying; -using System.Collections.Generic; -using MediaBrowser.Controller.Dto; namespace MediaBrowser.Controller.TV { -- cgit v1.2.3 From a36658f6f0ed342d8b55dbf7c9ff95fe3abfa818 Mon Sep 17 00:00:00 2001 From: Erwin de Haan Date: Sun, 13 Jan 2019 21:31:14 +0100 Subject: ReSharper Reformat: Properties to expression bodied form. --- BDInfo/BDInfoSettings.cs | 96 ++-------- BDInfo/TSStream.cs | 31 +--- BDInfo/TSStreamBuffer.cs | 16 +- BDInfo/TSStreamClip.cs | 8 +- Emby.Dlna/Api/DlnaServerService.cs | 24 +-- Emby.Dlna/Didl/StringWriterWithEncoding.cs | 5 +- Emby.Dlna/DlnaManager.cs | 16 +- Emby.Dlna/Eventing/EventSubscription.cs | 8 +- Emby.Dlna/PlayTo/Device.cs | 39 +---- Emby.Dlna/PlayTo/DeviceInfo.cs | 18 +- Emby.Dlna/PlayTo/PlayToController.cs | 21 +-- Emby.Dlna/PlayTo/TransportCommands.cs | 20 +-- Emby.Drawing.Skia/SkiaEncoder.cs | 79 +++------ Emby.Drawing/ImageProcessor.cs | 101 +++++------ Emby.Drawing/NullImageEncoder.cs | 40 ++--- Emby.IsoMounting/IsoMounter/LinuxIsoManager.cs | 23 +-- Emby.IsoMounting/IsoMounter/Plugin.cs | 18 +- Emby.Naming/Common/EpisodeExpression.cs | 11 +- Emby.Naming/Video/VideoFileInfo.cs | 5 +- Emby.Photos/PhotoProvider.cs | 5 +- .../Data/SqliteItemRepository.cs | 24 +-- Jellyfin.Server/CoreAppHost.cs | 17 +- Jellyfin.Server/SocketSharp/RequestMono.cs | 75 ++------ Jellyfin.Server/SocketSharp/SharpWebSocket.cs | 8 +- .../SocketSharp/WebSocketSharpRequest.cs | 170 ++++-------------- .../SocketSharp/WebSocketSharpResponse.cs | 34 ++-- MediaBrowser.Api/BaseApiService.cs | 16 +- MediaBrowser.Api/LiveTv/ProgressiveFileCopier.cs | 8 +- MediaBrowser.Api/Playback/BaseStreamingService.cs | 5 +- MediaBrowser.Api/Playback/Hls/BaseHlsService.cs | 5 +- .../Progressive/BaseProgressiveStreamingService.cs | 5 +- .../Progressive/ProgressiveStreamWriter.cs | 8 +- .../Playback/StaticRemoteStreamWriter.cs | 5 +- MediaBrowser.Api/Playback/StreamRequest.cs | 8 +- MediaBrowser.Api/Playback/StreamState.cs | 20 +-- .../ScheduledTasksWebSocketListener.cs | 5 +- .../Session/SessionInfoWebSocketListener.cs | 5 +- .../System/ActivityLogWebSocketListener.cs | 5 +- MediaBrowser.Common/Net/HttpRequestOptions.cs | 14 +- MediaBrowser.Common/Plugins/BasePlugin.cs | 41 +---- MediaBrowser.Controller/Channels/Channel.cs | 13 +- .../Entities/AggregateFolder.cs | 26 +-- MediaBrowser.Controller/Entities/Audio/Audio.cs | 52 +----- .../Entities/Audio/MusicAlbum.cs | 49 +----- .../Entities/Audio/MusicArtist.cs | 66 +------ .../Entities/Audio/MusicGenre.cs | 37 +--- MediaBrowser.Controller/Entities/AudioBook.cs | 16 +- MediaBrowser.Controller/Entities/BaseItem.cs | 195 ++++----------------- .../Entities/BasePluginFolder.cs | 21 +-- MediaBrowser.Controller/Entities/Book.cs | 8 +- .../Entities/CollectionFolder.cs | 45 +---- MediaBrowser.Controller/Entities/Folder.cs | 97 ++-------- MediaBrowser.Controller/Entities/Game.cs | 15 +- MediaBrowser.Controller/Entities/GameGenre.cs | 24 +-- MediaBrowser.Controller/Entities/GameSystem.cs | 32 +--- MediaBrowser.Controller/Entities/Genre.cs | 32 +--- MediaBrowser.Controller/Entities/Movies/BoxSet.cs | 29 +-- MediaBrowser.Controller/Entities/Movies/Movie.cs | 13 +- MediaBrowser.Controller/Entities/MusicVideo.cs | 8 +- MediaBrowser.Controller/Entities/Person.cs | 32 +--- MediaBrowser.Controller/Entities/Photo.cs | 24 +-- MediaBrowser.Controller/Entities/PhotoAlbum.cs | 24 +-- MediaBrowser.Controller/Entities/Studio.cs | 32 +--- MediaBrowser.Controller/Entities/TV/Episode.cs | 66 +------ MediaBrowser.Controller/Entities/TV/Season.cs | 36 +--- MediaBrowser.Controller/Entities/TV/Series.cs | 43 +---- MediaBrowser.Controller/Entities/Trailer.cs | 9 +- MediaBrowser.Controller/Entities/User.cs | 62 ++----- MediaBrowser.Controller/Entities/UserItemData.cs | 5 +- MediaBrowser.Controller/Entities/UserRootFolder.cs | 32 +--- MediaBrowser.Controller/Entities/UserView.cs | 32 +--- MediaBrowser.Controller/Entities/Video.cs | 62 ++----- MediaBrowser.Controller/Entities/Year.cs | 24 +-- MediaBrowser.Controller/Library/ItemResolveArgs.cs | 16 +- MediaBrowser.Controller/LiveTv/LiveTvChannel.cs | 46 +---- MediaBrowser.Controller/LiveTv/LiveTvProgram.cs | 61 +------ MediaBrowser.Controller/LiveTv/TimerInfo.cs | 42 +---- .../MediaEncoding/EncodingJobInfo.cs | 74 ++------ .../MediaEncoding/EncodingJobOptions.cs | 8 +- .../Net/AuthenticatedAttribute.cs | 5 +- MediaBrowser.Controller/Net/AuthorizationInfo.cs | 8 +- .../Net/BasePeriodicWebSocketListener.cs | 8 +- MediaBrowser.Controller/Playlists/Playlist.cs | 64 +------ .../Resolvers/BaseItemResolver.cs | 8 +- MediaBrowser.LocalMetadata/BaseXmlProvider.cs | 25 +-- .../Images/CollectionFolderImageProvider.cs | 14 +- .../Images/EpisodeLocalImageProvider.cs | 10 +- .../Images/InternalMetadataFolderImageProvider.cs | 14 +- .../Images/LocalImageProvider.cs | 10 +- MediaBrowser.LocalMetadata/Savers/BaseXmlSaver.cs | 16 +- MediaBrowser.MediaEncoding/Encoder/AudioEncoder.cs | 6 +- MediaBrowser.MediaEncoding/Encoder/EncodingJob.cs | 4 +- MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs | 5 +- MediaBrowser.MediaEncoding/Encoder/VideoEncoder.cs | 6 +- .../Subtitles/OpenSubtitleDownloader.cs | 5 +- .../Subtitles/SubtitleEncoder.cs | 8 +- MediaBrowser.Model/Dlna/SortCriteria.cs | 5 +- MediaBrowser.Model/Dlna/StreamInfo.cs | 27 +-- MediaBrowser.Model/Drawing/ImageSize.cs | 14 +- MediaBrowser.Model/Dto/BaseItemPerson.cs | 8 +- MediaBrowser.Model/Entities/LibraryUpdateInfo.cs | 8 +- .../Services/QueryParamCollection.cs | 36 +--- MediaBrowser.Model/Updates/CheckForUpdateResult.cs | 2 +- MediaBrowser.Model/Updates/PackageVersionInfo.cs | 5 +- .../BoxSets/BoxSetMetadataService.cs | 32 +--- .../BoxSets/MovieDbBoxSetImageProvider.cs | 15 +- .../BoxSets/MovieDbBoxSetProvider.cs | 5 +- .../Folders/FolderMetadataService.cs | 9 +- .../Manager/GenericPriorityQueue.cs | 16 +- MediaBrowser.Providers/Manager/MetadataService.cs | 43 +---- .../MediaInfo/AudioImageProvider.cs | 13 +- .../MediaInfo/FFProbeProvider.cs | 14 +- .../MediaInfo/SubtitleScheduledTask.cs | 20 +-- .../MediaInfo/VideoImageProvider.cs | 14 +- .../Movies/FanartMovieImageProvider.cs | 15 +- .../Movies/MovieDbImageProvider.cs | 15 +- MediaBrowser.Providers/Movies/MovieDbProvider.cs | 13 +- .../Movies/MovieDbTrailerProvider.cs | 13 +- MediaBrowser.Providers/Movies/MovieExternalIds.cs | 105 +++-------- .../Music/AlbumMetadataService.cs | 24 +-- .../Music/ArtistMetadataService.cs | 8 +- .../Music/AudioDbAlbumImageProvider.cs | 14 +- .../Music/AudioDbAlbumProvider.cs | 14 +- .../Music/AudioDbArtistImageProvider.cs | 14 +- .../Music/AudioDbArtistProvider.cs | 14 +- MediaBrowser.Providers/Music/AudioDbExternalIds.cs | 60 ++----- .../Music/FanArtAlbumProvider.cs | 19 +- .../Music/FanArtArtistProvider.cs | 15 +- .../Music/MovieDbMusicVideoProvider.cs | 5 +- .../Music/MusicBrainzAlbumProvider.cs | 10 +- .../Music/MusicBrainzArtistProvider.cs | 5 +- MediaBrowser.Providers/Music/MusicExternalIds.cs | 105 +++-------- MediaBrowser.Providers/Omdb/OmdbImageProvider.cs | 15 +- MediaBrowser.Providers/Omdb/OmdbItemProvider.cs | 14 +- .../People/MovieDbPersonImageProvider.cs | 15 +- .../People/MovieDbPersonProvider.cs | 5 +- .../People/TvdbPersonImageProvider.cs | 15 +- .../Playlists/PlaylistItemsProvider.cs | 14 +- .../Playlists/PlaylistMetadataService.cs | 24 +-- .../Studios/StudiosImageProvider.cs | 10 +- .../TV/FanArt/FanArtSeasonProvider.cs | 15 +- .../TV/FanArt/FanartSeriesProvider.cs | 15 +- .../TV/Omdb/OmdbEpisodeProvider.cs | 14 +- MediaBrowser.Providers/TV/SeasonMetadataService.cs | 8 +- .../TV/TheMovieDb/MovieDbEpisodeImageProvider.cs | 14 +- .../TV/TheMovieDb/MovieDbEpisodeProvider.cs | 14 +- .../TV/TheMovieDb/MovieDbProviderBase.cs | 5 +- .../TV/TheMovieDb/MovieDbSeasonProvider.cs | 5 +- .../TV/TheMovieDb/MovieDbSeriesImageProvider.cs | 19 +- .../TV/TheMovieDb/MovieDbSeriesProvider.cs | 14 +- .../TV/TheTVDB/TvdbEpisodeImageProvider.cs | 10 +- .../TV/TheTVDB/TvdbEpisodeProvider.cs | 7 +- .../TV/TheTVDB/TvdbSeasonImageProvider.cs | 15 +- .../TV/TheTVDB/TvdbSeriesImageProvider.cs | 15 +- .../TV/TheTVDB/TvdbSeriesProvider.cs | 13 +- MediaBrowser.Providers/TV/TvExternalIds.cs | 60 ++----- .../Videos/VideoMetadataService.cs | 9 +- MediaBrowser.XbmcMetadata/Parsers/BaseNfoParser.cs | 10 +- .../Parsers/MovieNfoParser.cs | 8 +- .../Parsers/SeriesNfoParser.cs | 13 +- .../Providers/BaseNfoProvider.cs | 8 +- MediaBrowser.XbmcMetadata/Savers/BaseNfoSaver.cs | 16 +- SocketHttpListener/CloseEventArgs.cs | 26 +-- SocketHttpListener/ErrorEventArgs.cs | 8 +- SocketHttpListener/HttpBase.cs | 16 +- SocketHttpListener/HttpResponse.cs | 40 +---- SocketHttpListener/MessageEventArgs.cs | 24 +-- SocketHttpListener/Net/ChunkStream.cs | 15 +- SocketHttpListener/Net/ChunkedInputStream.cs | 4 +- SocketHttpListener/Net/HttpConnection.cs | 32 +--- SocketHttpListener/Net/HttpEndPointListener.cs | 8 +- SocketHttpListener/Net/HttpListener.cs | 23 +-- .../Net/HttpListenerBasicIdentity.cs | 29 +-- SocketHttpListener/Net/HttpListenerContext.cs | 16 +- .../Net/HttpListenerPrefixCollection.cs | 15 +- .../Net/HttpListenerResponse.Managed.cs | 4 +- SocketHttpListener/Net/HttpListenerResponse.cs | 27 ++- SocketHttpListener/Net/HttpRequestStream.cs | 18 +- SocketHttpListener/Net/HttpResponseStream.cs | 18 +- SocketHttpListener/Net/HttpStreamAsyncResult.cs | 5 +- SocketHttpListener/Net/ListenerPrefix.cs | 24 +-- SocketHttpListener/PayloadData.cs | 43 +---- SocketHttpListener/SocketStream.cs | 28 ++- SocketHttpListener/WebSocket.cs | 14 +- SocketHttpListener/WebSocketFrame.cs | 192 +++----------------- 185 files changed, 792 insertions(+), 3796 deletions(-) (limited to 'MediaBrowser.Controller/Entities/UserRootFolder.cs') diff --git a/BDInfo/BDInfoSettings.cs b/BDInfo/BDInfoSettings.cs index d127710f4..f4cb30016 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 98269a362..fad3f1acb 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 36f3149fa..17025c2e3 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 23408859d..20f795e53 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 44c9ebc71..f4009ee93 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 93ed323d0..c3c4bd393 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 2a65ce40a..62b261908 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 4c72c4211..eb8781e0c 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 117646108..a85720b5f 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 d81ce584b..9e7c04bdb 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 49c944790..95be02ff4 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 bb6d69115..b96fa43e5 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 3f82fd4b7..8f517681e 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", - - "dng", - - "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 - - // working on windows at least - "cr2", - "nef", - "arw" - }; - } - } + "jpeg", + "jpg", + "png", - public ImageFormat[] SupportedOutputFormats - { - get - { - return new[] { ImageFormat.Webp, ImageFormat.Jpg, ImageFormat.Png }; - } - } + "dng", + + "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 + + // working on windows at least + "cr2", + "nef", + "arw" + }; + + 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 5b9b15857..57a6eb148 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 - { - return new string[] - { - "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" - }; - } - } - - - public bool SupportsImageCollageCreation - { - get - { - return _imageEncoder.SupportsImageCollageCreation; - } - } - - private string ResizedImageCachePath - { - get - { - return Path.Combine(_appPaths.ImageCachePath, "resized-images"); - } - } - - private string EnhancedImageCachePath - { - get - { - return Path.Combine(_appPaths.ImageCachePath, "enhanced-images"); - } - } + public string[] SupportedInputFormats => + new string[] + { + "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" + }; + + + public bool SupportsImageCollageCreation => _imageEncoder.SupportsImageCollageCreation; + + private string ResizedImageCachePath => Path.Combine(_appPaths.ImageCachePath, "resized-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 748ae6f2c..e6f205a1f 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 846f3b2ce..ac486f167 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 bcacab906..f45b39d3e 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 ebaacd3a1..fd85bf76a 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 d14d04b20..6a29ada7e 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 40480b2ae..99d0ed7ab 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 8621de563..325bad501 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 50e24a0c2..b18562a69 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 ffa57758a..6e5a4e75a 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 cb346cac5..d0dcd86eb 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 c6c87cdea..e38468388 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 8b1e8bbb7..21bfac55d 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 ff0d23fcd..8decea5a2 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 28590444e..8412bf66b 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 c6781cad9..cdf9c7d0b 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 969ab9c3b..1e90d03b0 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 e3fb0ad52..bb21fe5ae 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 cad08ea24..3dd9de2a1 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 5a309ba09..3b8b29995 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 4771e188f..da1f00c3e 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 fc2310683..400ad47cc 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 f1edc5a22..b0c4b29c1 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 f2cb1d485..387ccad25 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 1b1fc8ff8..0df46c399 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 938b56285..0b21472f0 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 cd52803c6..a14c9fb34 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 022d4aa82..adf03fb66 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 a484f31f1..522b3e33e 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 e9eb1e907..13a6fe44a 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 b91aa4d0b..a3e05f0d2 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 d1e047c5d..2d464bd32 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 5525ddcc5..d26aaf2bb 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 95d1690d5..65c8a5fdd 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 65f2ad992..995f39483 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 218515995..c15ba1a1e 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 febd0cc20..7a23d9a66 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 f0713a74b..c56dc04ec 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 5573bbf31..fe53d2f05 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 46cdfcf15..82a4531ff 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 e55273904..c0fd4ae89 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 e9c915ead..63f830d25 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 9380deb33..3f3ab3551 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 c2384ca72..124a943ef 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 0da021558..232d11624 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 e990b9374..5bf082b7e 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 061541447..0ba8b3b48 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 2e6830e78..686bb643b 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 42992bbd5..4cd0c8b66 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 b95199f7e..d6da0d48c 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 8a04d7a8d..072b1d89a 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 4c8c9b590..b40009e0c 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 e48c8dd29..5ba4613c0 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 2ce776103..5bf22d7bc 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 03facf107..16fef9a82 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 0739d5f57..8a87aff5f 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 7b55d8bb9..7fe8df8af 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 9c45a803b..de4105df9 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 cc236cbba..dd4440c3b 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 054724b21..643c0ddcf 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 dfe23f193..eb459e890 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 93300243b..55f47aae9 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 15394cc20..8bde6a5da 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 8088e7332..d89ec4fbf 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 dd846fafe..bb09d365e 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 48d2b65ad..625f0b389 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 9ef0eb80f..64c2294e3 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 2471989a0..3e004763d 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 bee53b4c5..4e7e1c8ed 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 af8d6cb11..969643660 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 1016535e1..637a7e3f0 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 2e4de4d93..e67b3ebac 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 73f9b69c8..f5e028ab8 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 589cbf4df..894f46129 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 23d65e5ac..2a2f36fbd 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 479e13da4..0a4928ed7 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 4fef3055b..2ddf922f9 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 05a2d84e9..d5773fe31 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 a3a6506bc..df78d117a 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 7b368923c..8489cc9b1 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 fe315d83c..bf23a73bd 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 0e418ecf7..a1d925881 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 58a05e2f3..3b7514613 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 7465e05f8..b5c1ac408 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 2bc6908db..86d7c9d62 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 b6866d38e..b27df346c 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 f42ef4c91..7011ff8ea 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 9c9b3ef67..b83df87e2 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 05ba6f18d..4297b97c6 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 79558b0cf..ed6ed22a0 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 570fb3e02..be531770d 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 99fbddf09..693edb143 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 6619ea980..c6c1a2a94 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 a832606a9..e06d93520 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 39f6e04a5..c839befff 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 7d921d864..2b73fdcd3 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 7a713b4e5..3322582cc 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 ffbb2d7c1..0b902ccec 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 31be4d6d3..70bf862fb 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 c5a47836f..b7598ef22 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 e0b6d97ce..6aaad41f7 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 d495ffed1..79e61f6a7 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 0c7c5cecf..b9c5d7ce5 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 d85d77701..ef5c781dc 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 485e6a2f9..2a3cdf097 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 63bcd9e2d..3783c5032 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 d4ade5686..33a6c2fa3 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