aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.vscode/tasks.json12
-rw-r--r--DvdLib/Ifo/Program.cs2
-rw-r--r--Emby.Dlna/Main/DlnaEntryPoint.cs10
-rw-r--r--Emby.Dlna/PlayTo/Device.cs20
-rw-r--r--Emby.Dlna/PlayTo/PlayToController.cs19
-rw-r--r--Emby.Dlna/Ssdp/DeviceDiscovery.cs16
-rw-r--r--Emby.Dlna/Ssdp/Extensions.cs14
-rw-r--r--Emby.Drawing/ImageProcessor.cs25
-rw-r--r--Emby.Drawing/NullImageEncoder.cs6
-rw-r--r--Emby.Naming/Common/NamingOptions.cs2
-rw-r--r--Emby.Server.Implementations/Activity/ActivityLogEntryPoint.cs18
-rw-r--r--Emby.Server.Implementations/Channels/ChannelManager.cs2
-rw-r--r--Emby.Server.Implementations/Configuration/ServerConfigurationManager.cs2
-rw-r--r--Emby.Server.Implementations/Cryptography/CryptographyProvider.cs4
-rw-r--r--Emby.Server.Implementations/Data/SqliteItemRepository.cs34
-rw-r--r--Emby.Server.Implementations/Devices/DeviceManager.cs8
-rw-r--r--Emby.Server.Implementations/Dto/DtoService.cs94
-rw-r--r--Emby.Server.Implementations/Emby.Server.Implementations.csproj1
-rw-r--r--Emby.Server.Implementations/EntryPoints/LibraryChangedNotifier.cs4
-rw-r--r--Emby.Server.Implementations/EntryPoints/RecordingNotifier.cs18
-rw-r--r--Emby.Server.Implementations/EntryPoints/ServerEventNotifier.cs42
-rw-r--r--Emby.Server.Implementations/EntryPoints/UdpServerEntryPoint.cs3
-rw-r--r--Emby.Server.Implementations/HttpServer/HttpResultFactory.cs13
-rw-r--r--Emby.Server.Implementations/IStartupOptions.cs2
-rw-r--r--Emby.Server.Implementations/Images/ArtistImageProvider.cs47
-rw-r--r--Emby.Server.Implementations/Images/BaseDynamicImageProvider.cs13
-rw-r--r--Emby.Server.Implementations/Images/CollectionFolderImageProvider.cs (renamed from Emby.Server.Implementations/UserViews/CollectionFolderImageProvider.cs)4
-rw-r--r--Emby.Server.Implementations/Images/DynamicImageProvider.cs (renamed from Emby.Server.Implementations/UserViews/DynamicImageProvider.cs)8
-rw-r--r--Emby.Server.Implementations/Images/FolderImageProvider.cs (renamed from Emby.Server.Implementations/UserViews/FolderImageProvider.cs)14
-rw-r--r--Emby.Server.Implementations/Images/GenreImageProvider.cs (renamed from Emby.Server.Implementations/Playlists/PlaylistImageProvider.cs)53
-rw-r--r--Emby.Server.Implementations/Images/PlaylistImageProvider.cs66
-rw-r--r--Emby.Server.Implementations/Library/LibraryManager.cs102
-rw-r--r--Emby.Server.Implementations/Library/MediaSourceManager.cs6
-rw-r--r--Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs13
-rw-r--r--Emby.Server.Implementations/LiveTv/EmbyTV/EncodedRecorder.cs4
-rw-r--r--Emby.Server.Implementations/LiveTv/EmbyTV/TimerManager.cs4
-rw-r--r--Emby.Server.Implementations/LiveTv/LiveTvManager.cs77
-rw-r--r--Emby.Server.Implementations/LiveTv/RefreshChannelsScheduledTask.cs2
-rw-r--r--Emby.Server.Implementations/Localization/Core/ca.json24
-rw-r--r--Emby.Server.Implementations/Localization/Core/es_419.json117
-rw-r--r--Emby.Server.Implementations/Localization/Core/fr.json4
-rw-r--r--Emby.Server.Implementations/Localization/Core/ta.json99
-rw-r--r--Emby.Server.Implementations/MediaEncoder/EncodingManager.cs2
-rw-r--r--Emby.Server.Implementations/Net/SocketFactory.cs2
-rw-r--r--Emby.Server.Implementations/Net/UdpSocket.cs2
-rw-r--r--Emby.Server.Implementations/Networking/NetworkManager.cs2
-rw-r--r--Emby.Server.Implementations/Playlists/ManualPlaylistsFolder.cs2
-rw-r--r--Emby.Server.Implementations/Playlists/PlaylistManager.cs7
-rw-r--r--Emby.Server.Implementations/ResourceFileManager.cs2
-rw-r--r--Emby.Server.Implementations/ScheduledTasks/ScheduledTaskWorker.cs22
-rw-r--r--Emby.Server.Implementations/ScheduledTasks/TaskManager.cs15
-rw-r--r--Emby.Server.Implementations/ScheduledTasks/Tasks/ChapterImagesTask.cs7
-rw-r--r--Emby.Server.Implementations/ScheduledTasks/Tasks/DeleteCacheFileTask.cs7
-rw-r--r--Emby.Server.Implementations/ScheduledTasks/Tasks/DeleteLogFileTask.cs9
-rw-r--r--Emby.Server.Implementations/ScheduledTasks/Tasks/DeleteTranscodeFileTask.cs7
-rw-r--r--Emby.Server.Implementations/ScheduledTasks/Tasks/PeopleValidationTask.cs10
-rw-r--r--Emby.Server.Implementations/ScheduledTasks/Tasks/PluginUpdateTask.cs6
-rw-r--r--Emby.Server.Implementations/ScheduledTasks/Tasks/RefreshMediaLibraryTask.cs17
-rw-r--r--Emby.Server.Implementations/ScheduledTasks/Triggers/DailyTrigger.cs7
-rw-r--r--Emby.Server.Implementations/ScheduledTasks/Triggers/IntervalTrigger.cs2
-rw-r--r--Emby.Server.Implementations/ScheduledTasks/Triggers/StartupTrigger.cs6
-rw-r--r--Emby.Server.Implementations/ScheduledTasks/Triggers/WeeklyTrigger.cs2
-rw-r--r--Emby.Server.Implementations/Security/AuthenticationRepository.cs2
-rw-r--r--Emby.Server.Implementations/Serialization/JsonSerializer.cs5
-rw-r--r--Emby.Server.Implementations/Services/HttpResult.cs2
-rw-r--r--Emby.Server.Implementations/Services/RequestHelper.cs7
-rw-r--r--Emby.Server.Implementations/Services/ResponseHelper.cs5
-rw-r--r--Emby.Server.Implementations/Services/ServiceController.cs2
-rw-r--r--Emby.Server.Implementations/Services/ServiceExec.cs2
-rw-r--r--Emby.Server.Implementations/Services/ServiceHandler.cs2
-rw-r--r--Emby.Server.Implementations/Services/ServiceMethod.cs2
-rw-r--r--Emby.Server.Implementations/Services/ServicePath.cs2
-rw-r--r--Emby.Server.Implementations/Services/StringMapTypeDeserializer.cs2
-rw-r--r--Emby.Server.Implementations/Services/SwaggerService.cs2
-rw-r--r--Emby.Server.Implementations/Services/UrlExtensions.cs2
-rw-r--r--Emby.Server.Implementations/Session/SessionManager.cs2
-rw-r--r--Emby.Server.Implementations/SocketSharp/HttpFile.cs18
-rw-r--r--Emby.Server.Implementations/SocketSharp/HttpPostedFile.cs198
-rw-r--r--Emby.Server.Implementations/SocketSharp/WebSocketSharpRequest.cs4
-rw-r--r--Emby.Server.Implementations/Sorting/AiredEpisodeOrderComparer.cs2
-rw-r--r--Emby.Server.Implementations/Sorting/CommunityRatingComparer.cs18
-rw-r--r--Emby.Server.Implementations/Sorting/DateLastMediaAddedComparer.cs18
-rw-r--r--Emby.Server.Implementations/Sorting/IsFavoriteOrLikeComparer.cs38
-rw-r--r--Emby.Server.Implementations/Sorting/IsFolderComparer.cs14
-rw-r--r--Emby.Server.Implementations/Sorting/IsPlayedComparer.cs38
-rw-r--r--Emby.Server.Implementations/Sorting/IsUnplayedComparer.cs38
-rw-r--r--Emby.Server.Implementations/Sorting/OfficialRatingComparer.cs14
-rw-r--r--Emby.Server.Implementations/Sorting/SeriesSortNameComparer.cs14
-rw-r--r--Emby.Server.Implementations/Sorting/StartDateComparer.cs19
-rw-r--r--Emby.Server.Implementations/Sorting/StudioComparer.cs2
-rw-r--r--Emby.Server.Implementations/SyncPlay/SyncPlayController.cs5
-rw-r--r--Emby.Server.Implementations/SyncPlay/SyncPlayManager.cs7
-rw-r--r--Emby.Server.Implementations/TV/TVSeriesManager.cs6
-rw-r--r--Emby.Server.Implementations/Updates/InstallationManager.cs135
-rw-r--r--Jellyfin.Api/Jellyfin.Api.csproj1
-rw-r--r--Jellyfin.Api/Models/StartupDtos/StartupConfigurationDto.cs2
-rw-r--r--Jellyfin.Api/Models/StartupDtos/StartupUserDto.cs2
-rw-r--r--Jellyfin.Data/Jellyfin.Data.csproj1
-rw-r--r--Jellyfin.Drawing.Skia/Jellyfin.Drawing.Skia.csproj2
-rw-r--r--Jellyfin.Drawing.Skia/SkiaEncoder.cs25
-rw-r--r--Jellyfin.Server/Migrations/IMigrationRoutine.cs1
-rw-r--r--Jellyfin.Server/Migrations/Routines/CreateUserLoggingConfigFile.cs1
-rw-r--r--Jellyfin.Server/Program.cs4
-rw-r--r--MediaBrowser.Api/ApiEntryPoint.cs4
-rw-r--r--MediaBrowser.Api/Devices/DeviceService.cs28
-rw-r--r--MediaBrowser.Api/EnvironmentService.cs15
-rw-r--r--MediaBrowser.Api/Images/ImageService.cs19
-rw-r--r--MediaBrowser.Api/Images/RemoteImageService.cs3
-rw-r--r--MediaBrowser.Api/Playback/BaseStreamingService.cs10
-rw-r--r--MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs16
-rw-r--r--MediaBrowser.Api/Playback/Hls/VideoHlsService.cs2
-rw-r--r--MediaBrowser.Api/Playback/StreamState.cs2
-rw-r--r--MediaBrowser.Api/Sessions/SessionInfoWebSocketListener.cs28
-rw-r--r--MediaBrowser.Api/VideosService.cs1
-rw-r--r--MediaBrowser.Common/Configuration/ConfigurationStore.cs20
-rw-r--r--MediaBrowser.Common/Configuration/IApplicationPaths.cs22
-rw-r--r--MediaBrowser.Common/Configuration/IConfigurationFactory.cs30
-rw-r--r--MediaBrowser.Common/Configuration/IConfigurationManager.cs2
-rw-r--r--MediaBrowser.Common/Configuration/IValidatingConfiguration.cs15
-rw-r--r--MediaBrowser.Common/MediaBrowser.Common.csproj2
-rw-r--r--MediaBrowser.Common/Net/CacheMode.cs11
-rw-r--r--MediaBrowser.Common/Net/CompressionMethods.cs15
-rw-r--r--MediaBrowser.Common/Net/HttpRequestOptions.cs14
-rw-r--r--MediaBrowser.Common/Progress/ActionableProgress.cs17
-rw-r--r--MediaBrowser.Common/Progress/SimpleProgress.cs16
-rw-r--r--MediaBrowser.Common/Updates/IInstallationManager.cs28
-rw-r--r--MediaBrowser.Controller/Devices/CameraImageUploadInfo.cs10
-rw-r--r--MediaBrowser.Controller/Drawing/IImageEncoder.cs9
-rw-r--r--MediaBrowser.Controller/Drawing/IImageProcessor.cs7
-rw-r--r--MediaBrowser.Controller/Entities/BaseItem.cs42
-rw-r--r--MediaBrowser.Controller/Entities/Folder.cs5
-rw-r--r--MediaBrowser.Controller/Entities/ItemImageInfo.cs6
-rw-r--r--MediaBrowser.Controller/Library/ILibraryManager.cs3
-rw-r--r--MediaBrowser.Controller/LiveTv/TimerEventInfo.cs13
-rw-r--r--MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs18
-rw-r--r--MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs30
-rw-r--r--MediaBrowser.Controller/Net/BasePeriodicWebSocketListener.cs25
-rw-r--r--MediaBrowser.MediaEncoding/Subtitles/AssParser.cs6
-rw-r--r--MediaBrowser.Model/Activity/ActivityLogEntry.cs1
-rw-r--r--MediaBrowser.Model/ApiClient/ServerDiscoveryInfo.cs1
-rw-r--r--MediaBrowser.Model/Branding/BrandingOptions.cs1
-rw-r--r--MediaBrowser.Model/Channels/ChannelFeatures.cs1
-rw-r--r--MediaBrowser.Model/Channels/ChannelInfo.cs1
-rw-r--r--MediaBrowser.Model/Channels/ChannelQuery.cs6
-rw-r--r--MediaBrowser.Model/Configuration/BaseApplicationConfiguration.cs1
-rw-r--r--MediaBrowser.Model/Configuration/EncodingOptions.cs13
-rw-r--r--MediaBrowser.Model/Configuration/LibraryOptions.cs1
-rw-r--r--MediaBrowser.Model/Configuration/MetadataOptions.cs4
-rw-r--r--MediaBrowser.Model/Configuration/MetadataPlugin.cs1
-rw-r--r--MediaBrowser.Model/Configuration/MetadataPluginSummary.cs1
-rw-r--r--MediaBrowser.Model/Configuration/ServerConfiguration.cs1
-rw-r--r--MediaBrowser.Model/Configuration/UserConfiguration.cs1
-rw-r--r--MediaBrowser.Model/Configuration/XbmcMetadataOptions.cs1
-rw-r--r--MediaBrowser.Model/Cryptography/ICryptoProvider.cs2
-rw-r--r--MediaBrowser.Model/Devices/ContentUploadHistory.cs15
-rw-r--r--MediaBrowser.Model/Devices/DeviceInfo.cs1
-rw-r--r--MediaBrowser.Model/Devices/DeviceOptions.cs2
-rw-r--r--MediaBrowser.Model/Devices/LocalFileInfo.cs12
-rw-r--r--MediaBrowser.Model/Dlna/AudioOptions.cs6
-rw-r--r--MediaBrowser.Model/Dlna/CodecProfile.cs1
-rw-r--r--MediaBrowser.Model/Dlna/ConditionProcessor.cs36
-rw-r--r--MediaBrowser.Model/Dlna/ContainerProfile.cs2
-rw-r--r--MediaBrowser.Model/Dlna/ContentFeatureBuilder.cs6
-rw-r--r--MediaBrowser.Model/Dlna/DeviceIdentification.cs1
-rw-r--r--MediaBrowser.Model/Dlna/DeviceProfile.cs1
-rw-r--r--MediaBrowser.Model/Dlna/DeviceProfileInfo.cs1
-rw-r--r--MediaBrowser.Model/Dlna/DirectPlayProfile.cs1
-rw-r--r--MediaBrowser.Model/Dlna/HttpHeaderInfo.cs1
-rw-r--r--MediaBrowser.Model/Dlna/ITranscoderSupport.cs5
-rw-r--r--MediaBrowser.Model/Dlna/MediaFormatProfileResolver.cs24
-rw-r--r--MediaBrowser.Model/Dlna/ProfileCondition.cs25
-rw-r--r--MediaBrowser.Model/Dlna/ResolutionConfiguration.cs1
-rw-r--r--MediaBrowser.Model/Dlna/ResolutionNormalizer.cs5
-rw-r--r--MediaBrowser.Model/Dlna/ResolutionOptions.cs1
-rw-r--r--MediaBrowser.Model/Dlna/ResponseProfile.cs4
-rw-r--r--MediaBrowser.Model/Dlna/SearchCriteria.cs9
-rw-r--r--MediaBrowser.Model/Dlna/StreamBuilder.cs2
-rw-r--r--MediaBrowser.Model/Dlna/StreamInfo.cs1
-rw-r--r--MediaBrowser.Model/Dlna/SubtitleProfile.cs1
-rw-r--r--MediaBrowser.Model/Dlna/SubtitleStreamInfo.cs9
-rw-r--r--MediaBrowser.Model/Dlna/TranscodingProfile.cs1
-rw-r--r--MediaBrowser.Model/Dlna/UpnpDeviceInfo.cs4
-rw-r--r--MediaBrowser.Model/Dlna/VideoOptions.cs1
-rw-r--r--MediaBrowser.Model/Dlna/XmlAttribute.cs1
-rw-r--r--MediaBrowser.Model/Drawing/DrawingUtils.cs5
-rw-r--r--MediaBrowser.Model/Dto/BaseItemDto.cs8
-rw-r--r--MediaBrowser.Model/Dto/BaseItemPerson.cs1
-rw-r--r--MediaBrowser.Model/Dto/IHasServerId.cs1
-rw-r--r--MediaBrowser.Model/Dto/ImageByNameInfo.cs1
-rw-r--r--MediaBrowser.Model/Dto/ImageInfo.cs11
-rw-r--r--MediaBrowser.Model/Dto/ImageOptions.cs17
-rw-r--r--MediaBrowser.Model/Dto/ItemIndex.cs20
-rw-r--r--MediaBrowser.Model/Dto/MediaSourceInfo.cs1
-rw-r--r--MediaBrowser.Model/Dto/MetadataEditorInfo.cs1
-rw-r--r--MediaBrowser.Model/Dto/NameIdPair.cs1
-rw-r--r--MediaBrowser.Model/Dto/NameValuePair.cs2
-rw-r--r--MediaBrowser.Model/Dto/RecommendationDto.cs1
-rw-r--r--MediaBrowser.Model/Dto/UserDto.cs1
-rw-r--r--MediaBrowser.Model/Dto/UserItemDataDto.cs1
-rw-r--r--MediaBrowser.Model/Entities/ChapterInfo.cs1
-rw-r--r--MediaBrowser.Model/Entities/DisplayPreferences.cs1
-rw-r--r--MediaBrowser.Model/Entities/IHasProviderIds.cs2
-rw-r--r--MediaBrowser.Model/Entities/LibraryUpdateInfo.cs29
-rw-r--r--MediaBrowser.Model/Entities/MediaAttachment.cs1
-rw-r--r--MediaBrowser.Model/Entities/MediaStream.cs1
-rw-r--r--MediaBrowser.Model/Entities/MediaUrl.cs1
-rw-r--r--MediaBrowser.Model/Entities/PackageReviewInfo.cs13
-rw-r--r--MediaBrowser.Model/Entities/ParentalRating.cs24
-rw-r--r--MediaBrowser.Model/Entities/ProviderIdsExtensions.cs4
-rw-r--r--MediaBrowser.Model/Entities/VirtualFolderInfo.cs1
-rw-r--r--MediaBrowser.Model/Events/GenericEventArgs.cs7
-rw-r--r--MediaBrowser.Model/Extensions/ListHelper.cs29
-rw-r--r--MediaBrowser.Model/Extensions/StringHelper.cs4
-rw-r--r--MediaBrowser.Model/Globalization/CountryInfo.cs1
-rw-r--r--MediaBrowser.Model/Globalization/CultureDto.cs1
-rw-r--r--MediaBrowser.Model/Globalization/ILocalizationManager.cs1
-rw-r--r--MediaBrowser.Model/Globalization/LocalizationOption.cs2
-rw-r--r--MediaBrowser.Model/IO/FileSystemEntryInfo.cs27
-rw-r--r--MediaBrowser.Model/IO/FileSystemMetadata.cs1
-rw-r--r--MediaBrowser.Model/IO/IFileSystem.cs1
-rw-r--r--MediaBrowser.Model/IO/IIsoManager.cs1
-rw-r--r--MediaBrowser.Model/IO/IIsoMount.cs2
-rw-r--r--MediaBrowser.Model/IO/IIsoMounter.cs12
-rw-r--r--MediaBrowser.Model/IO/IStreamHelper.cs1
-rw-r--r--MediaBrowser.Model/Library/UserViewQuery.cs12
-rw-r--r--MediaBrowser.Model/LiveTv/BaseTimerInfoDto.cs1
-rw-r--r--MediaBrowser.Model/LiveTv/GuideInfo.cs1
-rw-r--r--MediaBrowser.Model/LiveTv/LiveTvChannelQuery.cs1
-rw-r--r--MediaBrowser.Model/LiveTv/LiveTvInfo.cs12
-rw-r--r--MediaBrowser.Model/LiveTv/LiveTvOptions.cs1
-rw-r--r--MediaBrowser.Model/LiveTv/LiveTvServiceInfo.cs1
-rw-r--r--MediaBrowser.Model/LiveTv/RecordingQuery.cs1
-rw-r--r--MediaBrowser.Model/LiveTv/SeriesTimerInfoDto.cs1
-rw-r--r--MediaBrowser.Model/LiveTv/SeriesTimerQuery.cs2
-rw-r--r--MediaBrowser.Model/LiveTv/TimerInfoDto.cs1
-rw-r--r--MediaBrowser.Model/LiveTv/TimerQuery.cs1
-rw-r--r--MediaBrowser.Model/MediaBrowser.Model.csproj2
-rw-r--r--MediaBrowser.Model/MediaInfo/AudioCodec.cs4
-rw-r--r--MediaBrowser.Model/MediaInfo/BlurayDiscInfo.cs1
-rw-r--r--MediaBrowser.Model/MediaInfo/LiveStreamRequest.cs34
-rw-r--r--MediaBrowser.Model/MediaInfo/LiveStreamResponse.cs7
-rw-r--r--MediaBrowser.Model/MediaInfo/MediaInfo.cs1
-rw-r--r--MediaBrowser.Model/MediaInfo/PlaybackInfoRequest.cs1
-rw-r--r--MediaBrowser.Model/MediaInfo/PlaybackInfoResponse.cs2
-rw-r--r--MediaBrowser.Model/MediaInfo/SubtitleTrackEvent.cs4
-rw-r--r--MediaBrowser.Model/Net/EndPointInfo.cs1
-rw-r--r--MediaBrowser.Model/Net/ISocket.cs1
-rw-r--r--MediaBrowser.Model/Net/MimeTypes.cs18
-rw-r--r--MediaBrowser.Model/Net/NetworkShare.cs1
-rw-r--r--MediaBrowser.Model/Net/SocketReceiveResult.cs10
-rw-r--r--MediaBrowser.Model/Net/WebSocketMessage.cs2
-rw-r--r--MediaBrowser.Model/Notifications/NotificationOption.cs16
-rw-r--r--MediaBrowser.Model/Notifications/NotificationOptions.cs31
-rw-r--r--MediaBrowser.Model/Notifications/NotificationRequest.cs1
-rw-r--r--MediaBrowser.Model/Notifications/NotificationTypeInfo.cs1
-rw-r--r--MediaBrowser.Model/Playlists/PlaylistCreationRequest.cs1
-rw-r--r--MediaBrowser.Model/Playlists/PlaylistCreationResult.cs7
-rw-r--r--MediaBrowser.Model/Playlists/PlaylistItemQuery.cs39
-rw-r--r--MediaBrowser.Model/Plugins/PluginInfo.cs1
-rw-r--r--MediaBrowser.Model/Plugins/PluginPageInfo.cs1
-rw-r--r--MediaBrowser.Model/Providers/ExternalIdInfo.cs1
-rw-r--r--MediaBrowser.Model/Providers/ExternalUrl.cs1
-rw-r--r--MediaBrowser.Model/Providers/ImageProviderInfo.cs28
-rw-r--r--MediaBrowser.Model/Providers/RemoteImageInfo.cs1
-rw-r--r--MediaBrowser.Model/Providers/RemoteImageQuery.cs7
-rw-r--r--MediaBrowser.Model/Providers/RemoteImageResult.cs1
-rw-r--r--MediaBrowser.Model/Providers/RemoteSearchResult.cs20
-rw-r--r--MediaBrowser.Model/Providers/RemoteSubtitleInfo.cs1
-rw-r--r--MediaBrowser.Model/Providers/SubtitleOptions.cs1
-rw-r--r--MediaBrowser.Model/Providers/SubtitleProviderInfo.cs1
-rw-r--r--MediaBrowser.Model/Querying/AllThemeMediaResult.cs13
-rw-r--r--MediaBrowser.Model/Querying/EpisodeQuery.cs1
-rw-r--r--MediaBrowser.Model/Querying/ItemCountsQuery.cs20
-rw-r--r--MediaBrowser.Model/Querying/ItemSortBy.cs54
-rw-r--r--MediaBrowser.Model/Querying/LatestItemsQuery.cs20
-rw-r--r--MediaBrowser.Model/Querying/MovieRecommendationQuery.cs1
-rw-r--r--MediaBrowser.Model/Querying/NextUpQuery.cs1
-rw-r--r--MediaBrowser.Model/Querying/QueryFilters.cs1
-rw-r--r--MediaBrowser.Model/Querying/QueryResult.cs1
-rw-r--r--MediaBrowser.Model/Querying/ThemeMediaResult.cs2
-rw-r--r--MediaBrowser.Model/Querying/UpcomingEpisodesQuery.cs1
-rw-r--r--MediaBrowser.Model/Search/SearchHint.cs1
-rw-r--r--MediaBrowser.Model/Search/SearchHintResult.cs1
-rw-r--r--MediaBrowser.Model/Search/SearchQuery.cs1
-rw-r--r--MediaBrowser.Model/Serialization/IJsonSerializer.cs1
-rw-r--r--MediaBrowser.Model/Serialization/IXmlSerializer.cs1
-rw-r--r--MediaBrowser.Model/Services/ApiMemberAttribute.cs1
-rw-r--r--MediaBrowser.Model/Services/IHasRequestFilter.cs2
-rw-r--r--MediaBrowser.Model/Services/IHttpRequest.cs4
-rw-r--r--MediaBrowser.Model/Services/IHttpResult.cs11
-rw-r--r--MediaBrowser.Model/Services/IRequest.cs1
-rw-r--r--MediaBrowser.Model/Services/QueryParamCollection.cs6
-rw-r--r--MediaBrowser.Model/Services/RouteAttribute.cs1
-rw-r--r--MediaBrowser.Model/Session/BrowseRequest.cs1
-rw-r--r--MediaBrowser.Model/Session/ClientCapabilities.cs1
-rw-r--r--MediaBrowser.Model/Session/GeneralCommand.cs1
-rw-r--r--MediaBrowser.Model/Session/MessageCommand.cs1
-rw-r--r--MediaBrowser.Model/Session/PlayRequest.cs1
-rw-r--r--MediaBrowser.Model/Session/PlaybackProgressInfo.cs1
-rw-r--r--MediaBrowser.Model/Session/PlaybackStopInfo.cs1
-rw-r--r--MediaBrowser.Model/Session/PlayerStateInfo.cs1
-rw-r--r--MediaBrowser.Model/Session/PlaystateRequest.cs2
-rw-r--r--MediaBrowser.Model/Session/SessionUserInfo.cs2
-rw-r--r--MediaBrowser.Model/Session/TranscodingInfo.cs5
-rw-r--r--MediaBrowser.Model/Session/UserDataChangeInfo.cs1
-rw-r--r--MediaBrowser.Model/Sync/SyncJob.cs1
-rw-r--r--MediaBrowser.Model/Sync/SyncTarget.cs1
-rw-r--r--MediaBrowser.Model/SyncPlay/GroupInfoView.cs2
-rw-r--r--MediaBrowser.Model/SyncPlay/GroupUpdate.cs2
-rw-r--r--MediaBrowser.Model/SyncPlay/SendCommand.cs2
-rw-r--r--MediaBrowser.Model/SyncPlay/UtcTimeResponse.cs2
-rw-r--r--MediaBrowser.Model/System/LogFile.cs1
-rw-r--r--MediaBrowser.Model/System/PublicSystemInfo.cs1
-rw-r--r--MediaBrowser.Model/System/SystemInfo.cs2
-rw-r--r--MediaBrowser.Model/System/WakeOnLanInfo.cs31
-rw-r--r--MediaBrowser.Model/Tasks/IScheduledTask.cs11
-rw-r--r--MediaBrowser.Model/Tasks/IScheduledTaskWorker.cs1
-rw-r--r--MediaBrowser.Model/Tasks/ScheduledTaskHelpers.cs4
-rw-r--r--MediaBrowser.Model/Tasks/TaskCompletionEventArgs.cs10
-rw-r--r--MediaBrowser.Model/Tasks/TaskInfo.cs1
-rw-r--r--MediaBrowser.Model/Tasks/TaskResult.cs1
-rw-r--r--MediaBrowser.Model/Tasks/TaskTriggerInfo.cs1
-rw-r--r--MediaBrowser.Model/Updates/InstallationInfo.cs23
-rw-r--r--MediaBrowser.Model/Updates/PackageInfo.cs1
-rw-r--r--MediaBrowser.Model/Updates/VersionInfo.cs22
-rw-r--r--MediaBrowser.Model/Users/ForgotPasswordResult.cs1
-rw-r--r--MediaBrowser.Model/Users/PinRedeemResult.cs1
-rw-r--r--MediaBrowser.Model/Users/UserAction.cs1
-rw-r--r--MediaBrowser.Model/Users/UserPolicy.cs1
-rw-r--r--MediaBrowser.Providers/Manager/ItemImageProvider.cs24
-rw-r--r--MediaBrowser.Providers/Manager/ProviderManager.cs6
-rw-r--r--MediaBrowser.WebDashboard/Api/DashboardService.cs155
-rw-r--r--MediaBrowser.WebDashboard/Api/PackageCreator.cs161
-rw-r--r--RSSDP/RSSDP.csproj1
334 files changed, 2011 insertions, 1689 deletions
diff --git a/.vscode/tasks.json b/.vscode/tasks.json
index ac517e10c..2289fd991 100644
--- a/.vscode/tasks.json
+++ b/.vscode/tasks.json
@@ -10,6 +10,16 @@
"${workspaceFolder}/Jellyfin.Server/Jellyfin.Server.csproj"
],
"problemMatcher": "$msCompile"
+ },
+ {
+ "label": "api tests",
+ "command": "dotnet",
+ "type": "process",
+ "args": [
+ "test",
+ "${workspaceFolder}/tests/MediaBrowser.Api.Tests/MediaBrowser.Api.Tests.csproj"
+ ],
+ "problemMatcher": "$msCompile"
}
]
-} \ No newline at end of file
+}
diff --git a/DvdLib/Ifo/Program.cs b/DvdLib/Ifo/Program.cs
index 9f6251270..3d94fa7dc 100644
--- a/DvdLib/Ifo/Program.cs
+++ b/DvdLib/Ifo/Program.cs
@@ -6,7 +6,7 @@ namespace DvdLib.Ifo
{
public class Program
{
- public readonly List<Cell> Cells;
+ public IReadOnlyList<Cell> Cells { get; }
public Program(List<Cell> cells)
{
diff --git a/Emby.Dlna/Main/DlnaEntryPoint.cs b/Emby.Dlna/Main/DlnaEntryPoint.cs
index c5d60b2a0..bcab4adba 100644
--- a/Emby.Dlna/Main/DlnaEntryPoint.cs
+++ b/Emby.Dlna/Main/DlnaEntryPoint.cs
@@ -133,20 +133,20 @@ namespace Emby.Dlna.Main
{
await ((DlnaManager)_dlnaManager).InitProfilesAsync().ConfigureAwait(false);
- ReloadComponents();
+ await ReloadComponents().ConfigureAwait(false);
- _config.NamedConfigurationUpdated += _config_NamedConfigurationUpdated;
+ _config.NamedConfigurationUpdated += OnNamedConfigurationUpdated;
}
- void _config_NamedConfigurationUpdated(object sender, ConfigurationUpdateEventArgs e)
+ private async void OnNamedConfigurationUpdated(object sender, ConfigurationUpdateEventArgs e)
{
if (string.Equals(e.Key, "dlna", StringComparison.OrdinalIgnoreCase))
{
- ReloadComponents();
+ await ReloadComponents().ConfigureAwait(false);
}
}
- private async void ReloadComponents()
+ private async Task ReloadComponents()
{
var options = _config.GetDlnaConfiguration();
diff --git a/Emby.Dlna/PlayTo/Device.cs b/Emby.Dlna/PlayTo/Device.cs
index 6abc3a82c..c7431d143 100644
--- a/Emby.Dlna/PlayTo/Device.cs
+++ b/Emby.Dlna/PlayTo/Device.cs
@@ -34,7 +34,7 @@ namespace Emby.Dlna.PlayTo
{
get
{
- RefreshVolumeIfNeeded();
+ RefreshVolumeIfNeeded().GetAwaiter().GetResult();
return _volume;
}
set => _volume = value;
@@ -76,24 +76,24 @@ namespace Emby.Dlna.PlayTo
private DateTime _lastVolumeRefresh;
private bool _volumeRefreshActive;
- private void RefreshVolumeIfNeeded()
+ private Task RefreshVolumeIfNeeded()
{
- if (!_volumeRefreshActive)
- {
- return;
- }
-
- if (DateTime.UtcNow >= _lastVolumeRefresh.AddSeconds(5))
+ if (_volumeRefreshActive
+ && DateTime.UtcNow >= _lastVolumeRefresh.AddSeconds(5))
{
_lastVolumeRefresh = DateTime.UtcNow;
- RefreshVolume(CancellationToken.None);
+ return RefreshVolume();
}
+
+ return Task.CompletedTask;
}
- private async void RefreshVolume(CancellationToken cancellationToken)
+ private async Task RefreshVolume(CancellationToken cancellationToken = default)
{
if (_disposed)
+ {
return;
+ }
try
{
diff --git a/Emby.Dlna/PlayTo/PlayToController.cs b/Emby.Dlna/PlayTo/PlayToController.cs
index 1c38fca16..f1c69196a 100644
--- a/Emby.Dlna/PlayTo/PlayToController.cs
+++ b/Emby.Dlna/PlayTo/PlayToController.cs
@@ -148,11 +148,14 @@ namespace Emby.Dlna.PlayTo
{
var positionTicks = GetProgressPositionTicks(streamInfo);
- ReportPlaybackStopped(streamInfo, positionTicks);
+ await ReportPlaybackStopped(streamInfo, positionTicks).ConfigureAwait(false);
}
streamInfo = StreamParams.ParseFromUrl(e.NewMediaInfo.Url, _libraryManager, _mediaSourceManager);
- if (streamInfo.Item == null) return;
+ if (streamInfo.Item == null)
+ {
+ return;
+ }
var newItemProgress = GetProgressInfo(streamInfo);
@@ -175,11 +178,14 @@ namespace Emby.Dlna.PlayTo
{
var streamInfo = StreamParams.ParseFromUrl(e.MediaInfo.Url, _libraryManager, _mediaSourceManager);
- if (streamInfo.Item == null) return;
+ if (streamInfo.Item == null)
+ {
+ return;
+ }
var positionTicks = GetProgressPositionTicks(streamInfo);
- ReportPlaybackStopped(streamInfo, positionTicks);
+ await ReportPlaybackStopped(streamInfo, positionTicks).ConfigureAwait(false);
var mediaSource = await streamInfo.GetMediaSource(CancellationToken.None).ConfigureAwait(false);
@@ -187,7 +193,7 @@ namespace Emby.Dlna.PlayTo
(_device.Duration == null ? (long?)null : _device.Duration.Value.Ticks) :
mediaSource.RunTimeTicks;
- var playedToCompletion = (positionTicks.HasValue && positionTicks.Value == 0);
+ var playedToCompletion = positionTicks.HasValue && positionTicks.Value == 0;
if (!playedToCompletion && duration.HasValue && positionTicks.HasValue)
{
@@ -212,7 +218,7 @@ namespace Emby.Dlna.PlayTo
}
}
- private async void ReportPlaybackStopped(StreamParams streamInfo, long? positionTicks)
+ private async Task ReportPlaybackStopped(StreamParams streamInfo, long? positionTicks)
{
try
{
@@ -222,7 +228,6 @@ namespace Emby.Dlna.PlayTo
SessionId = _session.Id,
PositionTicks = positionTicks,
MediaSourceId = streamInfo.MediaSourceId
-
}).ConfigureAwait(false);
}
catch (Exception ex)
diff --git a/Emby.Dlna/Ssdp/DeviceDiscovery.cs b/Emby.Dlna/Ssdp/DeviceDiscovery.cs
index f95b8ce7d..ab5e56ab0 100644
--- a/Emby.Dlna/Ssdp/DeviceDiscovery.cs
+++ b/Emby.Dlna/Ssdp/DeviceDiscovery.cs
@@ -100,15 +100,13 @@ namespace Emby.Dlna.Ssdp
var headers = headerDict.ToDictionary(i => i.Key, i => i.Value.Value.FirstOrDefault(), StringComparer.OrdinalIgnoreCase);
- var args = new GenericEventArgs<UpnpDeviceInfo>
- {
- Argument = new UpnpDeviceInfo
+ var args = new GenericEventArgs<UpnpDeviceInfo>(
+ new UpnpDeviceInfo
{
Location = e.DiscoveredDevice.DescriptionLocation,
Headers = headers,
LocalIpAddress = e.LocalIpAddress
- }
- };
+ });
DeviceDiscoveredInternal?.Invoke(this, args);
}
@@ -121,14 +119,12 @@ namespace Emby.Dlna.Ssdp
var headers = headerDict.ToDictionary(i => i.Key, i => i.Value.Value.FirstOrDefault(), StringComparer.OrdinalIgnoreCase);
- var args = new GenericEventArgs<UpnpDeviceInfo>
- {
- Argument = new UpnpDeviceInfo
+ var args = new GenericEventArgs<UpnpDeviceInfo>(
+ new UpnpDeviceInfo
{
Location = e.DiscoveredDevice.DescriptionLocation,
Headers = headers
- }
- };
+ });
DeviceLeft?.Invoke(this, args);
}
diff --git a/Emby.Dlna/Ssdp/Extensions.cs b/Emby.Dlna/Ssdp/Extensions.cs
index 10c1f321b..613d332b2 100644
--- a/Emby.Dlna/Ssdp/Extensions.cs
+++ b/Emby.Dlna/Ssdp/Extensions.cs
@@ -1,5 +1,6 @@
#pragma warning disable CS1591
+using System.Linq;
using System.Xml.Linq;
namespace Emby.Dlna.Ssdp
@@ -10,24 +11,17 @@ namespace Emby.Dlna.Ssdp
{
var node = container.Element(name);
- return node == null ? null : node.Value;
+ return node?.Value;
}
public static string GetAttributeValue(this XElement container, XName name)
{
var node = container.Attribute(name);
- return node == null ? null : node.Value;
+ return node?.Value;
}
public static string GetDescendantValue(this XElement container, XName name)
- {
- foreach (var node in container.Descendants(name))
- {
- return node.Value;
- }
-
- return null;
- }
+ => container.Descendants(name).FirstOrDefault()?.Value;
}
}
diff --git a/Emby.Drawing/ImageProcessor.cs b/Emby.Drawing/ImageProcessor.cs
index b9172d2a8..4e62649db 100644
--- a/Emby.Drawing/ImageProcessor.cs
+++ b/Emby.Drawing/ImageProcessor.cs
@@ -116,7 +116,7 @@ namespace Emby.Drawing
=> _transparentImageTypes.Contains(Path.GetExtension(path));
/// <inheritdoc />
- public async Task<(string path, string mimeType, DateTime dateModified)> ProcessImage(ImageProcessingOptions options)
+ public async Task<(string path, string? mimeType, DateTime dateModified)> ProcessImage(ImageProcessingOptions options)
{
ItemImageInfo originalImage = options.Image;
BaseItem item = options.Item;
@@ -232,7 +232,7 @@ namespace Emby.Drawing
return ImageFormat.Jpg;
}
- private string GetMimeType(ImageFormat format, string path)
+ private string? GetMimeType(ImageFormat format, string path)
=> format switch
{
ImageFormat.Bmp => MimeTypes.GetMimeType("i.bmp"),
@@ -316,6 +316,27 @@ namespace Emby.Drawing
=> _imageEncoder.GetImageSize(path);
/// <inheritdoc />
+ public string GetImageBlurHash(string path)
+ {
+ var size = GetImageDimensions(path);
+ if (size.Width <= 0 || size.Height <= 0)
+ {
+ return string.Empty;
+ }
+
+ // We want tiles to be as close to square as possible, and to *mostly* keep under 16 tiles for performance.
+ // One tile is (width / xComp) x (height / yComp) pixels, which means that ideally yComp = xComp * height / width.
+ // See more at https://github.com/woltapp/blurhash/#how-do-i-pick-the-number-of-x-and-y-components
+ float xCompF = MathF.Sqrt(16.0f * size.Width / size.Height);
+ float yCompF = xCompF * size.Height / size.Width;
+
+ int xComp = Math.Min((int)xCompF + 1, 9);
+ int yComp = Math.Min((int)yCompF + 1, 9);
+
+ return _imageEncoder.GetImageBlurHash(xComp, yComp, path);
+ }
+
+ /// <inheritdoc />
public string GetImageCacheTag(BaseItem item, ItemImageInfo image)
=> (item.Path + image.DateModified.Ticks).GetMD5().ToString("N", CultureInfo.InvariantCulture);
diff --git a/Emby.Drawing/NullImageEncoder.cs b/Emby.Drawing/NullImageEncoder.cs
index 5af7f1622..bbb5c1716 100644
--- a/Emby.Drawing/NullImageEncoder.cs
+++ b/Emby.Drawing/NullImageEncoder.cs
@@ -42,5 +42,11 @@ namespace Emby.Drawing
{
throw new NotImplementedException();
}
+
+ /// <inheritdoc />
+ public string GetImageBlurHash(int xComp, int yComp, string path)
+ {
+ throw new NotImplementedException();
+ }
}
}
diff --git a/Emby.Naming/Common/NamingOptions.cs b/Emby.Naming/Common/NamingOptions.cs
index a2d75d0b8..1b343790e 100644
--- a/Emby.Naming/Common/NamingOptions.cs
+++ b/Emby.Naming/Common/NamingOptions.cs
@@ -142,7 +142,7 @@ namespace Emby.Naming.Common
CleanStrings = new[]
{
- @"[ _\,\.\(\)\[\]\-](3d|sbs|tab|hsbs|htab|mvc|HDR|HDC|UHD|UltraHD|4k|ac3|dts|custom|dc|divx|divx5|dsr|dsrip|dutch|dvd|dvdrip|dvdscr|dvdscreener|screener|dvdivx|cam|fragment|fs|hdtv|hdrip|hdtvrip|internal|limited|multisubs|ntsc|ogg|ogm|pal|pdtv|proper|repack|rerip|retail|cd[1-9]|r3|r5|bd5|se|svcd|swedish|german|read.nfo|nfofix|unrated|ws|telesync|ts|telecine|tc|brrip|bdrip|480p|480i|576p|576i|720p|720i|1080p|1080i|2160p|hrhd|hrhdtv|hddvd|bluray|x264|h264|xvid|xvidvd|xxx|www.www|\[.*\])([ _\,\.\(\)\[\]\-]|$)",
+ @"[ _\,\.\(\)\[\]\-](3d|sbs|tab|hsbs|htab|mvc|HDR|HDC|UHD|UltraHD|4k|ac3|dts|custom|dc|divx|divx5|dsr|dsrip|dutch|dvd|dvdrip|dvdscr|dvdscreener|screener|dvdivx|cam|fragment|fs|hdtv|hdrip|hdtvrip|internal|limited|multisubs|ntsc|ogg|ogm|pal|pdtv|proper|repack|rerip|retail|cd[1-9]|r3|r5|bd5|bd|se|svcd|swedish|german|read.nfo|nfofix|unrated|ws|telesync|ts|telecine|tc|brrip|bdrip|480p|480i|576p|576i|720p|720i|1080p|1080i|2160p|hrhd|hrhdtv|hddvd|bluray|x264|h264|xvid|xvidvd|xxx|www.www|\[.*\])([ _\,\.\(\)\[\]\-]|$)",
@"(\[.*\])"
};
diff --git a/Emby.Server.Implementations/Activity/ActivityLogEntryPoint.cs b/Emby.Server.Implementations/Activity/ActivityLogEntryPoint.cs
index 05aa44338..84bec9201 100644
--- a/Emby.Server.Implementations/Activity/ActivityLogEntryPoint.cs
+++ b/Emby.Server.Implementations/Activity/ActivityLogEntryPoint.cs
@@ -366,50 +366,50 @@ namespace Emby.Server.Implementations.Activity
}).ConfigureAwait(false);
}
- private async void OnPluginUpdated(object sender, GenericEventArgs<(IPlugin, VersionInfo)> e)
+ private async void OnPluginUpdated(object sender, InstallationInfo e)
{
await CreateLogEntry(new ActivityLog(
string.Format(
CultureInfo.InvariantCulture,
_localization.GetLocalizedString("PluginUpdatedWithName"),
- e.Argument.Item1.Name),
+ e.Name),
NotificationType.PluginUpdateInstalled.ToString(),
Guid.Empty)
{
ShortOverview = string.Format(
CultureInfo.InvariantCulture,
_localization.GetLocalizedString("VersionNumber"),
- e.Argument.Item2.version),
- Overview = e.Argument.Item2.changelog
+ e.Version),
+ Overview = e.Changelog
}).ConfigureAwait(false);
}
- private async void OnPluginUninstalled(object sender, GenericEventArgs<IPlugin> e)
+ private async void OnPluginUninstalled(object sender, IPlugin e)
{
await CreateLogEntry(new ActivityLog(
string.Format(
CultureInfo.InvariantCulture,
_localization.GetLocalizedString("PluginUninstalledWithName"),
- e.Argument.Name),
+ e.Name),
NotificationType.PluginUninstalled.ToString(),
Guid.Empty))
.ConfigureAwait(false);
}
- private async void OnPluginInstalled(object sender, GenericEventArgs<VersionInfo> e)
+ private async void OnPluginInstalled(object sender, InstallationInfo e)
{
await CreateLogEntry(new ActivityLog(
string.Format(
CultureInfo.InvariantCulture,
_localization.GetLocalizedString("PluginInstalledWithName"),
- e.Argument.name),
+ e.Name),
NotificationType.PluginInstalled.ToString(),
Guid.Empty)
{
ShortOverview = string.Format(
CultureInfo.InvariantCulture,
_localization.GetLocalizedString("VersionNumber"),
- e.Argument.version)
+ e.Version)
}).ConfigureAwait(false);
}
diff --git a/Emby.Server.Implementations/Channels/ChannelManager.cs b/Emby.Server.Implementations/Channels/ChannelManager.cs
index d6d47d63a..9784eb3cf 100644
--- a/Emby.Server.Implementations/Channels/ChannelManager.cs
+++ b/Emby.Server.Implementations/Channels/ChannelManager.cs
@@ -57,7 +57,7 @@ namespace Emby.Server.Implementations.Channels
/// <param name="userManager">The user manager.</param>
/// <param name="dtoService">The dto service.</param>
/// <param name="libraryManager">The library manager.</param>
- /// <param name="loggerFactory">The logger factory.</param>
+ /// <param name="logger">The logger.</param>
/// <param name="config">The server configuration manager.</param>
/// <param name="fileSystem">The filesystem.</param>
/// <param name="userDataManager">The user data manager.</param>
diff --git a/Emby.Server.Implementations/Configuration/ServerConfigurationManager.cs b/Emby.Server.Implementations/Configuration/ServerConfigurationManager.cs
index 305e67e8c..94ee1ced7 100644
--- a/Emby.Server.Implementations/Configuration/ServerConfigurationManager.cs
+++ b/Emby.Server.Implementations/Configuration/ServerConfigurationManager.cs
@@ -90,7 +90,7 @@ namespace Emby.Server.Implementations.Configuration
ValidateMetadataPath(newConfig);
ValidateSslCertificate(newConfig);
- ConfigurationUpdating?.Invoke(this, new GenericEventArgs<ServerConfiguration> { Argument = newConfig });
+ ConfigurationUpdating?.Invoke(this, new GenericEventArgs<ServerConfiguration>(newConfig));
base.ReplaceConfiguration(newConfiguration);
}
diff --git a/Emby.Server.Implementations/Cryptography/CryptographyProvider.cs b/Emby.Server.Implementations/Cryptography/CryptographyProvider.cs
index a037415a9..fd302d136 100644
--- a/Emby.Server.Implementations/Cryptography/CryptographyProvider.cs
+++ b/Emby.Server.Implementations/Cryptography/CryptographyProvider.cs
@@ -1,3 +1,5 @@
+#nullable enable
+
using System;
using System.Collections.Generic;
using System.Security.Cryptography;
@@ -129,8 +131,6 @@ namespace Emby.Server.Implementations.Cryptography
_randomNumberGenerator.Dispose();
}
- _randomNumberGenerator = null;
-
_disposed = true;
}
}
diff --git a/Emby.Server.Implementations/Data/SqliteItemRepository.cs b/Emby.Server.Implementations/Data/SqliteItemRepository.cs
index ca5cd6fdd..18d235c87 100644
--- a/Emby.Server.Implementations/Data/SqliteItemRepository.cs
+++ b/Emby.Server.Implementations/Data/SqliteItemRepository.cs
@@ -1,3 +1,5 @@
+#pragma warning disable CS1591
+
using System;
using System.Collections.Generic;
using System.Globalization;
@@ -33,7 +35,7 @@ using SQLitePCL.pretty;
namespace Emby.Server.Implementations.Data
{
/// <summary>
- /// Class SQLiteItemRepository
+ /// Class SQLiteItemRepository.
/// </summary>
public class SqliteItemRepository : BaseSqliteRepository, IItemRepository
{
@@ -1141,24 +1143,24 @@ namespace Emby.Server.Implementations.Data
public string ToValueString(ItemImageInfo image)
{
- var delimeter = "*";
-
- var path = image.Path;
+ const string Delimeter = "*";
- if (path == null)
- {
- path = string.Empty;
- }
+ var path = image.Path ?? string.Empty;
+ var hash = image.BlurHash ?? string.Empty;
return GetPathToSave(path) +
- delimeter +
+ Delimeter +
image.DateModified.Ticks.ToString(CultureInfo.InvariantCulture) +
- delimeter +
+ Delimeter +
image.Type +
- delimeter +
+ Delimeter +
image.Width.ToString(CultureInfo.InvariantCulture) +
- delimeter +
- image.Height.ToString(CultureInfo.InvariantCulture);
+ Delimeter +
+ image.Height.ToString(CultureInfo.InvariantCulture) +
+ Delimeter +
+ // Replace delimiters with other characters.
+ // This can be removed when we migrate to a proper DB.
+ hash.Replace('*', '/').Replace('|', '\\');
}
public ItemImageInfo ItemImageInfoFromValueString(string value)
@@ -1192,6 +1194,11 @@ namespace Emby.Server.Implementations.Data
image.Width = width;
image.Height = height;
}
+
+ if (parts.Length >= 6)
+ {
+ image.BlurHash = parts[5].Replace('/', '*').Replace('\\', '|');
+ }
}
return image;
@@ -1971,6 +1978,7 @@ namespace Emby.Server.Implementations.Data
/// Gets the chapter.
/// </summary>
/// <param name="reader">The reader.</param>
+ /// <param name="item">The item.</param>
/// <returns>ChapterInfo.</returns>
private ChapterInfo GetChapter(IReadOnlyList<IResultSetValue> reader, BaseItem item)
{
diff --git a/Emby.Server.Implementations/Devices/DeviceManager.cs b/Emby.Server.Implementations/Devices/DeviceManager.cs
index a3c53035f..f8896d69f 100644
--- a/Emby.Server.Implementations/Devices/DeviceManager.cs
+++ b/Emby.Server.Implementations/Devices/DeviceManager.cs
@@ -61,13 +61,7 @@ namespace Emby.Server.Implementations.Devices
{
_authRepo.UpdateDeviceOptions(deviceId, options);
- if (DeviceOptionsUpdated != null)
- {
- DeviceOptionsUpdated(this, new GenericEventArgs<Tuple<string, DeviceOptions>>()
- {
- Argument = new Tuple<string, DeviceOptions>(deviceId, options)
- });
- }
+ DeviceOptionsUpdated?.Invoke(this, new GenericEventArgs<Tuple<string, DeviceOptions>>(new Tuple<string, DeviceOptions>(deviceId, options)));
}
public DeviceOptions GetDeviceOptions(string deviceId)
diff --git a/Emby.Server.Implementations/Dto/DtoService.cs b/Emby.Server.Implementations/Dto/DtoService.cs
index aeb5b993b..34c7989a4 100644
--- a/Emby.Server.Implementations/Dto/DtoService.cs
+++ b/Emby.Server.Implementations/Dto/DtoService.cs
@@ -613,7 +613,7 @@ namespace Emby.Server.Implementations.Dto
if (dictionary.TryGetValue(person.Name, out Person entity))
{
- baseItemPerson.PrimaryImageTag = GetImageCacheTag(entity, ImageType.Primary);
+ baseItemPerson.PrimaryImageTag = GetTagAndFillBlurhash(dto, entity, ImageType.Primary);
baseItemPerson.Id = entity.Id.ToString("N", CultureInfo.InvariantCulture);
list.Add(baseItemPerson);
}
@@ -662,6 +662,70 @@ namespace Emby.Server.Implementations.Dto
return _libraryManager.GetGenreId(name);
}
+ private string GetTagAndFillBlurhash(BaseItemDto dto, BaseItem item, ImageType imageType, int imageIndex = 0)
+ {
+ var image = item.GetImageInfo(imageType, imageIndex);
+ if (image != null)
+ {
+ return GetTagAndFillBlurhash(dto, item, image);
+ }
+
+ return null;
+ }
+
+ private string GetTagAndFillBlurhash(BaseItemDto dto, BaseItem item, ItemImageInfo image)
+ {
+ var tag = GetImageCacheTag(item, image);
+ if (!string.IsNullOrEmpty(image.BlurHash))
+ {
+ if (dto.ImageBlurHashes == null)
+ {
+ dto.ImageBlurHashes = new Dictionary<ImageType, Dictionary<string, string>>();
+ }
+
+ if (!dto.ImageBlurHashes.ContainsKey(image.Type))
+ {
+ dto.ImageBlurHashes[image.Type] = new Dictionary<string, string>();
+ }
+
+ dto.ImageBlurHashes[image.Type][tag] = image.BlurHash;
+ }
+
+ return tag;
+ }
+
+ private string[] GetTagsAndFillBlurhashes(BaseItemDto dto, BaseItem item, ImageType imageType, int limit)
+ {
+ return GetTagsAndFillBlurhashes(dto, item, imageType, item.GetImages(imageType).Take(limit).ToList());
+ }
+
+ private string[] GetTagsAndFillBlurhashes(BaseItemDto dto, BaseItem item, ImageType imageType, List<ItemImageInfo> images)
+ {
+ var tags = GetImageTags(item, images);
+ var hashes = new Dictionary<string, string>();
+ for (int i = 0; i < images.Count; i++)
+ {
+ var img = images[i];
+ if (!string.IsNullOrEmpty(img.BlurHash))
+ {
+ var tag = tags[i];
+ hashes[tag] = img.BlurHash;
+ }
+ }
+
+ if (hashes.Count > 0)
+ {
+ if (dto.ImageBlurHashes == null)
+ {
+ dto.ImageBlurHashes = new Dictionary<ImageType, Dictionary<string, string>>();
+ }
+
+ dto.ImageBlurHashes[imageType] = hashes;
+ }
+
+ return tags;
+ }
+
/// <summary>
/// Sets simple property values on a DTOBaseItem
/// </summary>
@@ -682,8 +746,8 @@ namespace Emby.Server.Implementations.Dto
dto.LockData = item.IsLocked;
dto.ForcedSortName = item.ForcedSortName;
}
- dto.Container = item.Container;
+ dto.Container = item.Container;
dto.EndDate = item.EndDate;
if (options.ContainsField(ItemFields.ExternalUrls))
@@ -702,10 +766,12 @@ namespace Emby.Server.Implementations.Dto
dto.AspectRatio = hasAspectRatio.AspectRatio;
}
+ dto.ImageBlurHashes = new Dictionary<ImageType, Dictionary<string, string>>();
+
var backdropLimit = options.GetImageLimit(ImageType.Backdrop);
if (backdropLimit > 0)
{
- dto.BackdropImageTags = GetImageTags(item, item.GetImages(ImageType.Backdrop).Take(backdropLimit).ToList());
+ dto.BackdropImageTags = GetTagsAndFillBlurhashes(dto, item, ImageType.Backdrop, backdropLimit);
}
if (options.ContainsField(ItemFields.ScreenshotImageTags))
@@ -713,7 +779,7 @@ namespace Emby.Server.Implementations.Dto
var screenshotLimit = options.GetImageLimit(ImageType.Screenshot);
if (screenshotLimit > 0)
{
- dto.ScreenshotImageTags = GetImageTags(item, item.GetImages(ImageType.Screenshot).Take(screenshotLimit).ToList());
+ dto.ScreenshotImageTags = GetTagsAndFillBlurhashes(dto, item, ImageType.Screenshot, screenshotLimit);
}
}
@@ -729,12 +795,11 @@ namespace Emby.Server.Implementations.Dto
// Prevent implicitly captured closure
var currentItem = item;
- foreach (var image in currentItem.ImageInfos.Where(i => !currentItem.AllowsMultipleImages(i.Type))
- .ToList())
+ foreach (var image in currentItem.ImageInfos.Where(i => !currentItem.AllowsMultipleImages(i.Type)))
{
if (options.GetImageLimit(image.Type) > 0)
{
- var tag = GetImageCacheTag(item, image);
+ var tag = GetTagAndFillBlurhash(dto, item, image);
if (tag != null)
{
@@ -879,8 +944,7 @@ namespace Emby.Server.Implementations.Dto
if (albumParent != null)
{
dto.AlbumId = albumParent.Id;
-
- dto.AlbumPrimaryImageTag = GetImageCacheTag(albumParent, ImageType.Primary);
+ dto.AlbumPrimaryImageTag = GetTagAndFillBlurhash(dto, albumParent, ImageType.Primary);
}
//if (options.ContainsField(ItemFields.MediaSourceCount))
@@ -1107,7 +1171,7 @@ namespace Emby.Server.Implementations.Dto
episodeSeries = episodeSeries ?? episode.Series;
if (episodeSeries != null)
{
- dto.SeriesPrimaryImageTag = GetImageCacheTag(episodeSeries, ImageType.Primary);
+ dto.SeriesPrimaryImageTag = GetTagAndFillBlurhash(dto, episodeSeries, ImageType.Primary);
}
}
@@ -1153,7 +1217,7 @@ namespace Emby.Server.Implementations.Dto
series = series ?? season.Series;
if (series != null)
{
- dto.SeriesPrimaryImageTag = GetImageCacheTag(series, ImageType.Primary);
+ dto.SeriesPrimaryImageTag = GetTagAndFillBlurhash(dto, series, ImageType.Primary);
}
}
}
@@ -1283,7 +1347,7 @@ namespace Emby.Server.Implementations.Dto
if (image != null)
{
dto.ParentLogoItemId = GetDtoId(parent);
- dto.ParentLogoImageTag = GetImageCacheTag(parent, image);
+ dto.ParentLogoImageTag = GetTagAndFillBlurhash(dto, parent, image);
}
}
if (artLimit > 0 && !(imageTags != null && imageTags.ContainsKey(ImageType.Art)) && dto.ParentArtItemId == null)
@@ -1293,7 +1357,7 @@ namespace Emby.Server.Implementations.Dto
if (image != null)
{
dto.ParentArtItemId = GetDtoId(parent);
- dto.ParentArtImageTag = GetImageCacheTag(parent, image);
+ dto.ParentArtImageTag = GetTagAndFillBlurhash(dto, parent, image);
}
}
if (thumbLimit > 0 && !(imageTags != null && imageTags.ContainsKey(ImageType.Thumb)) && (dto.ParentThumbItemId == null || parent is Series) && !(parent is ICollectionFolder) && !(parent is UserView))
@@ -1303,7 +1367,7 @@ namespace Emby.Server.Implementations.Dto
if (image != null)
{
dto.ParentThumbItemId = GetDtoId(parent);
- dto.ParentThumbImageTag = GetImageCacheTag(parent, image);
+ dto.ParentThumbImageTag = GetTagAndFillBlurhash(dto, parent, image);
}
}
if (backdropLimit > 0 && !((dto.BackdropImageTags != null && dto.BackdropImageTags.Length > 0) || (dto.ParentBackdropImageTags != null && dto.ParentBackdropImageTags.Length > 0)))
@@ -1313,7 +1377,7 @@ namespace Emby.Server.Implementations.Dto
if (images.Count > 0)
{
dto.ParentBackdropItemId = GetDtoId(parent);
- dto.ParentBackdropImageTags = GetImageTags(parent, images);
+ dto.ParentBackdropImageTags = GetTagsAndFillBlurhashes(dto, parent, ImageType.Backdrop, images);
}
}
diff --git a/Emby.Server.Implementations/Emby.Server.Implementations.csproj b/Emby.Server.Implementations/Emby.Server.Implementations.csproj
index b69a126b3..279ec3098 100644
--- a/Emby.Server.Implementations/Emby.Server.Implementations.csproj
+++ b/Emby.Server.Implementations/Emby.Server.Implementations.csproj
@@ -54,6 +54,7 @@
<TargetFramework>netstandard2.1</TargetFramework>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
+ <TreatWarningsAsErrors Condition=" '$(Configuration)' == 'Release'" >true</TreatWarningsAsErrors>
</PropertyGroup>
<!-- Code Analyzers-->
diff --git a/Emby.Server.Implementations/EntryPoints/LibraryChangedNotifier.cs b/Emby.Server.Implementations/EntryPoints/LibraryChangedNotifier.cs
index 5c83e6ae9..511dea7d7 100644
--- a/Emby.Server.Implementations/EntryPoints/LibraryChangedNotifier.cs
+++ b/Emby.Server.Implementations/EntryPoints/LibraryChangedNotifier.cs
@@ -303,7 +303,7 @@ namespace Emby.Server.Implementations.EntryPoints
.Select(x => x.First())
.ToList();
- SendChangeNotifications(_itemsAdded.ToList(), itemsUpdated, _itemsRemoved.ToList(), foldersAddedTo, foldersRemovedFrom, CancellationToken.None);
+ SendChangeNotifications(_itemsAdded.ToList(), itemsUpdated, _itemsRemoved.ToList(), foldersAddedTo, foldersRemovedFrom, CancellationToken.None).GetAwaiter().GetResult();
if (LibraryUpdateTimer != null)
{
@@ -328,7 +328,7 @@ namespace Emby.Server.Implementations.EntryPoints
/// <param name="foldersAddedTo">The folders added to.</param>
/// <param name="foldersRemovedFrom">The folders removed from.</param>
/// <param name="cancellationToken">The cancellation token.</param>
- private async void SendChangeNotifications(List<BaseItem> itemsAdded, List<BaseItem> itemsUpdated, List<BaseItem> itemsRemoved, List<Folder> foldersAddedTo, List<Folder> foldersRemovedFrom, CancellationToken cancellationToken)
+ private async Task SendChangeNotifications(List<BaseItem> itemsAdded, List<BaseItem> itemsUpdated, List<BaseItem> itemsRemoved, List<Folder> foldersAddedTo, List<Folder> foldersRemovedFrom, CancellationToken cancellationToken)
{
var userIds = _sessionManager.Sessions
.Select(i => i.UserId)
diff --git a/Emby.Server.Implementations/EntryPoints/RecordingNotifier.cs b/Emby.Server.Implementations/EntryPoints/RecordingNotifier.cs
index 75dde5598..5624f9314 100644
--- a/Emby.Server.Implementations/EntryPoints/RecordingNotifier.cs
+++ b/Emby.Server.Implementations/EntryPoints/RecordingNotifier.cs
@@ -43,27 +43,27 @@ namespace Emby.Server.Implementations.EntryPoints
return Task.CompletedTask;
}
- private void OnLiveTvManagerSeriesTimerCreated(object sender, MediaBrowser.Model.Events.GenericEventArgs<TimerEventInfo> e)
+ private async void OnLiveTvManagerSeriesTimerCreated(object sender, MediaBrowser.Model.Events.GenericEventArgs<TimerEventInfo> e)
{
- SendMessage("SeriesTimerCreated", e.Argument);
+ await SendMessage("SeriesTimerCreated", e.Argument).ConfigureAwait(false);
}
- private void OnLiveTvManagerTimerCreated(object sender, MediaBrowser.Model.Events.GenericEventArgs<TimerEventInfo> e)
+ private async void OnLiveTvManagerTimerCreated(object sender, MediaBrowser.Model.Events.GenericEventArgs<TimerEventInfo> e)
{
- SendMessage("TimerCreated", e.Argument);
+ await SendMessage("TimerCreated", e.Argument).ConfigureAwait(false);
}
- private void OnLiveTvManagerSeriesTimerCancelled(object sender, MediaBrowser.Model.Events.GenericEventArgs<TimerEventInfo> e)
+ private async void OnLiveTvManagerSeriesTimerCancelled(object sender, MediaBrowser.Model.Events.GenericEventArgs<TimerEventInfo> e)
{
- SendMessage("SeriesTimerCancelled", e.Argument);
+ await SendMessage("SeriesTimerCancelled", e.Argument).ConfigureAwait(false);
}
- private void OnLiveTvManagerTimerCancelled(object sender, MediaBrowser.Model.Events.GenericEventArgs<TimerEventInfo> e)
+ private async void OnLiveTvManagerTimerCancelled(object sender, MediaBrowser.Model.Events.GenericEventArgs<TimerEventInfo> e)
{
- SendMessage("TimerCancelled", e.Argument);
+ await SendMessage("TimerCancelled", e.Argument).ConfigureAwait(false);
}
- private async void SendMessage(string name, TimerEventInfo info)
+ private async Task SendMessage(string name, TimerEventInfo info)
{
var users = _userManager.Users.Where(i => i.HasPermission(PermissionKind.EnableLiveTvAccess)).Select(i => i.Id).ToList();
diff --git a/Emby.Server.Implementations/EntryPoints/ServerEventNotifier.cs b/Emby.Server.Implementations/EntryPoints/ServerEventNotifier.cs
index 436d723f0..083fe4237 100644
--- a/Emby.Server.Implementations/EntryPoints/ServerEventNotifier.cs
+++ b/Emby.Server.Implementations/EntryPoints/ServerEventNotifier.cs
@@ -12,6 +12,7 @@ using MediaBrowser.Controller.Plugins;
using MediaBrowser.Controller.Session;
using MediaBrowser.Model.Events;
using MediaBrowser.Model.Tasks;
+using MediaBrowser.Model.Updates;
namespace Emby.Server.Implementations.EntryPoints
{
@@ -83,29 +84,29 @@ namespace Emby.Server.Implementations.EntryPoints
return Task.CompletedTask;
}
- private void OnPackageInstalling(object sender, InstallationEventArgs e)
+ private async void OnPackageInstalling(object sender, InstallationInfo e)
{
- SendMessageToAdminSessions("PackageInstalling", e.InstallationInfo);
+ await SendMessageToAdminSessions("PackageInstalling", e).ConfigureAwait(false);
}
- private void OnPackageInstallationCancelled(object sender, InstallationEventArgs e)
+ private async void OnPackageInstallationCancelled(object sender, InstallationInfo e)
{
- SendMessageToAdminSessions("PackageInstallationCancelled", e.InstallationInfo);
+ await SendMessageToAdminSessions("PackageInstallationCancelled", e).ConfigureAwait(false);
}
- private void OnPackageInstallationCompleted(object sender, InstallationEventArgs e)
+ private async void OnPackageInstallationCompleted(object sender, InstallationInfo e)
{
- SendMessageToAdminSessions("PackageInstallationCompleted", e.InstallationInfo);
+ await SendMessageToAdminSessions("PackageInstallationCompleted", e).ConfigureAwait(false);
}
- private void OnPackageInstallationFailed(object sender, InstallationFailedEventArgs e)
+ private async void OnPackageInstallationFailed(object sender, InstallationFailedEventArgs e)
{
- SendMessageToAdminSessions("PackageInstallationFailed", e.InstallationInfo);
+ await SendMessageToAdminSessions("PackageInstallationFailed", e.InstallationInfo).ConfigureAwait(false);
}
- private void OnTaskCompleted(object sender, TaskCompletionEventArgs e)
+ private async void OnTaskCompleted(object sender, TaskCompletionEventArgs e)
{
- SendMessageToAdminSessions("ScheduledTaskEnded", e.Result);
+ await SendMessageToAdminSessions("ScheduledTaskEnded", e.Result).ConfigureAwait(false);
}
/// <summary>
@@ -113,9 +114,9 @@ namespace Emby.Server.Implementations.EntryPoints
/// </summary>
/// <param name="sender">The sender.</param>
/// <param name="e">The e.</param>
- private void OnPluginUninstalled(object sender, GenericEventArgs<IPlugin> e)
+ private async void OnPluginUninstalled(object sender, IPlugin e)
{
- SendMessageToAdminSessions("PluginUninstalled", e.Argument.GetPluginInfo());
+ await SendMessageToAdminSessions("PluginUninstalled", e).ConfigureAwait(false);
}
/// <summary>
@@ -123,9 +124,9 @@ namespace Emby.Server.Implementations.EntryPoints
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The <see cref="EventArgs" /> instance containing the event data.</param>
- private void OnHasPendingRestartChanged(object sender, EventArgs e)
+ private async void OnHasPendingRestartChanged(object sender, EventArgs e)
{
- _sessionManager.SendRestartRequiredNotification(CancellationToken.None);
+ await _sessionManager.SendRestartRequiredNotification(CancellationToken.None).ConfigureAwait(false);
}
/// <summary>
@@ -133,11 +134,11 @@ namespace Emby.Server.Implementations.EntryPoints
/// </summary>
/// <param name="sender">The sender.</param>
/// <param name="e">The e.</param>
- private void OnUserUpdated(object sender, GenericEventArgs<User> e)
+ private async void OnUserUpdated(object sender, GenericEventArgs<User> e)
{
var dto = _userManager.GetUserDto(e.Argument);
- SendMessageToUserSession(e.Argument, "UserUpdated", dto);
+ await SendMessageToUserSession(e.Argument, "UserUpdated", dto).ConfigureAwait(false);
}
/// <summary>
@@ -145,12 +146,12 @@ namespace Emby.Server.Implementations.EntryPoints
/// </summary>
/// <param name="sender">The sender.</param>
/// <param name="e">The e.</param>
- private void OnUserDeleted(object sender, GenericEventArgs<User> e)
+ private async void OnUserDeleted(object sender, GenericEventArgs<User> e)
{
- SendMessageToUserSession(e.Argument, "UserDeleted", e.Argument.Id.ToString("N", CultureInfo.InvariantCulture));
+ await SendMessageToUserSession(e.Argument, "UserDeleted", e.Argument.Id.ToString("N", CultureInfo.InvariantCulture)).ConfigureAwait(false);
}
- private async void SendMessageToAdminSessions<T>(string name, T data)
+ private async Task SendMessageToAdminSessions<T>(string name, T data)
{
try
{
@@ -162,7 +163,7 @@ namespace Emby.Server.Implementations.EntryPoints
}
}
- private async void SendMessageToUserSession<T>(User user, string name, T data)
+ private async Task SendMessageToUserSession<T>(User user, string name, T data)
{
try
{
@@ -196,7 +197,6 @@ namespace Emby.Server.Implementations.EntryPoints
_userManager.OnUserDeleted -= OnUserDeleted;
_userManager.OnUserUpdated -= OnUserUpdated;
-
_installationManager.PluginUninstalled -= OnPluginUninstalled;
_installationManager.PackageInstalling -= OnPackageInstalling;
_installationManager.PackageInstallationCancelled -= OnPackageInstallationCancelled;
diff --git a/Emby.Server.Implementations/EntryPoints/UdpServerEntryPoint.cs b/Emby.Server.Implementations/EntryPoints/UdpServerEntryPoint.cs
index 6929c81f9..5bc1a81aa 100644
--- a/Emby.Server.Implementations/EntryPoints/UdpServerEntryPoint.cs
+++ b/Emby.Server.Implementations/EntryPoints/UdpServerEntryPoint.cs
@@ -47,10 +47,11 @@ namespace Emby.Server.Implementations.EntryPoints
}
/// <inheritdoc />
- public async Task RunAsync()
+ public Task RunAsync()
{
_udpServer = new UdpServer(_logger, _appHost, _config);
_udpServer.Start(PortNumber, _cancellationTokenSource.Token);
+ return Task.CompletedTask;
}
/// <inheritdoc />
diff --git a/Emby.Server.Implementations/HttpServer/HttpResultFactory.cs b/Emby.Server.Implementations/HttpServer/HttpResultFactory.cs
index 2e9ecc4ae..9d5969583 100644
--- a/Emby.Server.Implementations/HttpServer/HttpResultFactory.cs
+++ b/Emby.Server.Implementations/HttpServer/HttpResultFactory.cs
@@ -56,6 +56,7 @@ namespace Emby.Server.Implementations.HttpServer
/// <summary>
/// Gets the result.
/// </summary>
+ /// <param name="requestContext">The request context.</param>
/// <param name="content">The content.</param>
/// <param name="contentType">Type of the content.</param>
/// <param name="responseHeaders">The response headers.</param>
@@ -255,16 +256,20 @@ namespace Emby.Server.Implementations.HttpServer
{
var acceptEncoding = request.Headers[HeaderNames.AcceptEncoding].ToString();
- if (string.IsNullOrEmpty(acceptEncoding))
+ if (!string.IsNullOrEmpty(acceptEncoding))
{
- //if (_brotliCompressor != null && acceptEncoding.IndexOf("br", StringComparison.OrdinalIgnoreCase) != -1)
+ // if (_brotliCompressor != null && acceptEncoding.IndexOf("br", StringComparison.OrdinalIgnoreCase) != -1)
// return "br";
- if (acceptEncoding.IndexOf("deflate", StringComparison.OrdinalIgnoreCase) != -1)
+ if (acceptEncoding.Contains("deflate", StringComparison.OrdinalIgnoreCase))
+ {
return "deflate";
+ }
- if (acceptEncoding.IndexOf("gzip", StringComparison.OrdinalIgnoreCase) != -1)
+ if (acceptEncoding.Contains("gzip", StringComparison.OrdinalIgnoreCase))
+ {
return "gzip";
+ }
}
return null;
diff --git a/Emby.Server.Implementations/IStartupOptions.cs b/Emby.Server.Implementations/IStartupOptions.cs
index acae702f3..0b9f80538 100644
--- a/Emby.Server.Implementations/IStartupOptions.cs
+++ b/Emby.Server.Implementations/IStartupOptions.cs
@@ -1,3 +1,5 @@
+#pragma warning disable CS1591
+
using System;
namespace Emby.Server.Implementations
diff --git a/Emby.Server.Implementations/Images/ArtistImageProvider.cs b/Emby.Server.Implementations/Images/ArtistImageProvider.cs
new file mode 100644
index 000000000..7fa13a49f
--- /dev/null
+++ b/Emby.Server.Implementations/Images/ArtistImageProvider.cs
@@ -0,0 +1,47 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using Emby.Server.Implementations.Images;
+using MediaBrowser.Common.Configuration;
+using MediaBrowser.Controller.Drawing;
+using MediaBrowser.Controller.Dto;
+using MediaBrowser.Controller.Entities;
+using MediaBrowser.Controller.Entities.Audio;
+using MediaBrowser.Controller.Entities.Movies;
+using MediaBrowser.Controller.Entities.TV;
+using MediaBrowser.Controller.Library;
+using MediaBrowser.Controller.Playlists;
+using MediaBrowser.Controller.Providers;
+using MediaBrowser.Model.Entities;
+using MediaBrowser.Model.IO;
+using MediaBrowser.Model.Querying;
+
+namespace Emby.Server.Implementations.Images
+{
+ public class ArtistImageProvider : BaseDynamicImageProvider<MusicArtist>
+ {
+ private readonly ILibraryManager _libraryManager;
+
+ public ArtistImageProvider(IFileSystem fileSystem, IProviderManager providerManager, IApplicationPaths applicationPaths, IImageProcessor imageProcessor, ILibraryManager libraryManager) : base(fileSystem, providerManager, applicationPaths, imageProcessor)
+ {
+ _libraryManager = libraryManager;
+ }
+
+ protected override IReadOnlyList<BaseItem> GetItemsWithImages(BaseItem item)
+ {
+ return Array.Empty<BaseItem>();
+
+ // TODO enable this when BaseDynamicImageProvider objects are configurable
+ // return _libraryManager.GetItemList(new InternalItemsQuery
+ // {
+ // ArtistIds = new[] { item.Id },
+ // IncludeItemTypes = new[] { typeof(MusicAlbum).Name },
+ // OrderBy = new[] { (ItemSortBy.Random, SortOrder.Ascending) },
+ // Limit = 4,
+ // Recursive = true,
+ // ImageTypes = new[] { ImageType.Primary },
+ // DtoOptions = new DtoOptions(false)
+ // });
+ }
+ }
+}
diff --git a/Emby.Server.Implementations/Images/BaseDynamicImageProvider.cs b/Emby.Server.Implementations/Images/BaseDynamicImageProvider.cs
index fd50f156a..57302b506 100644
--- a/Emby.Server.Implementations/Images/BaseDynamicImageProvider.cs
+++ b/Emby.Server.Implementations/Images/BaseDynamicImageProvider.cs
@@ -194,7 +194,8 @@ namespace Emby.Server.Implementations.Images
return outputPath;
}
- protected virtual string CreateImage(BaseItem item,
+ protected virtual string CreateImage(
+ BaseItem item,
IReadOnlyCollection<BaseItem> itemsWithImages,
string outputPathWithoutExtension,
ImageType imageType,
@@ -214,7 +215,12 @@ namespace Emby.Server.Implementations.Images
if (imageType == ImageType.Primary)
{
- if (item is UserView || item is Playlist || item is MusicGenre || item is Genre || item is PhotoAlbum)
+ if (item is UserView
+ || item is Playlist
+ || item is MusicGenre
+ || item is Genre
+ || item is PhotoAlbum
+ || item is MusicArtist)
{
return CreateSquareCollage(item, itemsWithImages, outputPath);
}
@@ -225,7 +231,7 @@ namespace Emby.Server.Implementations.Images
throw new ArgumentException("Unexpected image type", nameof(imageType));
}
- public bool HasChanged(BaseItem item, IDirectoryService directoryServicee)
+ public bool HasChanged(BaseItem item, IDirectoryService directoryService)
{
if (!Supports(item))
{
@@ -236,6 +242,7 @@ namespace Emby.Server.Implementations.Images
{
return true;
}
+
if (SupportedImages.Contains(ImageType.Thumb) && HasChanged(item, ImageType.Thumb))
{
return true;
diff --git a/Emby.Server.Implementations/UserViews/CollectionFolderImageProvider.cs b/Emby.Server.Implementations/Images/CollectionFolderImageProvider.cs
index a3f3f6cb4..dc8062b45 100644
--- a/Emby.Server.Implementations/UserViews/CollectionFolderImageProvider.cs
+++ b/Emby.Server.Implementations/Images/CollectionFolderImageProvider.cs
@@ -1,3 +1,5 @@
+#pragma warning disable CS1591
+
using System;
using System.Collections.Generic;
using System.IO;
@@ -11,7 +13,7 @@ using MediaBrowser.Model.Entities;
using MediaBrowser.Model.IO;
using MediaBrowser.Model.Querying;
-namespace Emby.Server.Implementations.UserViews
+namespace Emby.Server.Implementations.Images
{
public class CollectionFolderImageProvider : BaseDynamicImageProvider<CollectionFolder>
{
diff --git a/Emby.Server.Implementations/UserViews/DynamicImageProvider.cs b/Emby.Server.Implementations/Images/DynamicImageProvider.cs
index 78ac95f85..ca0aa4a9f 100644
--- a/Emby.Server.Implementations/UserViews/DynamicImageProvider.cs
+++ b/Emby.Server.Implementations/Images/DynamicImageProvider.cs
@@ -1,3 +1,5 @@
+#pragma warning disable CS1591
+
using System;
using System.Collections.Generic;
using System.IO;
@@ -14,18 +16,16 @@ using MediaBrowser.Controller.Providers;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.IO;
-namespace Emby.Server.Implementations.UserViews
+namespace Emby.Server.Implementations.Images
{
public class DynamicImageProvider : BaseDynamicImageProvider<UserView>
{
private readonly IUserManager _userManager;
- private readonly ILibraryManager _libraryManager;
- public DynamicImageProvider(IFileSystem fileSystem, IProviderManager providerManager, IApplicationPaths applicationPaths, IImageProcessor imageProcessor, IUserManager userManager, ILibraryManager libraryManager)
+ public DynamicImageProvider(IFileSystem fileSystem, IProviderManager providerManager, IApplicationPaths applicationPaths, IImageProcessor imageProcessor, IUserManager userManager)
: base(fileSystem, providerManager, applicationPaths, imageProcessor)
{
_userManager = userManager;
- _libraryManager = libraryManager;
}
protected override IReadOnlyList<BaseItem> GetItemsWithImages(BaseItem item)
diff --git a/Emby.Server.Implementations/UserViews/FolderImageProvider.cs b/Emby.Server.Implementations/Images/FolderImageProvider.cs
index 4655cd928..e9523386e 100644
--- a/Emby.Server.Implementations/UserViews/FolderImageProvider.cs
+++ b/Emby.Server.Implementations/Images/FolderImageProvider.cs
@@ -1,3 +1,5 @@
+#pragma warning disable CS1591
+
using System.Collections.Generic;
using Emby.Server.Implementations.Images;
using MediaBrowser.Common.Configuration;
@@ -11,7 +13,7 @@ using MediaBrowser.Model.Entities;
using MediaBrowser.Model.IO;
using MediaBrowser.Model.Querying;
-namespace Emby.Server.Implementations.UserViews
+namespace Emby.Server.Implementations.Images
{
public abstract class BaseFolderImageProvider<T> : BaseDynamicImageProvider<T>
where T : Folder, new()
@@ -75,16 +77,12 @@ namespace Emby.Server.Implementations.UserViews
return false;
}
- var folder = item as Folder;
- if (folder != null)
+ if (item is Folder && item.IsTopParent)
{
- if (folder.IsTopParent)
- {
- return false;
- }
+ return false;
}
+
return true;
- //return item.SourceType == SourceType.Library;
}
}
diff --git a/Emby.Server.Implementations/Playlists/PlaylistImageProvider.cs b/Emby.Server.Implementations/Images/GenreImageProvider.cs
index bb56d9771..a184ed4f5 100644
--- a/Emby.Server.Implementations/Playlists/PlaylistImageProvider.cs
+++ b/Emby.Server.Implementations/Images/GenreImageProvider.cs
@@ -1,3 +1,4 @@
+using System;
using System.Collections.Generic;
using System.Linq;
using Emby.Server.Implementations.Images;
@@ -15,58 +16,8 @@ using MediaBrowser.Model.Entities;
using MediaBrowser.Model.IO;
using MediaBrowser.Model.Querying;
-namespace Emby.Server.Implementations.Playlists
+namespace Emby.Server.Implementations.Images
{
- public class PlaylistImageProvider : BaseDynamicImageProvider<Playlist>
- {
- public PlaylistImageProvider(IFileSystem fileSystem, IProviderManager providerManager, IApplicationPaths applicationPaths, IImageProcessor imageProcessor) : base(fileSystem, providerManager, applicationPaths, imageProcessor)
- {
- }
-
- protected override IReadOnlyList<BaseItem> GetItemsWithImages(BaseItem item)
- {
- var playlist = (Playlist)item;
-
- return playlist.GetManageableItems()
- .Select(i =>
- {
- var subItem = i.Item2;
-
- var episode = subItem as Episode;
-
- if (episode != null)
- {
- var series = episode.Series;
- if (series != null && series.HasImage(ImageType.Primary))
- {
- return series;
- }
- }
-
- if (subItem.HasImage(ImageType.Primary))
- {
- return subItem;
- }
-
- var parent = subItem.GetOwner() ?? subItem.GetParent();
-
- if (parent != null && parent.HasImage(ImageType.Primary))
- {
- if (parent is MusicAlbum)
- {
- return parent;
- }
- }
-
- return null;
- })
- .Where(i => i != null)
- .GroupBy(x => x.Id)
- .Select(x => x.First())
- .ToList();
- }
- }
-
public class MusicGenreImageProvider : BaseDynamicImageProvider<MusicGenre>
{
private readonly ILibraryManager _libraryManager;
diff --git a/Emby.Server.Implementations/Images/PlaylistImageProvider.cs b/Emby.Server.Implementations/Images/PlaylistImageProvider.cs
new file mode 100644
index 000000000..0ce1b91e8
--- /dev/null
+++ b/Emby.Server.Implementations/Images/PlaylistImageProvider.cs
@@ -0,0 +1,66 @@
+#pragma warning disable CS1591
+
+using System.Collections.Generic;
+using System.Linq;
+using MediaBrowser.Common.Configuration;
+using MediaBrowser.Controller.Drawing;
+using MediaBrowser.Controller.Entities;
+using MediaBrowser.Controller.Entities.Audio;
+using MediaBrowser.Controller.Entities.TV;
+using MediaBrowser.Controller.Playlists;
+using MediaBrowser.Controller.Providers;
+using MediaBrowser.Model.Entities;
+using MediaBrowser.Model.IO;
+
+namespace Emby.Server.Implementations.Images
+{
+ public class PlaylistImageProvider : BaseDynamicImageProvider<Playlist>
+ {
+ public PlaylistImageProvider(IFileSystem fileSystem, IProviderManager providerManager, IApplicationPaths applicationPaths, IImageProcessor imageProcessor) : base(fileSystem, providerManager, applicationPaths, imageProcessor)
+ {
+ }
+
+ protected override IReadOnlyList<BaseItem> GetItemsWithImages(BaseItem item)
+ {
+ var playlist = (Playlist)item;
+
+ return playlist.GetManageableItems()
+ .Select(i =>
+ {
+ var subItem = i.Item2;
+
+ var episode = subItem as Episode;
+
+ if (episode != null)
+ {
+ var series = episode.Series;
+ if (series != null && series.HasImage(ImageType.Primary))
+ {
+ return series;
+ }
+ }
+
+ if (subItem.HasImage(ImageType.Primary))
+ {
+ return subItem;
+ }
+
+ var parent = subItem.GetOwner() ?? subItem.GetParent();
+
+ if (parent != null && parent.HasImage(ImageType.Primary))
+ {
+ if (parent is MusicAlbum)
+ {
+ return parent;
+ }
+ }
+
+ return null;
+ })
+ .Where(i => i != null)
+ .GroupBy(x => x.Id)
+ .Select(x => x.First())
+ .ToList();
+ }
+ }
+}
diff --git a/Emby.Server.Implementations/Library/LibraryManager.cs b/Emby.Server.Implementations/Library/LibraryManager.cs
index ebba4fb9d..2185795a6 100644
--- a/Emby.Server.Implementations/Library/LibraryManager.cs
+++ b/Emby.Server.Implementations/Library/LibraryManager.cs
@@ -23,6 +23,7 @@ using MediaBrowser.Common.Extensions;
using MediaBrowser.Common.Progress;
using MediaBrowser.Controller;
using MediaBrowser.Controller.Configuration;
+using MediaBrowser.Controller.Drawing;
using MediaBrowser.Controller.Dto;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Entities.Audio;
@@ -36,6 +37,7 @@ using MediaBrowser.Controller.Resolvers;
using MediaBrowser.Controller.Sorting;
using MediaBrowser.Model.Configuration;
using MediaBrowser.Model.Dlna;
+using MediaBrowser.Model.Drawing;
using MediaBrowser.Model.Dto;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.IO;
@@ -54,7 +56,7 @@ using VideoResolver = Emby.Naming.Video.VideoResolver;
namespace Emby.Server.Implementations.Library
{
/// <summary>
- /// Class LibraryManager
+ /// Class LibraryManager.
/// </summary>
public class LibraryManager : ILibraryManager
{
@@ -71,6 +73,7 @@ namespace Emby.Server.Implementations.Library
private readonly IFileSystem _fileSystem;
private readonly IItemRepository _itemRepository;
private readonly ConcurrentDictionary<Guid, BaseItem> _libraryItemsCache;
+ private readonly IImageProcessor _imageProcessor;
private NamingOptions _namingOptions;
private string[] _videoFileExtensions;
@@ -139,6 +142,13 @@ namespace Emby.Server.Implementations.Library
/// <param name="userManager">The user manager.</param>
/// <param name="configurationManager">The configuration manager.</param>
/// <param name="userDataRepository">The user data repository.</param>
+ /// <param name="libraryMonitorFactory">The library monitor.</param>
+ /// <param name="fileSystem">The file system.</param>
+ /// <param name="providerManagerFactory">The provider manager.</param>
+ /// <param name="userviewManagerFactory">The userview manager.</param>
+ /// <param name="mediaEncoder">The media encoder.</param>
+ /// <param name="itemRepository">The item repository.</param>
+ /// <param name="imageProcessor">The image processor.</param>
public LibraryManager(
IServerApplicationHost appHost,
ILogger<LibraryManager> logger,
@@ -151,7 +161,8 @@ namespace Emby.Server.Implementations.Library
Lazy<IProviderManager> providerManagerFactory,
Lazy<IUserViewManager> userviewManagerFactory,
IMediaEncoder mediaEncoder,
- IItemRepository itemRepository)
+ IItemRepository itemRepository,
+ IImageProcessor imageProcessor)
{
_appHost = appHost;
_logger = logger;
@@ -165,6 +176,7 @@ namespace Emby.Server.Implementations.Library
_userviewManagerFactory = userviewManagerFactory;
_mediaEncoder = mediaEncoder;
_itemRepository = itemRepository;
+ _imageProcessor = imageProcessor;
_libraryItemsCache = new ConcurrentDictionary<Guid, BaseItem>();
@@ -1820,10 +1832,90 @@ namespace Emby.Server.Implementations.Library
}
}
- public void UpdateImages(BaseItem item)
+ private bool ImageNeedsRefresh(ItemImageInfo image)
{
- _itemRepository.SaveImages(item);
+ if (image.Path != null && image.IsLocalFile)
+ {
+ if (image.Width == 0 || image.Height == 0 || string.IsNullOrEmpty(image.BlurHash))
+ {
+ return true;
+ }
+ try
+ {
+ return _fileSystem.GetLastWriteTimeUtc(image.Path) != image.DateModified;
+ }
+ catch (Exception ex)
+ {
+ _logger.LogError(ex, "Cannot get file info for {0}", image.Path);
+ return false;
+ }
+ }
+
+ return image.Path != null && !image.IsLocalFile;
+ }
+
+ public void UpdateImages(BaseItem item, bool forceUpdate = false)
+ {
+ if (item == null)
+ {
+ throw new ArgumentNullException(nameof(item));
+ }
+
+ var outdated = forceUpdate ? item.ImageInfos.Where(i => i.Path != null).ToArray() : item.ImageInfos.Where(ImageNeedsRefresh).ToArray();
+ if (outdated.Length == 0)
+ {
+ RegisterItem(item);
+ return;
+ }
+
+ foreach (var img in outdated)
+ {
+ var image = img;
+ if (!img.IsLocalFile)
+ {
+ try
+ {
+ var index = item.GetImageIndex(img);
+ image = ConvertImageToLocal(item, img, index).ConfigureAwait(false).GetAwaiter().GetResult();
+ }
+ catch (ArgumentException)
+ {
+ _logger.LogWarning("Cannot get image index for {0}", img.Path);
+ continue;
+ }
+ catch (InvalidOperationException)
+ {
+ _logger.LogWarning("Cannot fetch image from {0}", img.Path);
+ continue;
+ }
+ }
+
+ ImageDimensions size = _imageProcessor.GetImageDimensions(item, image);
+ image.Width = size.Width;
+ image.Height = size.Height;
+
+ try
+ {
+ image.BlurHash = _imageProcessor.GetImageBlurHash(image.Path);
+ }
+ catch (Exception ex)
+ {
+ _logger.LogError(ex, "Cannot compute blurhash for {0}", image.Path);
+ image.BlurHash = string.Empty;
+ }
+
+ try
+ {
+ image.DateModified = _fileSystem.GetLastWriteTimeUtc(image.Path);
+ }
+ catch (Exception ex)
+ {
+ _logger.LogError(ex, "Cannot update DateModified for {0}", image.Path);
+ }
+ }
+
+ _itemRepository.SaveImages(item);
RegisterItem(item);
}
@@ -1844,7 +1936,7 @@ namespace Emby.Server.Implementations.Library
item.DateLastSaved = DateTime.UtcNow;
- RegisterItem(item);
+ UpdateImages(item, updateReason >= ItemUpdateType.ImageUpdate);
}
_itemRepository.SaveItems(itemsList, cancellationToken);
diff --git a/Emby.Server.Implementations/Library/MediaSourceManager.cs b/Emby.Server.Implementations/Library/MediaSourceManager.cs
index b063db630..5b7a9355b 100644
--- a/Emby.Server.Implementations/Library/MediaSourceManager.cs
+++ b/Emby.Server.Implementations/Library/MediaSourceManager.cs
@@ -522,11 +522,7 @@ namespace Emby.Server.Implementations.Library
SetDefaultAudioAndSubtitleStreamIndexes(item, clone, user);
}
- return new Tuple<LiveStreamResponse, IDirectStreamProvider>(new LiveStreamResponse
- {
- MediaSource = clone
-
- }, liveStream as IDirectStreamProvider);
+ return new Tuple<LiveStreamResponse, IDirectStreamProvider>(new LiveStreamResponse(clone), liveStream as IDirectStreamProvider);
}
private static void AddMediaInfo(MediaSourceInfo mediaSource, bool isAudio)
diff --git a/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs b/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs
index 3efe1ee25..5a5dc3329 100644
--- a/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs
+++ b/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs
@@ -140,11 +140,11 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
}
}
- private void OnNamedConfigurationUpdated(object sender, ConfigurationUpdateEventArgs e)
+ private async void OnNamedConfigurationUpdated(object sender, ConfigurationUpdateEventArgs e)
{
if (string.Equals(e.Key, "livetv", StringComparison.OrdinalIgnoreCase))
{
- OnRecordingFoldersChanged();
+ await CreateRecordingFolders().ConfigureAwait(false);
}
}
@@ -155,11 +155,6 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
return CreateRecordingFolders();
}
- private async void OnRecordingFoldersChanged()
- {
- await CreateRecordingFolders().ConfigureAwait(false);
- }
-
internal async Task CreateRecordingFolders()
{
try
@@ -1334,7 +1329,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
await CreateRecordingFolders().ConfigureAwait(false);
TriggerRefresh(recordPath);
- EnforceKeepUpTo(timer, seriesPath);
+ await EnforceKeepUpTo(timer, seriesPath).ConfigureAwait(false);
};
await recorder.Record(directStreamProvider, mediaStreamInfo, recordPath, duration, onStarted, activeRecordingInfo.CancellationTokenSource.Token).ConfigureAwait(false);
@@ -1494,7 +1489,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
return item;
}
- private async void EnforceKeepUpTo(TimerInfo timer, string seriesPath)
+ private async Task EnforceKeepUpTo(TimerInfo timer, string seriesPath)
{
if (string.IsNullOrWhiteSpace(timer.SeriesTimerId))
{
diff --git a/Emby.Server.Implementations/LiveTv/EmbyTV/EncodedRecorder.cs b/Emby.Server.Implementations/LiveTv/EmbyTV/EncodedRecorder.cs
index bc86cc59a..70dd8f321 100644
--- a/Emby.Server.Implementations/LiveTv/EmbyTV/EncodedRecorder.cs
+++ b/Emby.Server.Implementations/LiveTv/EmbyTV/EncodedRecorder.cs
@@ -117,7 +117,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
onStarted();
// Important - don't await the log task or we won't be able to kill ffmpeg when the user stops playback
- StartStreamingLog(_process.StandardError.BaseStream, _logFileStream);
+ _ = StartStreamingLog(_process.StandardError.BaseStream, _logFileStream);
_logger.LogInformation("ffmpeg recording process started for {0}", _targetPath);
@@ -321,7 +321,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
}
}
- private async void StartStreamingLog(Stream source, Stream target)
+ private async Task StartStreamingLog(Stream source, Stream target)
{
try
{
diff --git a/Emby.Server.Implementations/LiveTv/EmbyTV/TimerManager.cs b/Emby.Server.Implementations/LiveTv/EmbyTV/TimerManager.cs
index 7ebb043d8..285a59a24 100644
--- a/Emby.Server.Implementations/LiveTv/EmbyTV/TimerManager.cs
+++ b/Emby.Server.Implementations/LiveTv/EmbyTV/TimerManager.cs
@@ -109,7 +109,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
if (startDate < now)
{
- TimerFired?.Invoke(this, new GenericEventArgs<TimerInfo> { Argument = item });
+ TimerFired?.Invoke(this, new GenericEventArgs<TimerInfo>(item));
return;
}
@@ -151,7 +151,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
var timer = GetAll().FirstOrDefault(i => string.Equals(i.Id, timerId, StringComparison.OrdinalIgnoreCase));
if (timer != null)
{
- TimerFired?.Invoke(this, new GenericEventArgs<TimerInfo> { Argument = timer });
+ TimerFired?.Invoke(this, new GenericEventArgs<TimerInfo>(timer));
}
}
diff --git a/Emby.Server.Implementations/LiveTv/LiveTvManager.cs b/Emby.Server.Implementations/LiveTv/LiveTvManager.cs
index 09906c9f1..ad26ce705 100644
--- a/Emby.Server.Implementations/LiveTv/LiveTvManager.cs
+++ b/Emby.Server.Implementations/LiveTv/LiveTvManager.cs
@@ -148,27 +148,18 @@ namespace Emby.Server.Implementations.LiveTv
{
var timerId = e.Argument;
- TimerCancelled?.Invoke(this, new GenericEventArgs<TimerEventInfo>
- {
- Argument = new TimerEventInfo
- {
- Id = timerId
- }
- });
+ TimerCancelled?.Invoke(this, new GenericEventArgs<TimerEventInfo>(new TimerEventInfo(timerId)));
}
private void OnEmbyTvTimerCreated(object sender, GenericEventArgs<TimerInfo> e)
{
var timer = e.Argument;
- TimerCreated?.Invoke(this, new GenericEventArgs<TimerEventInfo>
- {
- Argument = new TimerEventInfo
+ TimerCreated?.Invoke(this, new GenericEventArgs<TimerEventInfo>(
+ new TimerEventInfo(timer.Id)
{
- ProgramId = _tvDtoService.GetInternalProgramId(timer.ProgramId),
- Id = timer.Id
- }
- });
+ ProgramId = _tvDtoService.GetInternalProgramId(timer.ProgramId)
+ }));
}
public List<NameIdPair> GetTunerHostTypes()
@@ -786,22 +777,12 @@ namespace Emby.Server.Implementations.LiveTv
if (query.OrderBy.Count == 0)
{
- if (query.IsAiring ?? false)
- {
- // Unless something else was specified, order by start date to take advantage of a specialized index
- query.OrderBy = new[]
- {
- (ItemSortBy.StartDate, SortOrder.Ascending)
- };
- }
- else
+
+ // Unless something else was specified, order by start date to take advantage of a specialized index
+ query.OrderBy = new[]
{
- // Unless something else was specified, order by start date to take advantage of a specialized index
- query.OrderBy = new[]
- {
- (ItemSortBy.StartDate, SortOrder.Ascending)
- };
- }
+ (ItemSortBy.StartDate, SortOrder.Ascending)
+ };
}
RemoveFields(options);
@@ -1732,13 +1713,7 @@ namespace Emby.Server.Implementations.LiveTv
if (!(service is EmbyTV.EmbyTV))
{
- TimerCancelled?.Invoke(this, new GenericEventArgs<TimerEventInfo>
- {
- Argument = new TimerEventInfo
- {
- Id = id
- }
- });
+ TimerCancelled?.Invoke(this, new GenericEventArgs<TimerEventInfo>(new TimerEventInfo(id)));
}
}
@@ -1755,13 +1730,7 @@ namespace Emby.Server.Implementations.LiveTv
await service.CancelSeriesTimerAsync(timer.ExternalId, CancellationToken.None).ConfigureAwait(false);
- SeriesTimerCancelled?.Invoke(this, new GenericEventArgs<TimerEventInfo>
- {
- Argument = new TimerEventInfo
- {
- Id = id
- }
- });
+ SeriesTimerCancelled?.Invoke(this, new GenericEventArgs<TimerEventInfo>(new TimerEventInfo(id)));
}
public async Task<TimerInfoDto> GetTimer(string id, CancellationToken cancellationToken)
@@ -2080,14 +2049,11 @@ namespace Emby.Server.Implementations.LiveTv
if (!(service is EmbyTV.EmbyTV))
{
- TimerCreated?.Invoke(this, new GenericEventArgs<TimerEventInfo>
- {
- Argument = new TimerEventInfo
+ TimerCreated?.Invoke(this, new GenericEventArgs<TimerEventInfo>(
+ new TimerEventInfo(newTimerId)
{
- ProgramId = _tvDtoService.GetInternalProgramId(info.ProgramId),
- Id = newTimerId
- }
- });
+ ProgramId = _tvDtoService.GetInternalProgramId(info.ProgramId)
+ }));
}
}
@@ -2112,14 +2078,11 @@ namespace Emby.Server.Implementations.LiveTv
await service.CreateSeriesTimerAsync(info, cancellationToken).ConfigureAwait(false);
}
- SeriesTimerCreated?.Invoke(this, new GenericEventArgs<TimerEventInfo>
- {
- Argument = new TimerEventInfo
+ SeriesTimerCreated?.Invoke(this, new GenericEventArgs<TimerEventInfo>(
+ new TimerEventInfo(newTimerId)
{
- ProgramId = _tvDtoService.GetInternalProgramId(info.ProgramId),
- Id = newTimerId
- }
- });
+ ProgramId = _tvDtoService.GetInternalProgramId(info.ProgramId)
+ }));
}
public async Task UpdateTimer(TimerInfoDto timer, CancellationToken cancellationToken)
diff --git a/Emby.Server.Implementations/LiveTv/RefreshChannelsScheduledTask.cs b/Emby.Server.Implementations/LiveTv/RefreshChannelsScheduledTask.cs
index 1056a33b9..8e7d60a15 100644
--- a/Emby.Server.Implementations/LiveTv/RefreshChannelsScheduledTask.cs
+++ b/Emby.Server.Implementations/LiveTv/RefreshChannelsScheduledTask.cs
@@ -1,3 +1,5 @@
+#pragma warning disable CS1591
+
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
diff --git a/Emby.Server.Implementations/Localization/Core/ca.json b/Emby.Server.Implementations/Localization/Core/ca.json
index 7464ac1c0..2c802a39e 100644
--- a/Emby.Server.Implementations/Localization/Core/ca.json
+++ b/Emby.Server.Implementations/Localization/Core/ca.json
@@ -92,5 +92,27 @@
"UserStoppedPlayingItemWithValues": "{0} ha parat de reproduir {1}",
"ValueHasBeenAddedToLibrary": "{0} ha sigut afegit a la teva llibreria",
"ValueSpecialEpisodeName": "Especial - {0}",
- "VersionNumber": "Versió {0}"
+ "VersionNumber": "Versió {0}",
+ "TaskDownloadMissingSubtitlesDescription": "Cerca a internet els subtítols que faltin a partir de la configuració de metadades.",
+ "TaskDownloadMissingSubtitles": "Descarrega els subtítols que faltin",
+ "TaskRefreshChannelsDescription": "Actualitza la informació dels canals d'internet.",
+ "TaskRefreshChannels": "Actualitza Canals",
+ "TaskCleanTranscodeDescription": "Elimina els arxius temporals de transcodificacions que tinguin més d'un dia.",
+ "TaskCleanTranscode": "Neteja les transcodificacions",
+ "TaskUpdatePluginsDescription": "Actualitza les extensions que estan configurades per actualitzar-se automàticament.",
+ "TaskUpdatePlugins": "Actualitza les extensions",
+ "TaskRefreshPeopleDescription": "Actualitza les metadades dels actors i directors de la teva mediateca.",
+ "TaskRefreshPeople": "Actualitza Persones",
+ "TaskCleanLogsDescription": "Esborra els logs que tinguin més de {0} dies.",
+ "TaskCleanLogs": "Neteja els registres",
+ "TaskRefreshLibraryDescription": "Escaneja la mediateca buscant fitxers nous i refresca les metadades.",
+ "TaskRefreshLibrary": "Escaneja la biblioteca de mitjans",
+ "TaskRefreshChapterImagesDescription": "Crea les miniatures dels vídeos que tinguin capítols.",
+ "TaskRefreshChapterImages": "Extreure les imatges dels capítols",
+ "TaskCleanCacheDescription": "Elimina els arxius temporals que ja no són necessaris per al servidor.",
+ "TaskCleanCache": "Elimina arxius temporals",
+ "TasksChannelsCategory": "Canals d'internet",
+ "TasksApplicationCategory": "Aplicació",
+ "TasksLibraryCategory": "Biblioteca",
+ "TasksMaintenanceCategory": "Manteniment"
}
diff --git a/Emby.Server.Implementations/Localization/Core/es_419.json b/Emby.Server.Implementations/Localization/Core/es_419.json
new file mode 100644
index 000000000..b0fdc8386
--- /dev/null
+++ b/Emby.Server.Implementations/Localization/Core/es_419.json
@@ -0,0 +1,117 @@
+{
+ "LabelRunningTimeValue": "Duración: {0}",
+ "ValueSpecialEpisodeName": "Especial - {0}",
+ "Sync": "Sincronizar",
+ "Songs": "Canciones",
+ "Shows": "Programas",
+ "Playlists": "Listas de reproducción",
+ "Photos": "Fotos",
+ "Movies": "Películas",
+ "HeaderNextUp": "A continuación",
+ "HeaderLiveTV": "TV en vivo",
+ "HeaderFavoriteSongs": "Canciones favoritas",
+ "HeaderFavoriteArtists": "Artistas favoritos",
+ "HeaderFavoriteAlbums": "Álbumes favoritos",
+ "HeaderFavoriteEpisodes": "Episodios favoritos",
+ "HeaderFavoriteShows": "Programas favoritos",
+ "HeaderContinueWatching": "Continuar viendo",
+ "HeaderAlbumArtists": "Artistas del álbum",
+ "Genres": "Géneros",
+ "Folders": "Carpetas",
+ "Favorites": "Favoritos",
+ "Collections": "Colecciones",
+ "Channels": "Canales",
+ "Books": "Libros",
+ "Artists": "Artistas",
+ "Albums": "Álbumes",
+ "TaskDownloadMissingSubtitlesDescription": "Busca subtítulos faltantes en Internet basándose en la configuración de metadatos.",
+ "TaskDownloadMissingSubtitles": "Descargar subtítulos faltantes",
+ "TaskRefreshChannelsDescription": "Actualiza la información de canales de Internet.",
+ "TaskRefreshChannels": "Actualizar canales",
+ "TaskCleanTranscodeDescription": "Elimina archivos transcodificados que tengan más de un día.",
+ "TaskCleanTranscode": "Limpiar directorio de transcodificado",
+ "TaskUpdatePluginsDescription": "Descarga e instala actualizaciones para complementos que están configurados para actualizarse automáticamente.",
+ "TaskUpdatePlugins": "Actualizar complementos",
+ "TaskRefreshPeopleDescription": "Actualiza metadatos de actores y directores en tu biblioteca de medios.",
+ "TaskRefreshPeople": "Actualizar personas",
+ "TaskCleanLogsDescription": "Elimina archivos de registro con más de {0} días de antigüedad.",
+ "TaskCleanLogs": "Limpiar directorio de registros",
+ "TaskRefreshLibraryDescription": "Escanea tu biblioteca de medios por archivos nuevos y actualiza los metadatos.",
+ "TaskRefreshLibrary": "Escanear biblioteca de medios",
+ "TaskRefreshChapterImagesDescription": "Crea miniaturas para videos que tienen capítulos.",
+ "TaskRefreshChapterImages": "Extraer imágenes de los capítulos",
+ "TaskCleanCacheDescription": "Elimina archivos caché que ya no son necesarios para el sistema.",
+ "TaskCleanCache": "Limpiar directorio caché",
+ "TasksChannelsCategory": "Canales de Internet",
+ "TasksApplicationCategory": "Aplicación",
+ "TasksLibraryCategory": "Biblioteca",
+ "TasksMaintenanceCategory": "Mantenimiento",
+ "VersionNumber": "Versión {0}",
+ "ValueHasBeenAddedToLibrary": "{0} se ha añadido a tu biblioteca de medios",
+ "UserStoppedPlayingItemWithValues": "{0} ha terminado de reproducir {1} en {2}",
+ "UserStartedPlayingItemWithValues": "{0} está reproduciendo {1} en {2}",
+ "UserPolicyUpdatedWithName": "La política de usuario ha sido actualizada para {0}",
+ "UserPasswordChangedWithName": "Se ha cambiado la contraseña para el usuario {0}",
+ "UserOnlineFromDevice": "{0} está en línea desde {1}",
+ "UserOfflineFromDevice": "{0} se ha desconectado desde {1}",
+ "UserLockedOutWithName": "El usuario {0} ha sido bloqueado",
+ "UserDownloadingItemWithValues": "{0} está descargando {1}",
+ "UserDeletedWithName": "El usuario {0} ha sido eliminado",
+ "UserCreatedWithName": "El usuario {0} ha sido creado",
+ "User": "Usuario",
+ "TvShows": "Programas de TV",
+ "System": "Sistema",
+ "SubtitleDownloadFailureFromForItem": "Falló la descarga de subtítulos desde {0} para {1}",
+ "StartupEmbyServerIsLoading": "El servidor Jellyfin está cargando. Por favor, intente de nuevo pronto.",
+ "ServerNameNeedsToBeRestarted": "{0} debe ser reiniciado",
+ "ScheduledTaskStartedWithName": "{0} iniciado",
+ "ScheduledTaskFailedWithName": "{0} falló",
+ "ProviderValue": "Proveedor: {0}",
+ "PluginUpdatedWithName": "{0} fue actualizado",
+ "PluginUninstalledWithName": "{0} fue desinstalado",
+ "PluginInstalledWithName": "{0} fue instalado",
+ "Plugin": "Complemento",
+ "NotificationOptionVideoPlaybackStopped": "Reproducción de video detenida",
+ "NotificationOptionVideoPlayback": "Reproducción de video iniciada",
+ "NotificationOptionUserLockedOut": "Usuario bloqueado",
+ "NotificationOptionTaskFailed": "Falla de tarea programada",
+ "NotificationOptionServerRestartRequired": "Se necesita reiniciar el servidor",
+ "NotificationOptionPluginUpdateInstalled": "Actualización de complemento instalada",
+ "NotificationOptionPluginUninstalled": "Complemento desinstalado",
+ "NotificationOptionPluginInstalled": "Complemento instalado",
+ "NotificationOptionPluginError": "Falla de complemento",
+ "NotificationOptionNewLibraryContent": "Nuevo contenido agregado",
+ "NotificationOptionInstallationFailed": "Falla de instalación",
+ "NotificationOptionCameraImageUploaded": "Imagen de la cámara subida",
+ "NotificationOptionAudioPlaybackStopped": "Reproducción de audio detenida",
+ "NotificationOptionAudioPlayback": "Reproducción de audio iniciada",
+ "NotificationOptionApplicationUpdateInstalled": "Actualización de la aplicación instalada",
+ "NotificationOptionApplicationUpdateAvailable": "Actualización de la aplicación disponible",
+ "NewVersionIsAvailable": "Una nueva versión del Servidor Jellyfin está disponible para descargar.",
+ "NameSeasonUnknown": "Temporada desconocida",
+ "NameSeasonNumber": "Temporada {0}",
+ "NameInstallFailed": "Falló la instalación de {0}",
+ "MusicVideos": "Videos musicales",
+ "Music": "Música",
+ "MixedContent": "Contenido mezclado",
+ "MessageServerConfigurationUpdated": "Se ha actualizado la configuración del servidor",
+ "MessageNamedServerConfigurationUpdatedWithValue": "Se ha actualizado la sección {0} de la configuración del servidor",
+ "MessageApplicationUpdatedTo": "El servidor Jellyfin ha sido actualizado a {0}",
+ "MessageApplicationUpdated": "El servidor Jellyfin ha sido actualizado",
+ "Latest": "Recientes",
+ "LabelIpAddressValue": "Dirección IP: {0}",
+ "ItemRemovedWithName": "{0} fue removido de la biblioteca",
+ "ItemAddedWithName": "{0} fue agregado a la biblioteca",
+ "Inherit": "Heredar",
+ "HomeVideos": "Videos caseros",
+ "HeaderRecordingGroups": "Grupos de grabación",
+ "HeaderCameraUploads": "Subidas desde la cámara",
+ "FailedLoginAttemptWithUserName": "Intento fallido de inicio de sesión desde {0}",
+ "DeviceOnlineWithName": "{0} está conectado",
+ "DeviceOfflineWithName": "{0} se ha desconectado",
+ "ChapterNameValue": "Capítulo {0}",
+ "CameraImageUploadedFrom": "Una nueva imagen de cámara ha sido subida desde {0}",
+ "AuthenticationSucceededWithUserName": "{0} autenticado con éxito",
+ "Application": "Aplicación",
+ "AppDeviceValues": "App: {0}, Dispositivo: {1}"
+}
diff --git a/Emby.Server.Implementations/Localization/Core/fr.json b/Emby.Server.Implementations/Localization/Core/fr.json
index 150952d8b..47ebe1254 100644
--- a/Emby.Server.Implementations/Localization/Core/fr.json
+++ b/Emby.Server.Implementations/Localization/Core/fr.json
@@ -5,7 +5,7 @@
"Artists": "Artistes",
"AuthenticationSucceededWithUserName": "{0} authentifié avec succès",
"Books": "Livres",
- "CameraImageUploadedFrom": "Une nouvelle photographie a été chargée depuis {0}",
+ "CameraImageUploadedFrom": "Une photo a été chargée depuis {0}",
"Channels": "Chaînes",
"ChapterNameValue": "Chapitre {0}",
"Collections": "Collections",
@@ -15,7 +15,7 @@
"Favorites": "Favoris",
"Folders": "Dossiers",
"Genres": "Genres",
- "HeaderAlbumArtists": "Artistes de l'album",
+ "HeaderAlbumArtists": "Artistes",
"HeaderCameraUploads": "Photos transférées",
"HeaderContinueWatching": "Continuer à regarder",
"HeaderFavoriteAlbums": "Albums favoris",
diff --git a/Emby.Server.Implementations/Localization/Core/ta.json b/Emby.Server.Implementations/Localization/Core/ta.json
new file mode 100644
index 000000000..f722dd8c0
--- /dev/null
+++ b/Emby.Server.Implementations/Localization/Core/ta.json
@@ -0,0 +1,99 @@
+{
+ "VersionNumber": "பதிப்பு {0}",
+ "ValueSpecialEpisodeName": "சிறப்பு - {0}",
+ "TasksMaintenanceCategory": "பராமரிப்பு",
+ "TaskCleanCache": "தற்காலிக சேமிப்பு கோப்பகத்தை சுத்தம் செய்யவும்",
+ "TaskRefreshChapterImages": "அத்தியாயப் படங்களை பிரித்தெடுக்கவும்",
+ "TaskRefreshPeople": "மக்களைப் புதுப்பிக்கவும்",
+ "TaskCleanTranscode": "டிரான்ஸ்கோட் கோப்பகத்தை சுத்தம் செய்யவும்",
+ "TaskRefreshChannelsDescription": "இணையச் சேனல் தகவல்களைப் புதுப்பிக்கிறது.",
+ "System": "ஒருங்கியம்",
+ "NotificationOptionTaskFailed": "திட்டமிடப்பட்ட பணி தோல்வியடைந்தது",
+ "NotificationOptionPluginUpdateInstalled": "உட்செருகி புதுப்பிக்கப்பட்டது",
+ "NotificationOptionPluginUninstalled": "உட்செருகி நீக்கப்பட்டது",
+ "NotificationOptionPluginInstalled": "உட்செருகி நிறுவப்பட்டது",
+ "NotificationOptionPluginError": "உட்செருகி செயலிழந்தது",
+ "NotificationOptionCameraImageUploaded": "புகைப்படம் பதிவேற்றப்பட்டது",
+ "MixedContent": "கலப்பு உள்ளடக்கங்கள்",
+ "MessageServerConfigurationUpdated": "சேவையக அமைப்புகள் புதுப்பிக்கப்பட்டன",
+ "MessageApplicationUpdatedTo": "ஜெல்லிஃபின் சேவையகம் {0} இற்கு புதுப்பிக்கப்பட்டது",
+ "MessageApplicationUpdated": "ஜெல்லிஃபின் சேவையகம் புதுப்பிக்கப்பட்டது",
+ "Inherit": "மரபரிமையாகப் பெறு",
+ "HeaderRecordingGroups": "பதிவு குழுக்கள்",
+ "HeaderCameraUploads": "புகைப்பட பதிவேற்றங்கள்",
+ "Folders": "கோப்புறைகள்",
+ "FailedLoginAttemptWithUserName": "{0} இலிருந்து உள்நுழைவு முயற்சி தோல்வியடைந்தது",
+ "DeviceOnlineWithName": "{0} இணைக்கப்பட்டது",
+ "DeviceOfflineWithName": "{0} துண்டிக்கப்பட்டது",
+ "Collections": "தொகுப்புகள்",
+ "CameraImageUploadedFrom": "{0} இலிருந்து புதிய புகைப்படம் பதிவேற்றப்பட்டது",
+ "AppDeviceValues": "செயலி: {0}, சாதனம்: {1}",
+ "TaskDownloadMissingSubtitles": "விடுபட்டுபோன வசன வரிகளைப் பதிவிறக்கு",
+ "TaskRefreshChannels": "சேனல்களை புதுப்பி",
+ "TaskUpdatePlugins": "உட்செருகிகளை புதுப்பி",
+ "TaskRefreshLibrary": "மீடியா நூலகத்தை ஆராய்",
+ "TasksChannelsCategory": "இணைய சேனல்கள்",
+ "TasksApplicationCategory": "செயலி",
+ "TasksLibraryCategory": "நூலகம்",
+ "UserPolicyUpdatedWithName": "பயனர் கொள்கை {0} இற்கு புதுப்பிக்கப்பட்டுள்ளது",
+ "UserPasswordChangedWithName": "{0} பயனருக்கு கடவுச்சொல் மாற்றப்பட்டுள்ளது",
+ "UserLockedOutWithName": "பயனர் {0} முடக்கப்பட்டார்",
+ "UserDownloadingItemWithValues": "{0} ஆல் {1} பதிவிறக்கப்படுகிறது",
+ "UserDeletedWithName": "பயனர் {0} நீக்கப்பட்டார்",
+ "UserCreatedWithName": "பயனர் {0} உருவாக்கப்பட்டார்",
+ "User": "பயனர்",
+ "TvShows": "தொலைக்காட்சித் தொடர்கள்",
+ "Sync": "ஒத்திசைவு",
+ "StartupEmbyServerIsLoading": "ஜெல்லிஃபின் சேவையகம் துவங்குகிறது. சிறிது நேரம் கழித்து முயற்சிக்கவும்.",
+ "Songs": "பாட்டுகள்",
+ "Shows": "தொடர்கள்",
+ "ServerNameNeedsToBeRestarted": "{0} மறுதொடக்கம் செய்யப்பட வேண்டும்",
+ "ScheduledTaskStartedWithName": "{0} துவங்கியது",
+ "ScheduledTaskFailedWithName": "{0} தோல்வியடைந்தது",
+ "ProviderValue": "வழங்குநர்: {0}",
+ "PluginUpdatedWithName": "{0} புதுப்பிக்கப்பட்டது",
+ "PluginUninstalledWithName": "{0} நீக்கப்பட்டது",
+ "PluginInstalledWithName": "{0} நிறுவப்பட்டது",
+ "Plugin": "உட்செருகி",
+ "Playlists": "தொடர் பட்டியல்கள்",
+ "Photos": "புகைப்படங்கள்",
+ "NotificationOptionVideoPlaybackStopped": "நிகழ்பட ஒளிபரப்பு நிறுத்தப்பட்டது",
+ "NotificationOptionVideoPlayback": "நிகழ்பட ஒளிபரப்பு துவங்கியது",
+ "NotificationOptionUserLockedOut": "பயனர் கணக்கு முடக்கப்பட்டது",
+ "NotificationOptionServerRestartRequired": "சேவையக மறுதொடக்கம் தேவை",
+ "NotificationOptionNewLibraryContent": "புதிய உள்ளடக்கங்கள் சேர்க்கப்பட்டன",
+ "NotificationOptionInstallationFailed": "நிறுவல் தோல்வியடைந்தது",
+ "NotificationOptionAudioPlaybackStopped": "ஒலி இசைத்தல் நிறுத்தப்பட்டது",
+ "NotificationOptionAudioPlayback": "ஒலி இசைக்கத் துவங்கியுள்ளது",
+ "NotificationOptionApplicationUpdateInstalled": "செயலி புதுப்பிக்கப்பட்டது",
+ "NotificationOptionApplicationUpdateAvailable": "செயலியினை புதுப்பிக்கலாம்",
+ "NameSeasonUnknown": "பருவம் அறியப்படாதவை",
+ "NameSeasonNumber": "பருவம் {0}",
+ "NameInstallFailed": "{0} நிறுவல் தோல்வியடைந்தது",
+ "MusicVideos": "இசைப்படங்கள்",
+ "Music": "இசை",
+ "Movies": "திரைப்படங்கள்",
+ "Latest": "புதியன",
+ "LabelRunningTimeValue": "ஓடும் நேரம்: {0}",
+ "LabelIpAddressValue": "ஐபி முகவரி: {0}",
+ "ItemRemovedWithName": "{0} நூலகத்திலிருந்து அகற்றப்பட்டது",
+ "ItemAddedWithName": "{0} நூலகத்தில் சேர்க்கப்பட்டது",
+ "HeaderNextUp": "அடுத்ததாக",
+ "HeaderLiveTV": "நேரடித் தொலைக்காட்சி",
+ "HeaderFavoriteSongs": "பிடித்த பாட்டுகள்",
+ "HeaderFavoriteShows": "பிடித்த தொடர்கள்",
+ "HeaderFavoriteEpisodes": "பிடித்த அத்தியாயங்கள்",
+ "HeaderFavoriteArtists": "பிடித்த கலைஞர்கள்",
+ "HeaderFavoriteAlbums": "பிடித்த ஆல்பங்கள்",
+ "HeaderContinueWatching": "தொடர்ந்து பார்",
+ "HeaderAlbumArtists": "இசைக் கலைஞர்கள்",
+ "Genres": "வகைகள்",
+ "Favorites": "பிடித்தவை",
+ "ChapterNameValue": "அத்தியாயம் {0}",
+ "Channels": "சேனல்கள்",
+ "Books": "புத்தகங்கள்",
+ "AuthenticationSucceededWithUserName": "{0} வெற்றிகரமாக அங்கீகரிக்கப்பட்டது",
+ "Artists": "கலைஞர்கள்",
+ "Application": "செயலி",
+ "Albums": "ஆல்பங்கள்"
+}
diff --git a/Emby.Server.Implementations/MediaEncoder/EncodingManager.cs b/Emby.Server.Implementations/MediaEncoder/EncodingManager.cs
index 677d68b4c..7b7575707 100644
--- a/Emby.Server.Implementations/MediaEncoder/EncodingManager.cs
+++ b/Emby.Server.Implementations/MediaEncoder/EncodingManager.cs
@@ -1,3 +1,5 @@
+#pragma warning disable CS1591
+
using System;
using System.Collections.Generic;
using System.Globalization;
diff --git a/Emby.Server.Implementations/Net/SocketFactory.cs b/Emby.Server.Implementations/Net/SocketFactory.cs
index e42ff8496..f347540c7 100644
--- a/Emby.Server.Implementations/Net/SocketFactory.cs
+++ b/Emby.Server.Implementations/Net/SocketFactory.cs
@@ -1,3 +1,5 @@
+#pragma warning disable CS1591
+
using System;
using System.Net;
using System.Net.Sockets;
diff --git a/Emby.Server.Implementations/Net/UdpSocket.cs b/Emby.Server.Implementations/Net/UdpSocket.cs
index 211ca6784..848f82d85 100644
--- a/Emby.Server.Implementations/Net/UdpSocket.cs
+++ b/Emby.Server.Implementations/Net/UdpSocket.cs
@@ -1,3 +1,5 @@
+#pragma warning disable CS1591
+
using System;
using System.Net;
using System.Net.Sockets;
diff --git a/Emby.Server.Implementations/Networking/NetworkManager.cs b/Emby.Server.Implementations/Networking/NetworkManager.cs
index b3e88b667..d1a28e7a1 100644
--- a/Emby.Server.Implementations/Networking/NetworkManager.cs
+++ b/Emby.Server.Implementations/Networking/NetworkManager.cs
@@ -1,3 +1,5 @@
+#pragma warning disable CS1591
+
using System;
using System.Collections.Generic;
using System.Globalization;
diff --git a/Emby.Server.Implementations/Playlists/ManualPlaylistsFolder.cs b/Emby.Server.Implementations/Playlists/ManualPlaylistsFolder.cs
index 98f1464bf..358606b0d 100644
--- a/Emby.Server.Implementations/Playlists/ManualPlaylistsFolder.cs
+++ b/Emby.Server.Implementations/Playlists/ManualPlaylistsFolder.cs
@@ -1,3 +1,5 @@
+#pragma warning disable CS1591
+
using System.Collections.Generic;
using System.Linq;
using System.Text.Json.Serialization;
diff --git a/Emby.Server.Implementations/Playlists/PlaylistManager.cs b/Emby.Server.Implementations/Playlists/PlaylistManager.cs
index 61c6f6f66..2a3f24674 100644
--- a/Emby.Server.Implementations/Playlists/PlaylistManager.cs
+++ b/Emby.Server.Implementations/Playlists/PlaylistManager.cs
@@ -1,3 +1,5 @@
+#pragma warning disable CS1591
+
using System;
using System.Collections.Generic;
using System.Globalization;
@@ -156,10 +158,7 @@ namespace Emby.Server.Implementations.Playlists
});
}
- return new PlaylistCreationResult
- {
- Id = playlist.Id.ToString("N", CultureInfo.InvariantCulture)
- };
+ return new PlaylistCreationResult(playlist.Id.ToString("N", CultureInfo.InvariantCulture));
}
finally
{
diff --git a/Emby.Server.Implementations/ResourceFileManager.cs b/Emby.Server.Implementations/ResourceFileManager.cs
index 6eda2b503..d192be921 100644
--- a/Emby.Server.Implementations/ResourceFileManager.cs
+++ b/Emby.Server.Implementations/ResourceFileManager.cs
@@ -1,3 +1,5 @@
+#pragma warning disable CS1591
+
using System;
using System.IO;
using MediaBrowser.Controller;
diff --git a/Emby.Server.Implementations/ScheduledTasks/ScheduledTaskWorker.cs b/Emby.Server.Implementations/ScheduledTasks/ScheduledTaskWorker.cs
index 5b188d962..e58c335a8 100644
--- a/Emby.Server.Implementations/ScheduledTasks/ScheduledTaskWorker.cs
+++ b/Emby.Server.Implementations/ScheduledTasks/ScheduledTaskWorker.cs
@@ -1,3 +1,5 @@
+#pragma warning disable CS1591
+
using System;
using System.Globalization;
using System.IO;
@@ -51,7 +53,6 @@ namespace Emby.Server.Implementations.ScheduledTasks
/// </summary>
/// <value>The task manager.</value>
private ITaskManager TaskManager { get; set; }
- private readonly IFileSystem _fileSystem;
/// <summary>
/// Initializes a new instance of the <see cref="ScheduledTaskWorker" /> class.
@@ -72,24 +73,28 @@ namespace Emby.Server.Implementations.ScheduledTasks
/// or
/// logger
/// </exception>
- public ScheduledTaskWorker(IScheduledTask scheduledTask, IApplicationPaths applicationPaths, ITaskManager taskManager, IJsonSerializer jsonSerializer, ILogger logger, IFileSystem fileSystem)
+ public ScheduledTaskWorker(IScheduledTask scheduledTask, IApplicationPaths applicationPaths, ITaskManager taskManager, IJsonSerializer jsonSerializer, ILogger logger)
{
if (scheduledTask == null)
{
throw new ArgumentNullException(nameof(scheduledTask));
}
+
if (applicationPaths == null)
{
throw new ArgumentNullException(nameof(applicationPaths));
}
+
if (taskManager == null)
{
throw new ArgumentNullException(nameof(taskManager));
}
+
if (jsonSerializer == null)
{
throw new ArgumentNullException(nameof(jsonSerializer));
}
+
if (logger == null)
{
throw new ArgumentNullException(nameof(logger));
@@ -100,7 +105,6 @@ namespace Emby.Server.Implementations.ScheduledTasks
TaskManager = taskManager;
JsonSerializer = jsonSerializer;
Logger = logger;
- _fileSystem = fileSystem;
InitTriggerEvents();
}
@@ -392,7 +396,7 @@ namespace Emby.Server.Implementations.ScheduledTasks
((TaskManager)TaskManager).OnTaskExecuting(this);
- progress.ProgressChanged += progress_ProgressChanged;
+ progress.ProgressChanged += OnProgressChanged;
TaskCompletionStatus status;
CurrentExecutionStartTime = DateTime.UtcNow;
@@ -426,7 +430,7 @@ namespace Emby.Server.Implementations.ScheduledTasks
var startTime = CurrentExecutionStartTime;
var endTime = DateTime.UtcNow;
- progress.ProgressChanged -= progress_ProgressChanged;
+ progress.ProgressChanged -= OnProgressChanged;
CurrentCancellationTokenSource.Dispose();
CurrentCancellationTokenSource = null;
CurrentProgress = null;
@@ -439,16 +443,13 @@ namespace Emby.Server.Implementations.ScheduledTasks
/// </summary>
/// <param name="sender">The sender.</param>
/// <param name="e">The e.</param>
- void progress_ProgressChanged(object sender, double e)
+ private void OnProgressChanged(object sender, double e)
{
e = Math.Min(e, 100);
CurrentProgress = e;
- TaskProgress?.Invoke(this, new GenericEventArgs<double>
- {
- Argument = e
- });
+ TaskProgress?.Invoke(this, new GenericEventArgs<double>(e));
}
/// <summary>
@@ -576,6 +577,7 @@ namespace Emby.Server.Implementations.ScheduledTasks
/// <param name="startTime">The start time.</param>
/// <param name="endTime">The end time.</param>
/// <param name="status">The status.</param>
+ /// <param name="ex">The exception.</param>
private void OnTaskCompleted(DateTime startTime, DateTime endTime, TaskCompletionStatus status, Exception ex)
{
var elapsedTime = endTime - startTime;
diff --git a/Emby.Server.Implementations/ScheduledTasks/TaskManager.cs b/Emby.Server.Implementations/ScheduledTasks/TaskManager.cs
index 6ffa581a9..efefa5506 100644
--- a/Emby.Server.Implementations/ScheduledTasks/TaskManager.cs
+++ b/Emby.Server.Implementations/ScheduledTasks/TaskManager.cs
@@ -1,3 +1,5 @@
+#pragma warning disable CS1591
+
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
@@ -199,7 +201,7 @@ namespace Emby.Server.Implementations.ScheduledTasks
/// <param name="tasks">The tasks.</param>
public void AddTasks(IEnumerable<IScheduledTask> tasks)
{
- var list = tasks.Select(t => new ScheduledTaskWorker(t, _applicationPaths, this, _jsonSerializer, _logger, _fileSystem));
+ var list = tasks.Select(t => new ScheduledTaskWorker(t, _applicationPaths, this, _jsonSerializer, _logger));
ScheduledTasks = ScheduledTasks.Concat(list).ToArray();
}
@@ -240,10 +242,7 @@ namespace Emby.Server.Implementations.ScheduledTasks
/// <param name="task">The task.</param>
internal void OnTaskExecuting(IScheduledTaskWorker task)
{
- TaskExecuting?.Invoke(this, new GenericEventArgs<IScheduledTaskWorker>
- {
- Argument = task
- });
+ TaskExecuting?.Invoke(this, new GenericEventArgs<IScheduledTaskWorker>(task));
}
/// <summary>
@@ -253,11 +252,7 @@ namespace Emby.Server.Implementations.ScheduledTasks
/// <param name="result">The result.</param>
internal void OnTaskCompleted(IScheduledTaskWorker task, TaskResult result)
{
- TaskCompleted?.Invoke(task, new TaskCompletionEventArgs
- {
- Result = result,
- Task = task
- });
+ TaskCompleted?.Invoke(task, new TaskCompletionEventArgs(task, result));
ExecuteQueuedTasks();
}
diff --git a/Emby.Server.Implementations/ScheduledTasks/Tasks/ChapterImagesTask.cs b/Emby.Server.Implementations/ScheduledTasks/Tasks/ChapterImagesTask.cs
index ea6a70615..fae049914 100644
--- a/Emby.Server.Implementations/ScheduledTasks/Tasks/ChapterImagesTask.cs
+++ b/Emby.Server.Implementations/ScheduledTasks/Tasks/ChapterImagesTask.cs
@@ -169,18 +169,25 @@ namespace Emby.Server.Implementations.ScheduledTasks
}
}
+ /// <inheritdoc />
public string Name => _localization.GetLocalizedString("TaskRefreshChapterImages");
+ /// <inheritdoc />
public string Description => _localization.GetLocalizedString("TaskRefreshChapterImagesDescription");
+ /// <inheritdoc />
public string Category => _localization.GetLocalizedString("TasksLibraryCategory");
+ /// <inheritdoc />
public string Key => "RefreshChapterImages";
+ /// <inheritdoc />
public bool IsHidden => false;
+ /// <inheritdoc />
public bool IsEnabled => true;
+ /// <inheritdoc />
public bool IsLogged => true;
}
}
diff --git a/Emby.Server.Implementations/ScheduledTasks/Tasks/DeleteCacheFileTask.cs b/Emby.Server.Implementations/ScheduledTasks/Tasks/DeleteCacheFileTask.cs
index 9df7c538b..a6c13eaef 100644
--- a/Emby.Server.Implementations/ScheduledTasks/Tasks/DeleteCacheFileTask.cs
+++ b/Emby.Server.Implementations/ScheduledTasks/Tasks/DeleteCacheFileTask.cs
@@ -165,18 +165,25 @@ namespace Emby.Server.Implementations.ScheduledTasks.Tasks
}
}
+ /// <inheritdoc />
public string Name => _localization.GetLocalizedString("TaskCleanCache");
+ /// <inheritdoc />
public string Description => _localization.GetLocalizedString("TaskCleanCacheDescription");
+ /// <inheritdoc />
public string Category => _localization.GetLocalizedString("TasksMaintenanceCategory");
+ /// <inheritdoc />
public string Key => "DeleteCacheFiles";
+ /// <inheritdoc />
public bool IsHidden => false;
+ /// <inheritdoc />
public bool IsEnabled => true;
+ /// <inheritdoc />
public bool IsLogged => true;
}
}
diff --git a/Emby.Server.Implementations/ScheduledTasks/Tasks/DeleteLogFileTask.cs b/Emby.Server.Implementations/ScheduledTasks/Tasks/DeleteLogFileTask.cs
index 3140aa489..402b39a26 100644
--- a/Emby.Server.Implementations/ScheduledTasks/Tasks/DeleteLogFileTask.cs
+++ b/Emby.Server.Implementations/ScheduledTasks/Tasks/DeleteLogFileTask.cs
@@ -28,6 +28,8 @@ namespace Emby.Server.Implementations.ScheduledTasks.Tasks
/// Initializes a new instance of the <see cref="DeleteLogFileTask" /> class.
/// </summary>
/// <param name="configurationManager">The configuration manager.</param>
+ /// <param name="fileSystem">The file system.</param>
+ /// <param name="localization">The localization manager.</param>
public DeleteLogFileTask(IConfigurationManager configurationManager, IFileSystem fileSystem, ILocalizationManager localization)
{
ConfigurationManager = configurationManager;
@@ -82,18 +84,25 @@ namespace Emby.Server.Implementations.ScheduledTasks.Tasks
return Task.CompletedTask;
}
+ /// <inheritdoc />
public string Name => _localization.GetLocalizedString("TaskCleanLogs");
+ /// <inheritdoc />
public string Description => string.Format(_localization.GetLocalizedString("TaskCleanLogsDescription"), ConfigurationManager.CommonConfiguration.LogFileRetentionDays);
+ /// <inheritdoc />
public string Category => _localization.GetLocalizedString("TasksMaintenanceCategory");
+ /// <inheritdoc />
public string Key => "CleanLogFiles";
+ /// <inheritdoc />
public bool IsHidden => false;
+ /// <inheritdoc />
public bool IsEnabled => true;
+ /// <inheritdoc />
public bool IsLogged => true;
}
}
diff --git a/Emby.Server.Implementations/ScheduledTasks/Tasks/DeleteTranscodeFileTask.cs b/Emby.Server.Implementations/ScheduledTasks/Tasks/DeleteTranscodeFileTask.cs
index 1d133dcda..0d36b82c0 100644
--- a/Emby.Server.Implementations/ScheduledTasks/Tasks/DeleteTranscodeFileTask.cs
+++ b/Emby.Server.Implementations/ScheduledTasks/Tasks/DeleteTranscodeFileTask.cs
@@ -132,18 +132,25 @@ namespace Emby.Server.Implementations.ScheduledTasks.Tasks
}
}
+ /// <inheritdoc />
public string Name => _localization.GetLocalizedString("TaskCleanTranscode");
+ /// <inheritdoc />
public string Description => _localization.GetLocalizedString("TaskCleanTranscodeDescription");
+ /// <inheritdoc />
public string Category => _localization.GetLocalizedString("TasksMaintenanceCategory");
+ /// <inheritdoc />
public string Key => "DeleteTranscodeFiles";
+ /// <inheritdoc />
public bool IsHidden => false;
+ /// <inheritdoc />
public bool IsEnabled => false;
+ /// <inheritdoc />
public bool IsLogged => true;
}
}
diff --git a/Emby.Server.Implementations/ScheduledTasks/Tasks/PeopleValidationTask.cs b/Emby.Server.Implementations/ScheduledTasks/Tasks/PeopleValidationTask.cs
index 63f867bf6..c384cf4bb 100644
--- a/Emby.Server.Implementations/ScheduledTasks/Tasks/PeopleValidationTask.cs
+++ b/Emby.Server.Implementations/ScheduledTasks/Tasks/PeopleValidationTask.cs
@@ -1,8 +1,9 @@
+#pragma warning disable CS1591
+
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
-using MediaBrowser.Controller;
using MediaBrowser.Controller.Library;
using MediaBrowser.Model.Tasks;
using MediaBrowser.Model.Globalization;
@@ -18,19 +19,16 @@ namespace Emby.Server.Implementations.ScheduledTasks
/// The library manager.
/// </summary>
private readonly ILibraryManager _libraryManager;
-
- private readonly IServerApplicationHost _appHost;
private readonly ILocalizationManager _localization;
/// <summary>
/// Initializes a new instance of the <see cref="PeopleValidationTask" /> class.
/// </summary>
/// <param name="libraryManager">The library manager.</param>
- /// <param name="appHost">The server application host</param>
- public PeopleValidationTask(ILibraryManager libraryManager, IServerApplicationHost appHost, ILocalizationManager localization)
+ /// <param name="localization">The localization manager.</param>
+ public PeopleValidationTask(ILibraryManager libraryManager, ILocalizationManager localization)
{
_libraryManager = libraryManager;
- _appHost = appHost;
_localization = localization;
}
diff --git a/Emby.Server.Implementations/ScheduledTasks/Tasks/PluginUpdateTask.cs b/Emby.Server.Implementations/ScheduledTasks/Tasks/PluginUpdateTask.cs
index 6a1afced7..acab3aeea 100644
--- a/Emby.Server.Implementations/ScheduledTasks/Tasks/PluginUpdateTask.cs
+++ b/Emby.Server.Implementations/ScheduledTasks/Tasks/PluginUpdateTask.cs
@@ -1,3 +1,5 @@
+#pragma warning disable CS1591
+
using System;
using System.Collections.Generic;
using System.IO;
@@ -80,11 +82,11 @@ namespace Emby.Server.Implementations.ScheduledTasks
}
catch (HttpException ex)
{
- _logger.LogError(ex, "Error downloading {0}", package.name);
+ _logger.LogError(ex, "Error downloading {0}", package.Name);
}
catch (IOException ex)
{
- _logger.LogError(ex, "Error updating {0}", package.name);
+ _logger.LogError(ex, "Error updating {0}", package.Name);
}
// Update progress
diff --git a/Emby.Server.Implementations/ScheduledTasks/Tasks/RefreshMediaLibraryTask.cs b/Emby.Server.Implementations/ScheduledTasks/Tasks/RefreshMediaLibraryTask.cs
index 74cb01444..e470adcf4 100644
--- a/Emby.Server.Implementations/ScheduledTasks/Tasks/RefreshMediaLibraryTask.cs
+++ b/Emby.Server.Implementations/ScheduledTasks/Tasks/RefreshMediaLibraryTask.cs
@@ -1,9 +1,10 @@
+#pragma warning disable CS1591
+
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using Emby.Server.Implementations.Library;
-using MediaBrowser.Controller.Configuration;
using MediaBrowser.Controller.Library;
using MediaBrowser.Model.Tasks;
using MediaBrowser.Model.Globalization;
@@ -16,20 +17,19 @@ namespace Emby.Server.Implementations.ScheduledTasks
public class RefreshMediaLibraryTask : IScheduledTask
{
/// <summary>
- /// The _library manager
+ /// The _library manager.
/// </summary>
private readonly ILibraryManager _libraryManager;
- private readonly IServerConfigurationManager _config;
private readonly ILocalizationManager _localization;
/// <summary>
/// Initializes a new instance of the <see cref="RefreshMediaLibraryTask" /> class.
/// </summary>
/// <param name="libraryManager">The library manager.</param>
- public RefreshMediaLibraryTask(ILibraryManager libraryManager, IServerConfigurationManager config, ILocalizationManager localization)
+ /// <param name="localization">The localization manager.</param>
+ public RefreshMediaLibraryTask(ILibraryManager libraryManager, ILocalizationManager localization)
{
_libraryManager = libraryManager;
- _config = config;
_localization = localization;
}
@@ -61,18 +61,25 @@ namespace Emby.Server.Implementations.ScheduledTasks
return ((LibraryManager)_libraryManager).ValidateMediaLibraryInternal(progress, cancellationToken);
}
+ /// <inheritdoc />
public string Name => _localization.GetLocalizedString("TaskRefreshLibrary");
+ /// <inheritdoc />
public string Description => _localization.GetLocalizedString("TaskRefreshLibraryDescription");
+ /// <inheritdoc />
public string Category => _localization.GetLocalizedString("TasksLibraryCategory");
+ /// <inheritdoc />
public string Key => "RefreshLibrary";
+ /// <inheritdoc />
public bool IsHidden => false;
+ /// <inheritdoc />
public bool IsEnabled => true;
+ /// <inheritdoc />
public bool IsLogged => true;
}
}
diff --git a/Emby.Server.Implementations/ScheduledTasks/Triggers/DailyTrigger.cs b/Emby.Server.Implementations/ScheduledTasks/Triggers/DailyTrigger.cs
index ea278de0d..c7819d4c0 100644
--- a/Emby.Server.Implementations/ScheduledTasks/Triggers/DailyTrigger.cs
+++ b/Emby.Server.Implementations/ScheduledTasks/Triggers/DailyTrigger.cs
@@ -31,6 +31,8 @@ namespace Emby.Server.Implementations.ScheduledTasks
/// Stars waiting for the trigger action
/// </summary>
/// <param name="lastResult">The last result.</param>
+ /// <param name="logger">The logger.</param>
+ /// <param name="taskName">The name of the task.</param>
/// <param name="isApplicationStartup">if set to <c>true</c> [is application startup].</param>
public void Start(TaskResult lastResult, ILogger logger, string taskName, bool isApplicationStartup)
{
@@ -77,10 +79,7 @@ namespace Emby.Server.Implementations.ScheduledTasks
/// </summary>
private void OnTriggered()
{
- if (Triggered != null)
- {
- Triggered(this, EventArgs.Empty);
- }
+ Triggered?.Invoke(this, EventArgs.Empty);
}
}
}
diff --git a/Emby.Server.Implementations/ScheduledTasks/Triggers/IntervalTrigger.cs b/Emby.Server.Implementations/ScheduledTasks/Triggers/IntervalTrigger.cs
index 3a34da3af..74cd4ef1e 100644
--- a/Emby.Server.Implementations/ScheduledTasks/Triggers/IntervalTrigger.cs
+++ b/Emby.Server.Implementations/ScheduledTasks/Triggers/IntervalTrigger.cs
@@ -34,6 +34,8 @@ namespace Emby.Server.Implementations.ScheduledTasks
/// Stars waiting for the trigger action
/// </summary>
/// <param name="lastResult">The last result.</param>
+ /// <param name="logger">The logger.</param>
+ /// <param name="taskName">The name of the task.</param>
/// <param name="isApplicationStartup">if set to <c>true</c> [is application startup].</param>
public void Start(TaskResult lastResult, ILogger logger, string taskName, bool isApplicationStartup)
{
diff --git a/Emby.Server.Implementations/ScheduledTasks/Triggers/StartupTrigger.cs b/Emby.Server.Implementations/ScheduledTasks/Triggers/StartupTrigger.cs
index 08ff4f55f..e171a9e9f 100644
--- a/Emby.Server.Implementations/ScheduledTasks/Triggers/StartupTrigger.cs
+++ b/Emby.Server.Implementations/ScheduledTasks/Triggers/StartupTrigger.cs
@@ -1,3 +1,5 @@
+#pragma warning disable CS1591
+
using System;
using System.Threading.Tasks;
using MediaBrowser.Model.Tasks;
@@ -6,7 +8,7 @@ using Microsoft.Extensions.Logging;
namespace Emby.Server.Implementations.ScheduledTasks
{
/// <summary>
- /// Class StartupTaskTrigger
+ /// Class StartupTaskTrigger.
/// </summary>
public class StartupTrigger : ITaskTrigger
{
@@ -26,6 +28,8 @@ namespace Emby.Server.Implementations.ScheduledTasks
/// Stars waiting for the trigger action
/// </summary>
/// <param name="lastResult">The last result.</param>
+ /// <param name="logger">The logger.</param>
+ /// <param name="taskName">The name of the task.</param>
/// <param name="isApplicationStartup">if set to <c>true</c> [is application startup].</param>
public async void Start(TaskResult lastResult, ILogger logger, string taskName, bool isApplicationStartup)
{
diff --git a/Emby.Server.Implementations/ScheduledTasks/Triggers/WeeklyTrigger.cs b/Emby.Server.Implementations/ScheduledTasks/Triggers/WeeklyTrigger.cs
index 2a6a7b13c..ad0b57af6 100644
--- a/Emby.Server.Implementations/ScheduledTasks/Triggers/WeeklyTrigger.cs
+++ b/Emby.Server.Implementations/ScheduledTasks/Triggers/WeeklyTrigger.cs
@@ -37,6 +37,8 @@ namespace Emby.Server.Implementations.ScheduledTasks
/// Stars waiting for the trigger action
/// </summary>
/// <param name="lastResult">The last result.</param>
+ /// <param name="logger">The logger.</param>
+ /// <param name="taskName">The name of the task.</param>
/// <param name="isApplicationStartup">if set to <c>true</c> [is application startup].</param>
public void Start(TaskResult lastResult, ILogger logger, string taskName, bool isApplicationStartup)
{
diff --git a/Emby.Server.Implementations/Security/AuthenticationRepository.cs b/Emby.Server.Implementations/Security/AuthenticationRepository.cs
index 4e4029f06..750890ec8 100644
--- a/Emby.Server.Implementations/Security/AuthenticationRepository.cs
+++ b/Emby.Server.Implementations/Security/AuthenticationRepository.cs
@@ -1,3 +1,5 @@
+#pragma warning disable CS1591
+
using System;
using System.Collections.Generic;
using System.Globalization;
diff --git a/Emby.Server.Implementations/Serialization/JsonSerializer.cs b/Emby.Server.Implementations/Serialization/JsonSerializer.cs
index bcc814daf..5ec3a735a 100644
--- a/Emby.Server.Implementations/Serialization/JsonSerializer.cs
+++ b/Emby.Server.Implementations/Serialization/JsonSerializer.cs
@@ -1,3 +1,5 @@
+#pragma warning disable CS1591
+
using System;
using System.Globalization;
using System.IO;
@@ -11,6 +13,9 @@ namespace Emby.Server.Implementations.Serialization
/// </summary>
public class JsonSerializer : IJsonSerializer
{
+ /// <summary>
+ /// Initializes a new instance of the <see cref="JsonSerializer" /> class.
+ /// </summary>
public JsonSerializer()
{
ServiceStack.Text.JsConfig.DateHandler = ServiceStack.Text.DateHandler.ISO8601;
diff --git a/Emby.Server.Implementations/Services/HttpResult.cs b/Emby.Server.Implementations/Services/HttpResult.cs
index 095193828..8ba86f756 100644
--- a/Emby.Server.Implementations/Services/HttpResult.cs
+++ b/Emby.Server.Implementations/Services/HttpResult.cs
@@ -1,3 +1,5 @@
+#pragma warning disable CS1591
+
using System.Collections.Generic;
using System.IO;
using System.Net;
diff --git a/Emby.Server.Implementations/Services/RequestHelper.cs b/Emby.Server.Implementations/Services/RequestHelper.cs
index 2563cac99..1f9c7fc22 100644
--- a/Emby.Server.Implementations/Services/RequestHelper.cs
+++ b/Emby.Server.Implementations/Services/RequestHelper.cs
@@ -1,3 +1,5 @@
+#pragma warning disable CS1591
+
using System;
using System.IO;
using System.Threading.Tasks;
@@ -43,10 +45,7 @@ namespace Emby.Server.Implementations.Services
private static string GetContentTypeWithoutEncoding(string contentType)
{
- return contentType == null
- ? null
- : contentType.Split(';')[0].ToLowerInvariant().Trim();
+ return contentType?.Split(';')[0].ToLowerInvariant().Trim();
}
-
}
}
diff --git a/Emby.Server.Implementations/Services/ResponseHelper.cs b/Emby.Server.Implementations/Services/ResponseHelper.cs
index a566b18dd..f2b1d06f3 100644
--- a/Emby.Server.Implementations/Services/ResponseHelper.cs
+++ b/Emby.Server.Implementations/Services/ResponseHelper.cs
@@ -1,3 +1,5 @@
+#pragma warning disable CS1591
+
using System;
using System.Globalization;
using System.IO;
@@ -43,8 +45,7 @@ namespace Emby.Server.Implementations.Services
response.StatusCode = httpResult.Status;
}
- var responseOptions = result as IHasHeaders;
- if (responseOptions != null)
+ if (result is IHasHeaders responseOptions)
{
foreach (var responseHeaders in responseOptions.Headers)
{
diff --git a/Emby.Server.Implementations/Services/ServiceController.cs b/Emby.Server.Implementations/Services/ServiceController.cs
index e24a95dbb..ad6015c1c 100644
--- a/Emby.Server.Implementations/Services/ServiceController.cs
+++ b/Emby.Server.Implementations/Services/ServiceController.cs
@@ -1,3 +1,5 @@
+#pragma warning disable CS1591
+
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
diff --git a/Emby.Server.Implementations/Services/ServiceExec.cs b/Emby.Server.Implementations/Services/ServiceExec.cs
index 9f5f97028..606f2a240 100644
--- a/Emby.Server.Implementations/Services/ServiceExec.cs
+++ b/Emby.Server.Implementations/Services/ServiceExec.cs
@@ -1,3 +1,5 @@
+#pragma warning disable CS1591
+
using System;
using System.Collections.Generic;
using System.Linq;
diff --git a/Emby.Server.Implementations/Services/ServiceHandler.cs b/Emby.Server.Implementations/Services/ServiceHandler.cs
index 934560de3..7f44357e1 100644
--- a/Emby.Server.Implementations/Services/ServiceHandler.cs
+++ b/Emby.Server.Implementations/Services/ServiceHandler.cs
@@ -1,3 +1,5 @@
+#pragma warning disable CS1591
+
using System;
using System.Collections.Generic;
using System.Reflection;
diff --git a/Emby.Server.Implementations/Services/ServiceMethod.cs b/Emby.Server.Implementations/Services/ServiceMethod.cs
index 5018bf4a2..59ee5908f 100644
--- a/Emby.Server.Implementations/Services/ServiceMethod.cs
+++ b/Emby.Server.Implementations/Services/ServiceMethod.cs
@@ -1,3 +1,5 @@
+#pragma warning disable CS1591
+
using System;
namespace Emby.Server.Implementations.Services
diff --git a/Emby.Server.Implementations/Services/ServicePath.cs b/Emby.Server.Implementations/Services/ServicePath.cs
index 27c4dcba0..278379a92 100644
--- a/Emby.Server.Implementations/Services/ServicePath.cs
+++ b/Emby.Server.Implementations/Services/ServicePath.cs
@@ -1,3 +1,5 @@
+#pragma warning disable CS1591
+
using System;
using System.Collections.Generic;
using System.Globalization;
diff --git a/Emby.Server.Implementations/Services/StringMapTypeDeserializer.cs b/Emby.Server.Implementations/Services/StringMapTypeDeserializer.cs
index 56e23d549..ab22fe019 100644
--- a/Emby.Server.Implementations/Services/StringMapTypeDeserializer.cs
+++ b/Emby.Server.Implementations/Services/StringMapTypeDeserializer.cs
@@ -1,3 +1,5 @@
+#pragma warning disable CS1591
+
using System;
using System.Collections.Generic;
using System.Reflection;
diff --git a/Emby.Server.Implementations/Services/SwaggerService.cs b/Emby.Server.Implementations/Services/SwaggerService.cs
index 5177251c3..16142a70d 100644
--- a/Emby.Server.Implementations/Services/SwaggerService.cs
+++ b/Emby.Server.Implementations/Services/SwaggerService.cs
@@ -1,3 +1,5 @@
+#pragma warning disable CS1591
+
using System;
using System.Collections.Generic;
using System.Linq;
diff --git a/Emby.Server.Implementations/Services/UrlExtensions.cs b/Emby.Server.Implementations/Services/UrlExtensions.cs
index 483c63ade..e3b6aa197 100644
--- a/Emby.Server.Implementations/Services/UrlExtensions.cs
+++ b/Emby.Server.Implementations/Services/UrlExtensions.cs
@@ -1,3 +1,5 @@
+#pragma warning disable CS1591
+
using System;
using MediaBrowser.Common.Extensions;
diff --git a/Emby.Server.Implementations/Session/SessionManager.cs b/Emby.Server.Implementations/Session/SessionManager.cs
index 94423c287..900eba18e 100644
--- a/Emby.Server.Implementations/Session/SessionManager.cs
+++ b/Emby.Server.Implementations/Session/SessionManager.cs
@@ -1,3 +1,5 @@
+#pragma warning disable CS1591
+
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
diff --git a/Emby.Server.Implementations/SocketSharp/HttpFile.cs b/Emby.Server.Implementations/SocketSharp/HttpFile.cs
deleted file mode 100644
index 120ac50d9..000000000
--- a/Emby.Server.Implementations/SocketSharp/HttpFile.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-using System.IO;
-using MediaBrowser.Model.Services;
-
-namespace Emby.Server.Implementations.SocketSharp
-{
- public class HttpFile : IHttpFile
- {
- public string Name { get; set; }
-
- public string FileName { get; set; }
-
- public long ContentLength { get; set; }
-
- public string ContentType { get; set; }
-
- public Stream InputStream { get; set; }
- }
-}
diff --git a/Emby.Server.Implementations/SocketSharp/HttpPostedFile.cs b/Emby.Server.Implementations/SocketSharp/HttpPostedFile.cs
deleted file mode 100644
index 7479d8104..000000000
--- a/Emby.Server.Implementations/SocketSharp/HttpPostedFile.cs
+++ /dev/null
@@ -1,198 +0,0 @@
-using System;
-using System.IO;
-
-public sealed class HttpPostedFile : IDisposable
-{
- private string _name;
- private string _contentType;
- private Stream _stream;
- private bool _disposed = false;
-
- internal HttpPostedFile(string name, string content_type, Stream base_stream, long offset, long length)
- {
- _name = name;
- _contentType = content_type;
- _stream = new ReadSubStream(base_stream, offset, length);
- }
-
- public string ContentType => _contentType;
-
- public int ContentLength => (int)_stream.Length;
-
- public string FileName => _name;
-
- public Stream InputStream => _stream;
-
- /// <summary>
- /// Releases the unmanaged resources and disposes of the managed resources used.
- /// </summary>
- public void Dispose()
- {
- if (_disposed)
- {
- return;
- }
-
- _stream.Dispose();
- _stream = null;
-
- _name = null;
- _contentType = null;
-
- _disposed = true;
- }
-
- private class ReadSubStream : Stream
- {
- private Stream _stream;
- private long _offset;
- private long _end;
- private long _position;
-
- public ReadSubStream(Stream s, long offset, long length)
- {
- _stream = s;
- _offset = offset;
- _end = offset + length;
- _position = offset;
- }
-
- public override bool CanRead => true;
-
- public override bool CanSeek => true;
-
- public override bool CanWrite => false;
-
- public override long Length => _end - _offset;
-
- public override long Position
- {
- get => _position - _offset;
- set
- {
- if (value > Length)
- {
- throw new ArgumentOutOfRangeException(nameof(value));
- }
-
- _position = Seek(value, SeekOrigin.Begin);
- }
- }
-
- public override void Flush()
- {
- }
-
- public override int Read(byte[] buffer, int dest_offset, int count)
- {
- if (buffer == null)
- {
- throw new ArgumentNullException(nameof(buffer));
- }
-
- if (dest_offset < 0)
- {
- throw new ArgumentOutOfRangeException(nameof(dest_offset), "< 0");
- }
-
- if (count < 0)
- {
- throw new ArgumentOutOfRangeException(nameof(count), "< 0");
- }
-
- int len = buffer.Length;
- if (dest_offset > len)
- {
- throw new ArgumentException("destination offset is beyond array size", nameof(dest_offset));
- }
-
- // reordered to avoid possible integer overflow
- if (dest_offset > len - count)
- {
- throw new ArgumentException("Reading would overrun buffer", nameof(count));
- }
-
- if (count > _end - _position)
- {
- count = (int)(_end - _position);
- }
-
- if (count <= 0)
- {
- return 0;
- }
-
- _stream.Position = _position;
- int result = _stream.Read(buffer, dest_offset, count);
- if (result > 0)
- {
- _position += result;
- }
- else
- {
- _position = _end;
- }
-
- return result;
- }
-
- public override int ReadByte()
- {
- if (_position >= _end)
- {
- return -1;
- }
-
- _stream.Position = _position;
- int result = _stream.ReadByte();
- if (result < 0)
- {
- _position = _end;
- }
- else
- {
- _position++;
- }
-
- return result;
- }
-
- public override long Seek(long d, SeekOrigin origin)
- {
- long real;
- switch (origin)
- {
- case SeekOrigin.Begin:
- real = _offset + d;
- break;
- case SeekOrigin.End:
- real = _end + d;
- break;
- case SeekOrigin.Current:
- real = _position + d;
- break;
- default:
- throw new ArgumentException("Unknown SeekOrigin value", nameof(origin));
- }
-
- long virt = real - _offset;
- if (virt < 0 || virt > Length)
- {
- throw new ArgumentException("Invalid position", nameof(d));
- }
-
- _position = _stream.Seek(real, SeekOrigin.Begin);
- return _position;
- }
-
- public override void SetLength(long value)
- {
- throw new NotSupportedException();
- }
-
- public override void Write(byte[] buffer, int offset, int count)
- {
- throw new NotSupportedException();
- }
- }
-}
diff --git a/Emby.Server.Implementations/SocketSharp/WebSocketSharpRequest.cs b/Emby.Server.Implementations/SocketSharp/WebSocketSharpRequest.cs
index ee5131c1f..aa76901a4 100644
--- a/Emby.Server.Implementations/SocketSharp/WebSocketSharpRequest.cs
+++ b/Emby.Server.Implementations/SocketSharp/WebSocketSharpRequest.cs
@@ -1,3 +1,5 @@
+#pragma warning disable CS1591
+
using System;
using System.Collections.Generic;
using System.IO;
@@ -209,7 +211,7 @@ namespace Emby.Server.Implementations.SocketSharp
private static string GetQueryStringContentType(HttpRequest httpReq)
{
ReadOnlySpan<char> format = httpReq.Query["format"].ToString();
- if (format == null)
+ if (format == ReadOnlySpan<char>.Empty)
{
const int FormatMaxLength = 4;
ReadOnlySpan<char> pi = httpReq.Path.ToString();
diff --git a/Emby.Server.Implementations/Sorting/AiredEpisodeOrderComparer.cs b/Emby.Server.Implementations/Sorting/AiredEpisodeOrderComparer.cs
index 16507466f..67e31f7f6 100644
--- a/Emby.Server.Implementations/Sorting/AiredEpisodeOrderComparer.cs
+++ b/Emby.Server.Implementations/Sorting/AiredEpisodeOrderComparer.cs
@@ -1,3 +1,5 @@
+#pragma warning disable CS1591
+
using System;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Entities.TV;
diff --git a/Emby.Server.Implementations/Sorting/CommunityRatingComparer.cs b/Emby.Server.Implementations/Sorting/CommunityRatingComparer.cs
index 87d3ae2d6..980954ba0 100644
--- a/Emby.Server.Implementations/Sorting/CommunityRatingComparer.cs
+++ b/Emby.Server.Implementations/Sorting/CommunityRatingComparer.cs
@@ -1,3 +1,5 @@
+#pragma warning disable CS1591
+
using System;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Sorting;
@@ -8,6 +10,12 @@ namespace Emby.Server.Implementations.Sorting
public class CommunityRatingComparer : IBaseItemComparer
{
/// <summary>
+ /// Gets the name.
+ /// </summary>
+ /// <value>The name.</value>
+ public string Name => ItemSortBy.CommunityRating;
+
+ /// <summary>
/// Compares the specified x.
/// </summary>
/// <param name="x">The x.</param>
@@ -16,18 +24,16 @@ namespace Emby.Server.Implementations.Sorting
public int Compare(BaseItem x, BaseItem y)
{
if (x == null)
+ {
throw new ArgumentNullException(nameof(x));
+ }
if (y == null)
+ {
throw new ArgumentNullException(nameof(y));
+ }
return (x.CommunityRating ?? 0).CompareTo(y.CommunityRating ?? 0);
}
-
- /// <summary>
- /// Gets the name.
- /// </summary>
- /// <value>The name.</value>
- public string Name => ItemSortBy.CommunityRating;
}
}
diff --git a/Emby.Server.Implementations/Sorting/DateLastMediaAddedComparer.cs b/Emby.Server.Implementations/Sorting/DateLastMediaAddedComparer.cs
index b58d0b1ff..03ff19d21 100644
--- a/Emby.Server.Implementations/Sorting/DateLastMediaAddedComparer.cs
+++ b/Emby.Server.Implementations/Sorting/DateLastMediaAddedComparer.cs
@@ -1,3 +1,5 @@
+#pragma warning disable CS1591
+
using System;
using Jellyfin.Data.Entities;
using MediaBrowser.Controller.Entities;
@@ -28,6 +30,12 @@ namespace Emby.Server.Implementations.Sorting
public IUserDataManager UserDataRepository { get; set; }
/// <summary>
+ /// Gets the name.
+ /// </summary>
+ /// <value>The name.</value>
+ public string Name => ItemSortBy.DateLastContentAdded;
+
+ /// <summary>
/// Compares the specified x.
/// </summary>
/// <param name="x">The x.</param>
@@ -45,9 +53,7 @@ namespace Emby.Server.Implementations.Sorting
/// <returns>DateTime.</returns>
private static DateTime GetDate(BaseItem x)
{
- var folder = x as Folder;
-
- if (folder != null)
+ if (x is Folder folder)
{
if (folder.DateLastMediaAdded.HasValue)
{
@@ -57,11 +63,5 @@ namespace Emby.Server.Implementations.Sorting
return DateTime.MinValue;
}
-
- /// <summary>
- /// Gets the name.
- /// </summary>
- /// <value>The name.</value>
- public string Name => ItemSortBy.DateLastContentAdded;
}
}
diff --git a/Emby.Server.Implementations/Sorting/IsFavoriteOrLikeComparer.cs b/Emby.Server.Implementations/Sorting/IsFavoriteOrLikeComparer.cs
index 8ae0a613b..0c4e82d01 100644
--- a/Emby.Server.Implementations/Sorting/IsFavoriteOrLikeComparer.cs
+++ b/Emby.Server.Implementations/Sorting/IsFavoriteOrLikeComparer.cs
@@ -1,3 +1,5 @@
+#pragma warning disable CS1591
+
using Jellyfin.Data.Entities;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Library;
@@ -15,6 +17,24 @@ namespace Emby.Server.Implementations.Sorting
public User User { get; set; }
/// <summary>
+ /// Gets the name.
+ /// </summary>
+ /// <value>The name.</value>
+ public string Name => ItemSortBy.IsFavoriteOrLiked;
+
+ /// <summary>
+ /// Gets or sets the user data repository.
+ /// </summary>
+ /// <value>The user data repository.</value>
+ public IUserDataManager UserDataRepository { get; set; }
+
+ /// <summary>
+ /// Gets or sets the user manager.
+ /// </summary>
+ /// <value>The user manager.</value>
+ public IUserManager UserManager { get; set; }
+
+ /// <summary>
/// Compares the specified x.
/// </summary>
/// <param name="x">The x.</param>
@@ -34,23 +54,5 @@ namespace Emby.Server.Implementations.Sorting
{
return x.IsFavoriteOrLiked(User) ? 0 : 1;
}
-
- /// <summary>
- /// Gets the name.
- /// </summary>
- /// <value>The name.</value>
- public string Name => ItemSortBy.IsFavoriteOrLiked;
-
- /// <summary>
- /// Gets or sets the user data repository.
- /// </summary>
- /// <value>The user data repository.</value>
- public IUserDataManager UserDataRepository { get; set; }
-
- /// <summary>
- /// Gets or sets the user manager.
- /// </summary>
- /// <value>The user manager.</value>
- public IUserManager UserManager { get; set; }
}
}
diff --git a/Emby.Server.Implementations/Sorting/IsFolderComparer.cs b/Emby.Server.Implementations/Sorting/IsFolderComparer.cs
index dfaa144cd..a35192eff 100644
--- a/Emby.Server.Implementations/Sorting/IsFolderComparer.cs
+++ b/Emby.Server.Implementations/Sorting/IsFolderComparer.cs
@@ -1,3 +1,5 @@
+#pragma warning disable CS1591
+
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Sorting;
using MediaBrowser.Model.Querying;
@@ -7,6 +9,12 @@ namespace Emby.Server.Implementations.Sorting
public class IsFolderComparer : IBaseItemComparer
{
/// <summary>
+ /// Gets the name.
+ /// </summary>
+ /// <value>The name.</value>
+ public string Name => ItemSortBy.IsFolder;
+
+ /// <summary>
/// Compares the specified x.
/// </summary>
/// <param name="x">The x.</param>
@@ -26,11 +34,5 @@ namespace Emby.Server.Implementations.Sorting
{
return x.IsFolder ? 0 : 1;
}
-
- /// <summary>
- /// Gets the name.
- /// </summary>
- /// <value>The name.</value>
- public string Name => ItemSortBy.IsFolder;
}
}
diff --git a/Emby.Server.Implementations/Sorting/IsPlayedComparer.cs b/Emby.Server.Implementations/Sorting/IsPlayedComparer.cs
index 3b3c04922..d95948406 100644
--- a/Emby.Server.Implementations/Sorting/IsPlayedComparer.cs
+++ b/Emby.Server.Implementations/Sorting/IsPlayedComparer.cs
@@ -1,3 +1,5 @@
+#pragma warning disable CS1591
+
using Jellyfin.Data.Entities;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Library;
@@ -15,6 +17,24 @@ namespace Emby.Server.Implementations.Sorting
public User User { get; set; }
/// <summary>
+ /// Gets the name.
+ /// </summary>
+ /// <value>The name.</value>
+ public string Name => ItemSortBy.IsUnplayed;
+
+ /// <summary>
+ /// Gets or sets the user data repository.
+ /// </summary>
+ /// <value>The user data repository.</value>
+ public IUserDataManager UserDataRepository { get; set; }
+
+ /// <summary>
+ /// Gets or sets the user manager.
+ /// </summary>
+ /// <value>The user manager.</value>
+ public IUserManager UserManager { get; set; }
+
+ /// <summary>
/// Compares the specified x.
/// </summary>
/// <param name="x">The x.</param>
@@ -34,23 +54,5 @@ namespace Emby.Server.Implementations.Sorting
{
return x.IsPlayed(User) ? 0 : 1;
}
-
- /// <summary>
- /// Gets the name.
- /// </summary>
- /// <value>The name.</value>
- public string Name => ItemSortBy.IsUnplayed;
-
- /// <summary>
- /// Gets or sets the user data repository.
- /// </summary>
- /// <value>The user data repository.</value>
- public IUserDataManager UserDataRepository { get; set; }
-
- /// <summary>
- /// Gets or sets the user manager.
- /// </summary>
- /// <value>The user manager.</value>
- public IUserManager UserManager { get; set; }
}
}
diff --git a/Emby.Server.Implementations/Sorting/IsUnplayedComparer.cs b/Emby.Server.Implementations/Sorting/IsUnplayedComparer.cs
index 5719356c7..1632c5a7a 100644
--- a/Emby.Server.Implementations/Sorting/IsUnplayedComparer.cs
+++ b/Emby.Server.Implementations/Sorting/IsUnplayedComparer.cs
@@ -1,3 +1,5 @@
+#pragma warning disable CS1591
+
using Jellyfin.Data.Entities;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Library;
@@ -15,6 +17,24 @@ namespace Emby.Server.Implementations.Sorting
public User User { get; set; }
/// <summary>
+ /// Gets the name.
+ /// </summary>
+ /// <value>The name.</value>
+ public string Name => ItemSortBy.IsUnplayed;
+
+ /// <summary>
+ /// Gets or sets the user data repository.
+ /// </summary>
+ /// <value>The user data repository.</value>
+ public IUserDataManager UserDataRepository { get; set; }
+
+ /// <summary>
+ /// Gets or sets the user manager.
+ /// </summary>
+ /// <value>The user manager.</value>
+ public IUserManager UserManager { get; set; }
+
+ /// <summary>
/// Compares the specified x.
/// </summary>
/// <param name="x">The x.</param>
@@ -34,23 +54,5 @@ namespace Emby.Server.Implementations.Sorting
{
return x.IsUnplayed(User) ? 0 : 1;
}
-
- /// <summary>
- /// Gets the name.
- /// </summary>
- /// <value>The name.</value>
- public string Name => ItemSortBy.IsUnplayed;
-
- /// <summary>
- /// Gets or sets the user data repository.
- /// </summary>
- /// <value>The user data repository.</value>
- public IUserDataManager UserDataRepository { get; set; }
-
- /// <summary>
- /// Gets or sets the user manager.
- /// </summary>
- /// <value>The user manager.</value>
- public IUserManager UserManager { get; set; }
}
}
diff --git a/Emby.Server.Implementations/Sorting/OfficialRatingComparer.cs b/Emby.Server.Implementations/Sorting/OfficialRatingComparer.cs
index 7afbd9ff7..76bb798b5 100644
--- a/Emby.Server.Implementations/Sorting/OfficialRatingComparer.cs
+++ b/Emby.Server.Implementations/Sorting/OfficialRatingComparer.cs
@@ -1,3 +1,5 @@
+#pragma warning disable CS1591
+
using System;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Sorting;
@@ -16,6 +18,12 @@ namespace Emby.Server.Implementations.Sorting
}
/// <summary>
+ /// Gets the name.
+ /// </summary>
+ /// <value>The name.</value>
+ public string Name => ItemSortBy.OfficialRating;
+
+ /// <summary>
/// Compares the specified x.
/// </summary>
/// <param name="x">The x.</param>
@@ -38,11 +46,5 @@ namespace Emby.Server.Implementations.Sorting
return levelX.CompareTo(levelY);
}
-
- /// <summary>
- /// Gets the name.
- /// </summary>
- /// <value>The name.</value>
- public string Name => ItemSortBy.OfficialRating;
}
}
diff --git a/Emby.Server.Implementations/Sorting/SeriesSortNameComparer.cs b/Emby.Server.Implementations/Sorting/SeriesSortNameComparer.cs
index 504b6d283..b9205ee07 100644
--- a/Emby.Server.Implementations/Sorting/SeriesSortNameComparer.cs
+++ b/Emby.Server.Implementations/Sorting/SeriesSortNameComparer.cs
@@ -1,3 +1,5 @@
+#pragma warning disable CS1591
+
using System;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Sorting;
@@ -8,6 +10,12 @@ namespace Emby.Server.Implementations.Sorting
public class SeriesSortNameComparer : IBaseItemComparer
{
/// <summary>
+ /// Gets the name.
+ /// </summary>
+ /// <value>The name.</value>
+ public string Name => ItemSortBy.SeriesSortName;
+
+ /// <summary>
/// Compares the specified x.
/// </summary>
/// <param name="x">The x.</param>
@@ -18,12 +26,6 @@ namespace Emby.Server.Implementations.Sorting
return string.Compare(GetValue(x), GetValue(y), StringComparison.CurrentCultureIgnoreCase);
}
- /// <summary>
- /// Gets the name.
- /// </summary>
- /// <value>The name.</value>
- public string Name => ItemSortBy.SeriesSortName;
-
private static string GetValue(BaseItem item)
{
var hasSeries = item as IHasSeries;
diff --git a/Emby.Server.Implementations/Sorting/StartDateComparer.cs b/Emby.Server.Implementations/Sorting/StartDateComparer.cs
index aa040fa15..558a3d351 100644
--- a/Emby.Server.Implementations/Sorting/StartDateComparer.cs
+++ b/Emby.Server.Implementations/Sorting/StartDateComparer.cs
@@ -1,3 +1,5 @@
+#pragma warning disable CS1591
+
using System;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.LiveTv;
@@ -9,6 +11,12 @@ namespace Emby.Server.Implementations.Sorting
public class StartDateComparer : IBaseItemComparer
{
/// <summary>
+ /// Gets the name.
+ /// </summary>
+ /// <value>The name.</value>
+ public string Name => ItemSortBy.StartDate;
+
+ /// <summary>
/// Compares the specified x.
/// </summary>
/// <param name="x">The x.</param>
@@ -26,19 +34,12 @@ namespace Emby.Server.Implementations.Sorting
/// <returns>DateTime.</returns>
private static DateTime GetDate(BaseItem x)
{
- var hasStartDate = x as LiveTvProgram;
-
- if (hasStartDate != null)
+ if (x is LiveTvProgram hasStartDate)
{
return hasStartDate.StartDate;
}
+
return DateTime.MinValue;
}
-
- /// <summary>
- /// Gets the name.
- /// </summary>
- /// <value>The name.</value>
- public string Name => ItemSortBy.StartDate;
}
}
diff --git a/Emby.Server.Implementations/Sorting/StudioComparer.cs b/Emby.Server.Implementations/Sorting/StudioComparer.cs
index c9ac765c1..5766dc542 100644
--- a/Emby.Server.Implementations/Sorting/StudioComparer.cs
+++ b/Emby.Server.Implementations/Sorting/StudioComparer.cs
@@ -1,3 +1,5 @@
+#pragma warning disable CS1591
+
using System;
using System.Linq;
using MediaBrowser.Controller.Entities;
diff --git a/Emby.Server.Implementations/SyncPlay/SyncPlayController.cs b/Emby.Server.Implementations/SyncPlay/SyncPlayController.cs
index d430d4d16..d0812a13f 100644
--- a/Emby.Server.Implementations/SyncPlay/SyncPlayController.cs
+++ b/Emby.Server.Implementations/SyncPlay/SyncPlayController.cs
@@ -65,6 +65,11 @@ namespace Emby.Server.Implementations.SyncPlay
/// <inheritdoc />
public bool IsGroupEmpty() => _group.IsEmpty();
+ /// <summary>
+ /// Initializes a new instance of the <see cref="SyncPlayController" /> class.
+ /// </summary>
+ /// <param name="sessionManager">The session manager.</param>
+ /// <param name="syncPlayManager">The SyncPlay manager.</param>
public SyncPlayController(
ISessionManager sessionManager,
ISyncPlayManager syncPlayManager)
diff --git a/Emby.Server.Implementations/SyncPlay/SyncPlayManager.cs b/Emby.Server.Implementations/SyncPlay/SyncPlayManager.cs
index 8885266d3..06f702e38 100644
--- a/Emby.Server.Implementations/SyncPlay/SyncPlayManager.cs
+++ b/Emby.Server.Implementations/SyncPlay/SyncPlayManager.cs
@@ -57,6 +57,13 @@ namespace Emby.Server.Implementations.SyncPlay
private bool _disposed = false;
+ /// <summary>
+ /// Initializes a new instance of the <see cref="SyncPlayManager" /> class.
+ /// </summary>
+ /// <param name="logger">The logger.</param>
+ /// <param name="userManager">The user manager.</param>
+ /// <param name="sessionManager">The session manager.</param>
+ /// <param name="libraryManager">The library manager.</param>
public SyncPlayManager(
ILogger<SyncPlayManager> logger,
IUserManager userManager,
diff --git a/Emby.Server.Implementations/TV/TVSeriesManager.cs b/Emby.Server.Implementations/TV/TVSeriesManager.cs
index 570de49db..6999668d1 100644
--- a/Emby.Server.Implementations/TV/TVSeriesManager.cs
+++ b/Emby.Server.Implementations/TV/TVSeriesManager.cs
@@ -1,3 +1,5 @@
+#pragma warning disable CS1591
+
using System;
using System.Collections.Generic;
using System.Globalization;
@@ -21,14 +23,12 @@ namespace Emby.Server.Implementations.TV
private readonly IUserManager _userManager;
private readonly IUserDataManager _userDataManager;
private readonly ILibraryManager _libraryManager;
- private readonly IServerConfigurationManager _config;
- public TVSeriesManager(IUserManager userManager, IUserDataManager userDataManager, ILibraryManager libraryManager, IServerConfigurationManager config)
+ public TVSeriesManager(IUserManager userManager, IUserDataManager userDataManager, ILibraryManager libraryManager)
{
_userManager = userManager;
_userDataManager = userDataManager;
_libraryManager = libraryManager;
- _config = config;
}
public QueryResult<BaseItem> GetNextUp(NextUpQuery request, DtoOptions dtoOptions)
diff --git a/Emby.Server.Implementations/Updates/InstallationManager.cs b/Emby.Server.Implementations/Updates/InstallationManager.cs
index 980572cc2..178f32c31 100644
--- a/Emby.Server.Implementations/Updates/InstallationManager.cs
+++ b/Emby.Server.Implementations/Updates/InstallationManager.cs
@@ -1,4 +1,7 @@
+#pragma warning disable CS1591
+
using System;
+using System.Collections;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.IO;
@@ -95,25 +98,25 @@ namespace Emby.Server.Implementations.Updates
}
/// <inheritdoc />
- public event EventHandler<InstallationEventArgs> PackageInstalling;
+ public event EventHandler<InstallationInfo> PackageInstalling;
/// <inheritdoc />
- public event EventHandler<InstallationEventArgs> PackageInstallationCompleted;
+ public event EventHandler<InstallationInfo> PackageInstallationCompleted;
/// <inheritdoc />
public event EventHandler<InstallationFailedEventArgs> PackageInstallationFailed;
/// <inheritdoc />
- public event EventHandler<InstallationEventArgs> PackageInstallationCancelled;
+ public event EventHandler<InstallationInfo> PackageInstallationCancelled;
/// <inheritdoc />
- public event EventHandler<GenericEventArgs<IPlugin>> PluginUninstalled;
+ public event EventHandler<IPlugin> PluginUninstalled;
/// <inheritdoc />
- public event EventHandler<GenericEventArgs<(IPlugin, VersionInfo)>> PluginUpdated;
+ public event EventHandler<InstallationInfo> PluginUpdated;
/// <inheritdoc />
- public event EventHandler<GenericEventArgs<VersionInfo>> PluginInstalled;
+ public event EventHandler<InstallationInfo> PluginInstalled;
/// <inheritdoc />
public IEnumerable<InstallationInfo> CompletedInstallations => _completedInstallationsInternal;
@@ -181,24 +184,7 @@ namespace Emby.Server.Implementations.Updates
}
/// <inheritdoc />
- public IEnumerable<VersionInfo> GetCompatibleVersions(
- IEnumerable<VersionInfo> availableVersions,
- Version minVersion = null)
- {
- var appVer = _applicationHost.ApplicationVersion;
- availableVersions = availableVersions
- .Where(x => Version.Parse(x.targetAbi) <= appVer);
-
- if (minVersion != null)
- {
- availableVersions = availableVersions.Where(x => x.version >= minVersion);
- }
-
- return availableVersions.OrderByDescending(x => x.version);
- }
-
- /// <inheritdoc />
- public IEnumerable<VersionInfo> GetCompatibleVersions(
+ public IEnumerable<InstallationInfo> GetCompatibleVersions(
IEnumerable<PackageInfo> availablePackages,
string name = null,
Guid guid = default,
@@ -209,28 +195,46 @@ namespace Emby.Server.Implementations.Updates
// Package not found in repository
if (package == null)
{
- return Enumerable.Empty<VersionInfo>();
+ yield break;
}
- return GetCompatibleVersions(
- package.versions,
- minVersion);
+ var appVer = _applicationHost.ApplicationVersion;
+ var availableVersions = package.versions
+ .Where(x => Version.Parse(x.targetAbi) <= appVer);
+
+ if (minVersion != null)
+ {
+ availableVersions = availableVersions.Where(x => new Version(x.version) >= minVersion);
+ }
+
+ foreach (var v in availableVersions.OrderByDescending(x => x.version))
+ {
+ yield return new InstallationInfo
+ {
+ Changelog = v.changelog,
+ Guid = new Guid(package.guid),
+ Name = package.name,
+ Version = new Version(v.version),
+ SourceUrl = v.sourceUrl,
+ Checksum = v.checksum
+ };
+ }
}
/// <inheritdoc />
- public async Task<IEnumerable<VersionInfo>> GetAvailablePluginUpdates(CancellationToken cancellationToken = default)
+ public async Task<IEnumerable<InstallationInfo>> GetAvailablePluginUpdates(CancellationToken cancellationToken = default)
{
var catalog = await GetAvailablePackages(cancellationToken).ConfigureAwait(false);
return GetAvailablePluginUpdates(catalog);
}
- private IEnumerable<VersionInfo> GetAvailablePluginUpdates(IReadOnlyList<PackageInfo> pluginCatalog)
+ private IEnumerable<InstallationInfo> GetAvailablePluginUpdates(IReadOnlyList<PackageInfo> pluginCatalog)
{
foreach (var plugin in _applicationHost.Plugins)
{
var compatibleversions = GetCompatibleVersions(pluginCatalog, plugin.Name, plugin.Id, plugin.Version);
- var version = compatibleversions.FirstOrDefault(y => y.version > plugin.Version);
- if (version != null && !CompletedInstallations.Any(x => string.Equals(x.Guid, version.guid, StringComparison.OrdinalIgnoreCase)))
+ var version = compatibleversions.FirstOrDefault(y => y.Version > plugin.Version);
+ if (version != null && CompletedInstallations.All(x => x.Guid != version.Guid))
{
yield return version;
}
@@ -238,23 +242,16 @@ namespace Emby.Server.Implementations.Updates
}
/// <inheritdoc />
- public async Task InstallPackage(VersionInfo package, CancellationToken cancellationToken)
+ public async Task InstallPackage(InstallationInfo package, CancellationToken cancellationToken)
{
if (package == null)
{
throw new ArgumentNullException(nameof(package));
}
- var installationInfo = new InstallationInfo
- {
- Guid = package.guid,
- Name = package.name,
- Version = package.version.ToString()
- };
-
var innerCancellationTokenSource = new CancellationTokenSource();
- var tuple = (installationInfo, innerCancellationTokenSource);
+ var tuple = (package, innerCancellationTokenSource);
// Add it to the in-progress list
lock (_currentInstallationsLock)
@@ -264,13 +261,7 @@ namespace Emby.Server.Implementations.Updates
var linkedToken = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken, innerCancellationTokenSource.Token).Token;
- var installationEventArgs = new InstallationEventArgs
- {
- InstallationInfo = installationInfo,
- VersionInfo = package
- };
-
- PackageInstalling?.Invoke(this, installationEventArgs);
+ PackageInstalling?.Invoke(this, package);
try
{
@@ -281,9 +272,9 @@ namespace Emby.Server.Implementations.Updates
_currentInstallations.Remove(tuple);
}
- _completedInstallationsInternal.Add(installationInfo);
+ _completedInstallationsInternal.Add(package);
- PackageInstallationCompleted?.Invoke(this, installationEventArgs);
+ PackageInstallationCompleted?.Invoke(this, package);
}
catch (OperationCanceledException)
{
@@ -292,9 +283,9 @@ namespace Emby.Server.Implementations.Updates
_currentInstallations.Remove(tuple);
}
- _logger.LogInformation("Package installation cancelled: {0} {1}", package.name, package.version);
+ _logger.LogInformation("Package installation cancelled: {0} {1}", package.Name, package.Version);
- PackageInstallationCancelled?.Invoke(this, installationEventArgs);
+ PackageInstallationCancelled?.Invoke(this, package);
throw;
}
@@ -309,7 +300,7 @@ namespace Emby.Server.Implementations.Updates
PackageInstallationFailed?.Invoke(this, new InstallationFailedEventArgs
{
- InstallationInfo = installationInfo,
+ InstallationInfo = package,
Exception = ex
});
@@ -328,11 +319,11 @@ namespace Emby.Server.Implementations.Updates
/// <param name="package">The package.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns><see cref="Task" />.</returns>
- private async Task InstallPackageInternal(VersionInfo package, CancellationToken cancellationToken)
+ private async Task InstallPackageInternal(InstallationInfo package, CancellationToken cancellationToken)
{
// Set last update time if we were installed before
- IPlugin plugin = _applicationHost.Plugins.FirstOrDefault(p => string.Equals(p.Id.ToString(), package.guid, StringComparison.OrdinalIgnoreCase))
- ?? _applicationHost.Plugins.FirstOrDefault(p => p.Name.Equals(package.name, StringComparison.OrdinalIgnoreCase));
+ IPlugin plugin = _applicationHost.Plugins.FirstOrDefault(p => p.Id == package.Guid)
+ ?? _applicationHost.Plugins.FirstOrDefault(p => p.Name.Equals(package.Name, StringComparison.OrdinalIgnoreCase));
// Do the install
await PerformPackageInstallation(package, cancellationToken).ConfigureAwait(false);
@@ -340,38 +331,38 @@ namespace Emby.Server.Implementations.Updates
// Do plugin-specific processing
if (plugin == null)
{
- _logger.LogInformation("New plugin installed: {0} {1} {2}", package.name, package.version);
+ _logger.LogInformation("New plugin installed: {0} {1}", package.Name, package.Version);
- PluginInstalled?.Invoke(this, new GenericEventArgs<VersionInfo>(package));
+ PluginInstalled?.Invoke(this, package);
}
else
{
- _logger.LogInformation("Plugin updated: {0} {1} {2}", package.name, package.version);
+ _logger.LogInformation("Plugin updated: {0} {1}", package.Name, package.Version);
- PluginUpdated?.Invoke(this, new GenericEventArgs<(IPlugin, VersionInfo)>((plugin, package)));
+ PluginUpdated?.Invoke(this, package);
}
_applicationHost.NotifyPendingRestart();
}
- private async Task PerformPackageInstallation(VersionInfo package, CancellationToken cancellationToken)
+ private async Task PerformPackageInstallation(InstallationInfo package, CancellationToken cancellationToken)
{
- var extension = Path.GetExtension(package.filename);
+ var extension = Path.GetExtension(package.SourceUrl);
if (!string.Equals(extension, ".zip", StringComparison.OrdinalIgnoreCase))
{
- _logger.LogError("Only zip packages are supported. {Filename} is not a zip archive.", package.filename);
+ _logger.LogError("Only zip packages are supported. {SourceUrl} is not a zip archive.", package.SourceUrl);
return;
}
// Always override the passed-in target (which is a file) and figure it out again
- string targetDir = Path.Combine(_appPaths.PluginsPath, package.name);
+ string targetDir = Path.Combine(_appPaths.PluginsPath, package.Name);
// CA5351: Do Not Use Broken Cryptographic Algorithms
#pragma warning disable CA5351
using (var res = await _httpClient.SendAsync(
new HttpRequestOptions
{
- Url = package.sourceUrl,
+ Url = package.SourceUrl,
CancellationToken = cancellationToken,
// We need it to be buffered for setting the position
BufferContent = true
@@ -383,12 +374,12 @@ namespace Emby.Server.Implementations.Updates
cancellationToken.ThrowIfCancellationRequested();
var hash = Hex.Encode(md5.ComputeHash(stream));
- if (!string.Equals(package.checksum, hash, StringComparison.OrdinalIgnoreCase))
+ if (!string.Equals(package.Checksum, hash, StringComparison.OrdinalIgnoreCase))
{
_logger.LogError(
"The checksums didn't match while installing {Package}, expected: {Expected}, got: {Received}",
- package.name,
- package.checksum,
+ package.Name,
+ package.Checksum,
hash);
throw new InvalidDataException("The checksum of the received data doesn't match.");
}
@@ -454,7 +445,7 @@ namespace Emby.Server.Implementations.Updates
_config.SaveConfiguration();
}
- PluginUninstalled?.Invoke(this, new GenericEventArgs<IPlugin> { Argument = plugin });
+ PluginUninstalled?.Invoke(this, plugin);
_applicationHost.NotifyPendingRestart();
}
@@ -464,7 +455,7 @@ namespace Emby.Server.Implementations.Updates
{
lock (_currentInstallationsLock)
{
- var install = _currentInstallations.Find(x => x.info.Guid == id.ToString());
+ var install = _currentInstallations.Find(x => x.info.Guid == id);
if (install == default((InstallationInfo, CancellationTokenSource)))
{
return false;
@@ -484,9 +475,9 @@ namespace Emby.Server.Implementations.Updates
}
/// <summary>
- /// Releases unmanaged and - optionally - managed resources.
+ /// Releases unmanaged and optionally managed resources.
/// </summary>
- /// <param name="dispose"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param>
+ /// <param name="dispose"><c>true</c> to release both managed and unmanaged resources or <c>false</c> to release only unmanaged resources.</param>
protected virtual void Dispose(bool dispose)
{
if (dispose)
diff --git a/Jellyfin.Api/Jellyfin.Api.csproj b/Jellyfin.Api/Jellyfin.Api.csproj
index 25d5d0c89..a8de171cc 100644
--- a/Jellyfin.Api/Jellyfin.Api.csproj
+++ b/Jellyfin.Api/Jellyfin.Api.csproj
@@ -9,6 +9,7 @@
<TargetFramework>netstandard2.1</TargetFramework>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
+ <Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
diff --git a/Jellyfin.Api/Models/StartupDtos/StartupConfigurationDto.cs b/Jellyfin.Api/Models/StartupDtos/StartupConfigurationDto.cs
index d048dad0a..5a83a030d 100644
--- a/Jellyfin.Api/Models/StartupDtos/StartupConfigurationDto.cs
+++ b/Jellyfin.Api/Models/StartupDtos/StartupConfigurationDto.cs
@@ -1,3 +1,5 @@
+#nullable disable
+
namespace Jellyfin.Api.Models.StartupDtos
{
/// <summary>
diff --git a/Jellyfin.Api/Models/StartupDtos/StartupUserDto.cs b/Jellyfin.Api/Models/StartupDtos/StartupUserDto.cs
index 3a9348037..0dbb245ec 100644
--- a/Jellyfin.Api/Models/StartupDtos/StartupUserDto.cs
+++ b/Jellyfin.Api/Models/StartupDtos/StartupUserDto.cs
@@ -1,3 +1,5 @@
+#nullable disable
+
namespace Jellyfin.Api.Models.StartupDtos
{
/// <summary>
diff --git a/Jellyfin.Data/Jellyfin.Data.csproj b/Jellyfin.Data/Jellyfin.Data.csproj
index d9dae8b74..92f80ebb7 100644
--- a/Jellyfin.Data/Jellyfin.Data.csproj
+++ b/Jellyfin.Data/Jellyfin.Data.csproj
@@ -4,6 +4,7 @@
<TargetFrameworks>netstandard2.0;netstandard2.1</TargetFrameworks>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
+ <TreatWarningsAsErrors Condition=" '$(Configuration)' == 'Release' ">true</TreatWarningsAsErrors>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
diff --git a/Jellyfin.Drawing.Skia/Jellyfin.Drawing.Skia.csproj b/Jellyfin.Drawing.Skia/Jellyfin.Drawing.Skia.csproj
index a6e1f490a..d3fdb5de4 100644
--- a/Jellyfin.Drawing.Skia/Jellyfin.Drawing.Skia.csproj
+++ b/Jellyfin.Drawing.Skia/Jellyfin.Drawing.Skia.csproj
@@ -18,6 +18,8 @@
</ItemGroup>
<ItemGroup>
+ <PackageReference Include="BlurHashSharp" Version="1.0.1" />
+ <PackageReference Include="BlurHashSharp.SkiaSharp" Version="1.0.0" />
<PackageReference Include="SkiaSharp" Version="1.68.1" />
<PackageReference Include="SkiaSharp.NativeAssets.Linux" Version="1.68.1" />
<PackageReference Include="Jellyfin.SkiaSharp.NativeAssets.LinuxArm" Version="1.68.1" />
diff --git a/Jellyfin.Drawing.Skia/SkiaEncoder.cs b/Jellyfin.Drawing.Skia/SkiaEncoder.cs
index 5c7462ee2..ccee5c5b9 100644
--- a/Jellyfin.Drawing.Skia/SkiaEncoder.cs
+++ b/Jellyfin.Drawing.Skia/SkiaEncoder.cs
@@ -2,6 +2,7 @@ using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
+using BlurHashSharp.SkiaSharp;
using MediaBrowser.Common.Configuration;
using MediaBrowser.Controller.Drawing;
using MediaBrowser.Controller.Extensions;
@@ -52,9 +53,7 @@ namespace Jellyfin.Drawing.Skia
"jpeg",
"jpg",
"png",
-
"dng",
-
"webp",
"gif",
"bmp",
@@ -63,10 +62,8 @@ namespace Jellyfin.Drawing.Skia
"ktx",
"pkm",
"wbmp",
-
- // TODO
- // Are all of these supported? https://github.com/google/skia/blob/master/infra/bots/recipes/test.py#L454
-
+ // TODO: check if these are supported on multiple platforms
+ // https://github.com/google/skia/blob/master/infra/bots/recipes/test.py#L454
// working on windows at least
"cr2",
"nef",
@@ -229,6 +226,20 @@ namespace Jellyfin.Drawing.Skia
}
}
+ /// <inheritdoc />
+ /// <exception cref="ArgumentNullException">The path is null.</exception>
+ /// <exception cref="FileNotFoundException">The path is not valid.</exception>
+ /// <exception cref="SkiaCodecException">The file at the specified path could not be used to generate a codec.</exception>
+ public string GetImageBlurHash(int xComp, int yComp, string path)
+ {
+ if (path == null)
+ {
+ throw new ArgumentNullException(nameof(path));
+ }
+
+ return BlurHashEncoder.Encode(xComp, yComp, path);
+ }
+
private static bool HasDiacritics(string text)
=> !string.Equals(text, text.RemoveDiacritics(), StringComparison.Ordinal);
@@ -257,7 +268,7 @@ namespace Jellyfin.Drawing.Skia
return path;
}
- var tempPath = Path.Combine(_appPaths.TempDirectory, Guid.NewGuid() + Path.GetExtension(path) ?? string.Empty);
+ var tempPath = Path.Combine(_appPaths.TempDirectory, Guid.NewGuid() + Path.GetExtension(path));
Directory.CreateDirectory(Path.GetDirectoryName(tempPath));
File.Copy(path, tempPath, true);
diff --git a/Jellyfin.Server/Migrations/IMigrationRoutine.cs b/Jellyfin.Server/Migrations/IMigrationRoutine.cs
index b79fdeac0..6b5780a26 100644
--- a/Jellyfin.Server/Migrations/IMigrationRoutine.cs
+++ b/Jellyfin.Server/Migrations/IMigrationRoutine.cs
@@ -1,5 +1,4 @@
using System;
-using Microsoft.Extensions.Logging;
namespace Jellyfin.Server.Migrations
{
diff --git a/Jellyfin.Server/Migrations/Routines/CreateUserLoggingConfigFile.cs b/Jellyfin.Server/Migrations/Routines/CreateUserLoggingConfigFile.cs
index 89514c89b..b15e09290 100644
--- a/Jellyfin.Server/Migrations/Routines/CreateUserLoggingConfigFile.cs
+++ b/Jellyfin.Server/Migrations/Routines/CreateUserLoggingConfigFile.cs
@@ -3,7 +3,6 @@ using System.Collections.Generic;
using System.IO;
using System.Linq;
using MediaBrowser.Common.Configuration;
-using Microsoft.Extensions.Logging;
using Newtonsoft.Json.Linq;
namespace Jellyfin.Server.Migrations.Routines
diff --git a/Jellyfin.Server/Program.cs b/Jellyfin.Server/Program.cs
index b9895386f..7c693f8c3 100644
--- a/Jellyfin.Server/Program.cs
+++ b/Jellyfin.Server/Program.cs
@@ -40,12 +40,12 @@ namespace Jellyfin.Server
/// <summary>
/// The name of logging configuration file containing application defaults.
/// </summary>
- public static readonly string LoggingConfigFileDefault = "logging.default.json";
+ public const string LoggingConfigFileDefault = "logging.default.json";
/// <summary>
/// The name of the logging configuration file containing the system-specific override settings.
/// </summary>
- public static readonly string LoggingConfigFileSystem = "logging.json";
+ public const string LoggingConfigFileSystem = "logging.json";
private static readonly CancellationTokenSource _tokenSource = new CancellationTokenSource();
private static readonly ILoggerFactory _loggerFactory = new SerilogLoggerFactory();
diff --git a/MediaBrowser.Api/ApiEntryPoint.cs b/MediaBrowser.Api/ApiEntryPoint.cs
index 6691080bc..c7485a2e9 100644
--- a/MediaBrowser.Api/ApiEntryPoint.cs
+++ b/MediaBrowser.Api/ApiEntryPoint.cs
@@ -284,8 +284,8 @@ namespace MediaBrowser.Api
Width = state.OutputWidth,
Height = state.OutputHeight,
AudioChannels = state.OutputAudioChannels,
- IsAudioDirect = string.Equals(state.OutputAudioCodec, "copy", StringComparison.OrdinalIgnoreCase),
- IsVideoDirect = string.Equals(state.OutputVideoCodec, "copy", StringComparison.OrdinalIgnoreCase),
+ IsAudioDirect = EncodingHelper.IsCopyCodec(state.OutputAudioCodec),
+ IsVideoDirect = EncodingHelper.IsCopyCodec(state.OutputVideoCodec),
TranscodeReasons = state.TranscodeReasons
});
}
diff --git a/MediaBrowser.Api/Devices/DeviceService.cs b/MediaBrowser.Api/Devices/DeviceService.cs
index 53eb9667d..dd3f3e738 100644
--- a/MediaBrowser.Api/Devices/DeviceService.cs
+++ b/MediaBrowser.Api/Devices/DeviceService.cs
@@ -1,4 +1,3 @@
-using System.IO;
using MediaBrowser.Controller.Configuration;
using MediaBrowser.Controller.Devices;
using MediaBrowser.Controller.Net;
@@ -40,33 +39,6 @@ namespace MediaBrowser.Api.Devices
public string Id { get; set; }
}
- [Route("/Devices/CameraUploads", "GET", Summary = "Gets camera upload history for a device")]
- [Authenticated]
- public class GetCameraUploads : IReturn<ContentUploadHistory>
- {
- [ApiMember(Name = "Id", Description = "Device Id", IsRequired = true, DataType = "string", ParameterType = "query", Verb = "GET")]
- public string DeviceId { get; set; }
- }
-
- [Route("/Devices/CameraUploads", "POST", Summary = "Uploads content")]
- [Authenticated]
- public class PostCameraUpload : IRequiresRequestStream, IReturnVoid
- {
- [ApiMember(Name = "DeviceId", Description = "Device Id", IsRequired = true, DataType = "string", ParameterType = "query", Verb = "POST")]
- public string DeviceId { get; set; }
-
- [ApiMember(Name = "Album", Description = "Album", IsRequired = true, DataType = "string", ParameterType = "query", Verb = "POST")]
- public string Album { get; set; }
-
- [ApiMember(Name = "Name", Description = "Name", IsRequired = true, DataType = "string", ParameterType = "query", Verb = "POST")]
- public string Name { get; set; }
-
- [ApiMember(Name = "Id", Description = "Id", IsRequired = true, DataType = "string", ParameterType = "query", Verb = "POST")]
- public string Id { get; set; }
-
- public Stream RequestStream { get; set; }
- }
-
[Route("/Devices/Options", "POST", Summary = "Updates device options")]
[Authenticated(Roles = "Admin")]
public class PostDeviceOptions : DeviceOptions, IReturnVoid
diff --git a/MediaBrowser.Api/EnvironmentService.cs b/MediaBrowser.Api/EnvironmentService.cs
index d199ce154..82d471412 100644
--- a/MediaBrowser.Api/EnvironmentService.cs
+++ b/MediaBrowser.Api/EnvironmentService.cs
@@ -226,12 +226,7 @@ namespace MediaBrowser.Api
/// <returns>IEnumerable{FileSystemEntryInfo}.</returns>
private IEnumerable<FileSystemEntryInfo> GetDrives()
{
- return _fileSystem.GetDrives().Select(d => new FileSystemEntryInfo
- {
- Name = d.Name,
- Path = d.FullName,
- Type = FileSystemEntryType.Directory
- });
+ return _fileSystem.GetDrives().Select(d => new FileSystemEntryInfo(d.Name, d.FullName, FileSystemEntryType.Directory));
}
/// <summary>
@@ -261,13 +256,7 @@ namespace MediaBrowser.Api
return request.IncludeDirectories || !isDirectory;
});
- return entries.Select(f => new FileSystemEntryInfo
- {
- Name = f.Name,
- Path = f.FullName,
- Type = f.IsDirectory ? FileSystemEntryType.Directory : FileSystemEntryType.File
-
- });
+ return entries.Select(f => new FileSystemEntryInfo(f.Name, f.FullName, f.IsDirectory ? FileSystemEntryType.Directory : FileSystemEntryType.File));
}
public object Get(GetParentPath request)
diff --git a/MediaBrowser.Api/Images/ImageService.cs b/MediaBrowser.Api/Images/ImageService.cs
index f52c48cc6..d284dd55c 100644
--- a/MediaBrowser.Api/Images/ImageService.cs
+++ b/MediaBrowser.Api/Images/ImageService.cs
@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
+using System.Runtime.CompilerServices;
using System.Threading;
using System.Threading.Tasks;
using MediaBrowser.Common.Extensions;
@@ -282,9 +283,16 @@ namespace MediaBrowser.Api.Images
public List<ImageInfo> GetItemImageInfos(BaseItem item)
{
var list = new List<ImageInfo>();
-
var itemImages = item.ImageInfos;
+ if (itemImages.Length == 0)
+ {
+ // short-circuit
+ return list;
+ }
+
+ _libraryManager.UpdateImages(item); // this makes sure dimensions and hashes are correct
+
foreach (var image in itemImages)
{
if (!item.AllowsMultipleImages(image.Type))
@@ -325,6 +333,7 @@ namespace MediaBrowser.Api.Images
{
int? width = null;
int? height = null;
+ string blurhash = null;
long length = 0;
try
@@ -334,10 +343,9 @@ namespace MediaBrowser.Api.Images
var fileInfo = _fileSystem.GetFileInfo(info.Path);
length = fileInfo.Length;
- ImageDimensions size = _imageProcessor.GetImageDimensions(item, info);
- _libraryManager.UpdateImages(item);
- width = size.Width;
- height = size.Height;
+ blurhash = info.BlurHash;
+ width = info.Width;
+ height = info.Height;
if (width <= 0 || height <= 0)
{
@@ -360,6 +368,7 @@ namespace MediaBrowser.Api.Images
ImageType = info.Type,
ImageTag = _imageProcessor.GetImageCacheTag(item, info),
Size = length,
+ BlurHash = blurhash,
Width = width,
Height = height
};
diff --git a/MediaBrowser.Api/Images/RemoteImageService.cs b/MediaBrowser.Api/Images/RemoteImageService.cs
index 23bf54712..358ac30fa 100644
--- a/MediaBrowser.Api/Images/RemoteImageService.cs
+++ b/MediaBrowser.Api/Images/RemoteImageService.cs
@@ -147,9 +147,8 @@ namespace MediaBrowser.Api.Images
{
var item = _libraryManager.GetItemById(request.Id);
- var images = await _providerManager.GetAvailableRemoteImages(item, new RemoteImageQuery
+ var images = await _providerManager.GetAvailableRemoteImages(item, new RemoteImageQuery(request.ProviderName)
{
- ProviderName = request.ProviderName,
IncludeAllLanguages = request.IncludeAllLanguages,
IncludeDisabledProviders = true,
ImageType = request.Type
diff --git a/MediaBrowser.Api/Playback/BaseStreamingService.cs b/MediaBrowser.Api/Playback/BaseStreamingService.cs
index a9824a5e7..957e4ae91 100644
--- a/MediaBrowser.Api/Playback/BaseStreamingService.cs
+++ b/MediaBrowser.Api/Playback/BaseStreamingService.cs
@@ -194,7 +194,7 @@ namespace MediaBrowser.Api.Playback
await AcquireResources(state, cancellationTokenSource).ConfigureAwait(false);
- if (state.VideoRequest != null && !string.Equals(state.OutputVideoCodec, "copy", StringComparison.OrdinalIgnoreCase))
+ if (state.VideoRequest != null && !EncodingHelper.IsCopyCodec(state.OutputVideoCodec))
{
var auth = AuthorizationContext.GetAuthorizationInfo(Request);
if (auth.User != null && !auth.User.HasPermission(PermissionKind.EnableVideoPlaybackTranscoding))
@@ -244,9 +244,9 @@ namespace MediaBrowser.Api.Playback
var logFilePrefix = "ffmpeg-transcode";
if (state.VideoRequest != null
- && string.Equals(state.OutputVideoCodec, "copy", StringComparison.OrdinalIgnoreCase))
+ && EncodingHelper.IsCopyCodec(state.OutputVideoCodec))
{
- logFilePrefix = string.Equals(state.OutputAudioCodec, "copy", StringComparison.OrdinalIgnoreCase)
+ logFilePrefix = EncodingHelper.IsCopyCodec(state.OutputAudioCodec)
? "ffmpeg-remux" : "ffmpeg-directstream";
}
@@ -329,7 +329,7 @@ namespace MediaBrowser.Api.Playback
state.RunTimeTicks.Value >= TimeSpan.FromMinutes(5).Ticks &&
state.IsInputVideo &&
state.VideoType == VideoType.VideoFile &&
- !string.Equals(state.OutputVideoCodec, "copy", StringComparison.OrdinalIgnoreCase);
+ !EncodingHelper.IsCopyCodec(state.OutputVideoCodec);
}
return false;
@@ -792,7 +792,7 @@ namespace MediaBrowser.Api.Playback
EncodingHelper.TryStreamCopy(state);
}
- if (state.OutputVideoBitrate.HasValue && !string.Equals(state.OutputVideoCodec, "copy", StringComparison.OrdinalIgnoreCase))
+ if (state.OutputVideoBitrate.HasValue && !EncodingHelper.IsCopyCodec(state.OutputVideoCodec))
{
var resolution = ResolutionNormalizer.Normalize(
state.VideoStream?.BitRate,
diff --git a/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs b/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs
index 061316cb8..c746cef80 100644
--- a/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs
+++ b/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs
@@ -700,12 +700,12 @@ namespace MediaBrowser.Api.Playback.Hls
return false;
}
- if (string.Equals(state.OutputVideoCodec, "copy", StringComparison.OrdinalIgnoreCase))
+ if (EncodingHelper.IsCopyCodec(state.OutputVideoCodec))
{
return false;
}
- if (string.Equals(state.OutputAudioCodec, "copy", StringComparison.OrdinalIgnoreCase))
+ if (EncodingHelper.IsCopyCodec(state.OutputAudioCodec))
{
return false;
}
@@ -728,7 +728,7 @@ namespace MediaBrowser.Api.Playback.Hls
private int? GetOutputVideoCodecLevel(StreamState state)
{
string levelString;
- if (string.Equals(state.OutputVideoCodec, "copy", StringComparison.OrdinalIgnoreCase)
+ if (EncodingHelper.IsCopyCodec(state.OutputVideoCodec)
&& state.VideoStream.Level.HasValue)
{
levelString = state.VideoStream?.Level.ToString();
@@ -865,7 +865,7 @@ namespace MediaBrowser.Api.Playback.Hls
{
framerate = Math.Round(state.TargetFramerate.GetValueOrDefault(), 3);
}
- else if (state.VideoStream.RealFrameRate.HasValue)
+ else if (state.VideoStream?.RealFrameRate != null)
{
framerate = Math.Round(state.VideoStream.RealFrameRate.GetValueOrDefault(), 3);
}
@@ -1008,7 +1008,7 @@ namespace MediaBrowser.Api.Playback.Hls
if (!state.IsOutputVideo)
{
- if (string.Equals(audioCodec, "copy", StringComparison.OrdinalIgnoreCase))
+ if (EncodingHelper.IsCopyCodec(audioCodec))
{
return "-acodec copy";
}
@@ -1036,11 +1036,11 @@ namespace MediaBrowser.Api.Playback.Hls
return string.Join(" ", audioTranscodeParams.ToArray());
}
- if (string.Equals(audioCodec, "copy", StringComparison.OrdinalIgnoreCase))
+ if (EncodingHelper.IsCopyCodec(audioCodec))
{
var videoCodec = EncodingHelper.GetVideoEncoder(state, encodingOptions);
- if (string.Equals(videoCodec, "copy", StringComparison.OrdinalIgnoreCase) && state.EnableBreakOnNonKeyFrames(videoCodec))
+ if (EncodingHelper.IsCopyCodec(videoCodec) && state.EnableBreakOnNonKeyFrames(videoCodec))
{
return "-codec:a:0 copy -copypriorss:a:0 0";
}
@@ -1091,7 +1091,7 @@ namespace MediaBrowser.Api.Playback.Hls
// }
// See if we can save come cpu cycles by avoiding encoding
- if (string.Equals(codec, "copy", StringComparison.OrdinalIgnoreCase))
+ if (EncodingHelper.IsCopyCodec(codec))
{
if (state.VideoStream != null && !string.Equals(state.VideoStream.NalLengthSize, "0", StringComparison.OrdinalIgnoreCase))
{
diff --git a/MediaBrowser.Api/Playback/Hls/VideoHlsService.cs b/MediaBrowser.Api/Playback/Hls/VideoHlsService.cs
index d1c53c1c1..aefb3f019 100644
--- a/MediaBrowser.Api/Playback/Hls/VideoHlsService.cs
+++ b/MediaBrowser.Api/Playback/Hls/VideoHlsService.cs
@@ -72,7 +72,7 @@ namespace MediaBrowser.Api.Playback.Hls
{
var codec = EncodingHelper.GetAudioEncoder(state);
- if (string.Equals(codec, "copy", StringComparison.OrdinalIgnoreCase))
+ if (EncodingHelper.IsCopyCodec(codec))
{
return "-codec:a:0 copy";
}
diff --git a/MediaBrowser.Api/Playback/StreamState.cs b/MediaBrowser.Api/Playback/StreamState.cs
index d5d2f58c0..c244b0033 100644
--- a/MediaBrowser.Api/Playback/StreamState.cs
+++ b/MediaBrowser.Api/Playback/StreamState.cs
@@ -42,7 +42,7 @@ namespace MediaBrowser.Api.Playback
return Request.SegmentLength.Value;
}
- if (string.Equals(OutputVideoCodec, "copy", StringComparison.OrdinalIgnoreCase))
+ if (EncodingHelper.IsCopyCodec(OutputVideoCodec))
{
var userAgent = UserAgent ?? string.Empty;
diff --git a/MediaBrowser.Api/Sessions/SessionInfoWebSocketListener.cs b/MediaBrowser.Api/Sessions/SessionInfoWebSocketListener.cs
index 0e74c9267..175984575 100644
--- a/MediaBrowser.Api/Sessions/SessionInfoWebSocketListener.cs
+++ b/MediaBrowser.Api/Sessions/SessionInfoWebSocketListener.cs
@@ -40,39 +40,39 @@ namespace MediaBrowser.Api.Sessions
_sessionManager.SessionActivity += OnSessionManagerSessionActivity;
}
- private void OnSessionManagerSessionActivity(object sender, SessionEventArgs e)
+ private async void OnSessionManagerSessionActivity(object sender, SessionEventArgs e)
{
- SendData(false);
+ await SendData(false).ConfigureAwait(false);
}
- private void OnSessionManagerCapabilitiesChanged(object sender, SessionEventArgs e)
+ private async void OnSessionManagerCapabilitiesChanged(object sender, SessionEventArgs e)
{
- SendData(true);
+ await SendData(true).ConfigureAwait(false);
}
- private void OnSessionManagerPlaybackProgress(object sender, PlaybackProgressEventArgs e)
+ private async void OnSessionManagerPlaybackProgress(object sender, PlaybackProgressEventArgs e)
{
- SendData(!e.IsAutomated);
+ await SendData(!e.IsAutomated).ConfigureAwait(false);
}
- private void OnSessionManagerPlaybackStopped(object sender, PlaybackStopEventArgs e)
+ private async void OnSessionManagerPlaybackStopped(object sender, PlaybackStopEventArgs e)
{
- SendData(true);
+ await SendData(true).ConfigureAwait(false);
}
- private void OnSessionManagerPlaybackStart(object sender, PlaybackProgressEventArgs e)
+ private async void OnSessionManagerPlaybackStart(object sender, PlaybackProgressEventArgs e)
{
- SendData(true);
+ await SendData(true).ConfigureAwait(false);
}
- private void OnSessionManagerSessionEnded(object sender, SessionEventArgs e)
+ private async void OnSessionManagerSessionEnded(object sender, SessionEventArgs e)
{
- SendData(true);
+ await SendData(true).ConfigureAwait(false);
}
- private void OnSessionManagerSessionStarted(object sender, SessionEventArgs e)
+ private async void OnSessionManagerSessionStarted(object sender, SessionEventArgs e)
{
- SendData(true);
+ await SendData(true).ConfigureAwait(false);
}
/// <summary>
diff --git a/MediaBrowser.Api/VideosService.cs b/MediaBrowser.Api/VideosService.cs
index b11fd48d3..957a279f8 100644
--- a/MediaBrowser.Api/VideosService.cs
+++ b/MediaBrowser.Api/VideosService.cs
@@ -128,6 +128,7 @@ namespace MediaBrowser.Api
var items = request.Ids.Split(',')
.Select(i => _libraryManager.GetItemById(i))
.OfType<Video>()
+ .OrderBy(i => i.Id)
.ToList();
if (items.Count < 2)
diff --git a/MediaBrowser.Common/Configuration/ConfigurationStore.cs b/MediaBrowser.Common/Configuration/ConfigurationStore.cs
new file mode 100644
index 000000000..d31d45e4c
--- /dev/null
+++ b/MediaBrowser.Common/Configuration/ConfigurationStore.cs
@@ -0,0 +1,20 @@
+using System;
+
+namespace MediaBrowser.Common.Configuration
+{
+ /// <summary>
+ /// Describes a single entry in the application configuration.
+ /// </summary>
+ public class ConfigurationStore
+ {
+ /// <summary>
+ /// Gets or sets the unique identifier for the configuration.
+ /// </summary>
+ public string Key { get; set; }
+
+ /// <summary>
+ /// Gets or sets the type used to store the data for this configuration entry.
+ /// </summary>
+ public Type ConfigurationType { get; set; }
+ }
+}
diff --git a/MediaBrowser.Common/Configuration/IApplicationPaths.cs b/MediaBrowser.Common/Configuration/IApplicationPaths.cs
index 870b90796..4cea61682 100644
--- a/MediaBrowser.Common/Configuration/IApplicationPaths.cs
+++ b/MediaBrowser.Common/Configuration/IApplicationPaths.cs
@@ -3,12 +3,12 @@ using MediaBrowser.Model.Configuration;
namespace MediaBrowser.Common.Configuration
{
/// <summary>
- /// Interface IApplicationPaths
+ /// Interface IApplicationPaths.
/// </summary>
public interface IApplicationPaths
{
/// <summary>
- /// Gets the path to the program data folder
+ /// Gets the path to the program data folder.
/// </summary>
/// <value>The program data path.</value>
string ProgramDataPath { get; }
@@ -23,13 +23,13 @@ namespace MediaBrowser.Common.Configuration
string WebPath { get; }
/// <summary>
- /// Gets the path to the program system folder
+ /// Gets the path to the program system folder.
/// </summary>
/// <value>The program data path.</value>
string ProgramSystemPath { get; }
/// <summary>
- /// Gets the folder path to the data directory
+ /// Gets the folder path to the data directory.
/// </summary>
/// <value>The data directory.</value>
string DataPath { get; }
@@ -41,43 +41,43 @@ namespace MediaBrowser.Common.Configuration
string ImageCachePath { get; }
/// <summary>
- /// Gets the path to the plugin directory
+ /// Gets the path to the plugin directory.
/// </summary>
/// <value>The plugins path.</value>
string PluginsPath { get; }
/// <summary>
- /// Gets the path to the plugin configurations directory
+ /// Gets the path to the plugin configurations directory.
/// </summary>
/// <value>The plugin configurations path.</value>
string PluginConfigurationsPath { get; }
/// <summary>
- /// Gets the path to the log directory
+ /// Gets the path to the log directory.
/// </summary>
/// <value>The log directory path.</value>
string LogDirectoryPath { get; }
/// <summary>
- /// Gets the path to the application configuration root directory
+ /// Gets the path to the application configuration root directory.
/// </summary>
/// <value>The configuration directory path.</value>
string ConfigurationDirectoryPath { get; }
/// <summary>
- /// Gets the path to the system configuration file
+ /// Gets the path to the system configuration file.
/// </summary>
/// <value>The system configuration file path.</value>
string SystemConfigurationFilePath { get; }
/// <summary>
- /// Gets the folder path to the cache directory
+ /// Gets the folder path to the cache directory.
/// </summary>
/// <value>The cache directory.</value>
string CachePath { get; }
/// <summary>
- /// Gets the folder path to the temp directory within the cache folder
+ /// Gets the folder path to the temp directory within the cache folder.
/// </summary>
/// <value>The temp directory.</value>
string TempDirectory { get; }
diff --git a/MediaBrowser.Common/Configuration/IConfigurationFactory.cs b/MediaBrowser.Common/Configuration/IConfigurationFactory.cs
index 07ca2b58b..6db1f1364 100644
--- a/MediaBrowser.Common/Configuration/IConfigurationFactory.cs
+++ b/MediaBrowser.Common/Configuration/IConfigurationFactory.cs
@@ -1,4 +1,3 @@
-using System;
using System.Collections.Generic;
namespace MediaBrowser.Common.Configuration
@@ -15,33 +14,4 @@ namespace MediaBrowser.Common.Configuration
/// <returns>The configuration store.</returns>
IEnumerable<ConfigurationStore> GetConfigurations();
}
-
- /// <summary>
- /// Describes a single entry in the application configuration.
- /// </summary>
- public class ConfigurationStore
- {
- /// <summary>
- /// Gets or sets the unique identifier for the configuration.
- /// </summary>
- public string Key { get; set; }
-
- /// <summary>
- /// Gets or sets the type used to store the data for this configuration entry.
- /// </summary>
- public Type ConfigurationType { get; set; }
- }
-
- /// <summary>
- /// A configuration store that can be validated.
- /// </summary>
- public interface IValidatingConfiguration
- {
- /// <summary>
- /// Validation method to be invoked before saving the configuration.
- /// </summary>
- /// <param name="oldConfig">The old configuration.</param>
- /// <param name="newConfig">The new configuration.</param>
- void Validate(object oldConfig, object newConfig);
- }
}
diff --git a/MediaBrowser.Common/Configuration/IConfigurationManager.cs b/MediaBrowser.Common/Configuration/IConfigurationManager.cs
index caf2edd83..fe726090d 100644
--- a/MediaBrowser.Common/Configuration/IConfigurationManager.cs
+++ b/MediaBrowser.Common/Configuration/IConfigurationManager.cs
@@ -24,7 +24,7 @@ namespace MediaBrowser.Common.Configuration
event EventHandler<ConfigurationUpdateEventArgs> NamedConfigurationUpdated;
/// <summary>
- /// Gets or sets the application paths.
+ /// Gets the application paths.
/// </summary>
/// <value>The application paths.</value>
IApplicationPaths CommonApplicationPaths { get; }
diff --git a/MediaBrowser.Common/Configuration/IValidatingConfiguration.cs b/MediaBrowser.Common/Configuration/IValidatingConfiguration.cs
new file mode 100644
index 000000000..3b1d84f3c
--- /dev/null
+++ b/MediaBrowser.Common/Configuration/IValidatingConfiguration.cs
@@ -0,0 +1,15 @@
+namespace MediaBrowser.Common.Configuration
+{
+ /// <summary>
+ /// A configuration store that can be validated.
+ /// </summary>
+ public interface IValidatingConfiguration
+ {
+ /// <summary>
+ /// Validation method to be invoked before saving the configuration.
+ /// </summary>
+ /// <param name="oldConfig">The old configuration.</param>
+ /// <param name="newConfig">The new configuration.</param>
+ void Validate(object oldConfig, object newConfig);
+ }
+}
diff --git a/MediaBrowser.Common/MediaBrowser.Common.csproj b/MediaBrowser.Common/MediaBrowser.Common.csproj
index a597b9052..0713b83b7 100644
--- a/MediaBrowser.Common/MediaBrowser.Common.csproj
+++ b/MediaBrowser.Common/MediaBrowser.Common.csproj
@@ -37,7 +37,7 @@
<ItemGroup Condition=" '$(Configuration)' == 'Debug' ">
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.9.8" PrivateAssets="All" />
<PackageReference Include="SerilogAnalyzer" Version="0.15.0" PrivateAssets="All" />
- <!-- <PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="All" /> -->
+ <PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="All" />
<PackageReference Include="SmartAnalyzers.MultithreadingAnalyzer" Version="1.1.31" PrivateAssets="All" />
</ItemGroup>
diff --git a/MediaBrowser.Common/Net/CacheMode.cs b/MediaBrowser.Common/Net/CacheMode.cs
new file mode 100644
index 000000000..78fa3bf9b
--- /dev/null
+++ b/MediaBrowser.Common/Net/CacheMode.cs
@@ -0,0 +1,11 @@
+#pragma warning disable CS1591
+#pragma warning disable SA1602
+
+namespace MediaBrowser.Common.Net
+{
+ public enum CacheMode
+ {
+ None = 0,
+ Unconditional = 1
+ }
+}
diff --git a/MediaBrowser.Common/Net/CompressionMethods.cs b/MediaBrowser.Common/Net/CompressionMethods.cs
new file mode 100644
index 000000000..39b72609f
--- /dev/null
+++ b/MediaBrowser.Common/Net/CompressionMethods.cs
@@ -0,0 +1,15 @@
+#pragma warning disable CS1591
+#pragma warning disable SA1602
+
+using System;
+
+namespace MediaBrowser.Common.Net
+{
+ [Flags]
+ public enum CompressionMethods
+ {
+ None = 0b00000001,
+ Deflate = 0b00000010,
+ Gzip = 0b00000100
+ }
+}
diff --git a/MediaBrowser.Common/Net/HttpRequestOptions.cs b/MediaBrowser.Common/Net/HttpRequestOptions.cs
index 38274a80e..347fc9833 100644
--- a/MediaBrowser.Common/Net/HttpRequestOptions.cs
+++ b/MediaBrowser.Common/Net/HttpRequestOptions.cs
@@ -102,18 +102,4 @@ namespace MediaBrowser.Common.Net
return value;
}
}
-
- public enum CacheMode
- {
- None = 0,
- Unconditional = 1
- }
-
- [Flags]
- public enum CompressionMethods
- {
- None = 0b00000001,
- Deflate = 0b00000010,
- Gzip = 0b00000100
- }
}
diff --git a/MediaBrowser.Common/Progress/ActionableProgress.cs b/MediaBrowser.Common/Progress/ActionableProgress.cs
index af69055aa..d5bcd5be9 100644
--- a/MediaBrowser.Common/Progress/ActionableProgress.cs
+++ b/MediaBrowser.Common/Progress/ActionableProgress.cs
@@ -5,15 +5,16 @@ using System;
namespace MediaBrowser.Common.Progress
{
/// <summary>
- /// Class ActionableProgress
+ /// Class ActionableProgress.
/// </summary>
- /// <typeparam name="T"></typeparam>
+ /// <typeparam name="T">The type for the action parameter.</typeparam>
public class ActionableProgress<T> : IProgress<T>
{
/// <summary>
- /// The _actions
+ /// The _actions.
/// </summary>
private Action<T> _action;
+
public event EventHandler<T> ProgressChanged;
/// <summary>
@@ -32,14 +33,4 @@ namespace MediaBrowser.Common.Progress
_action?.Invoke(value);
}
}
-
- public class SimpleProgress<T> : IProgress<T>
- {
- public event EventHandler<T> ProgressChanged;
-
- public void Report(T value)
- {
- ProgressChanged?.Invoke(this, value);
- }
- }
}
diff --git a/MediaBrowser.Common/Progress/SimpleProgress.cs b/MediaBrowser.Common/Progress/SimpleProgress.cs
new file mode 100644
index 000000000..d75675bf1
--- /dev/null
+++ b/MediaBrowser.Common/Progress/SimpleProgress.cs
@@ -0,0 +1,16 @@
+#pragma warning disable CS1591
+
+using System;
+
+namespace MediaBrowser.Common.Progress
+{
+ public class SimpleProgress<T> : IProgress<T>
+ {
+ public event EventHandler<T> ProgressChanged;
+
+ public void Report(T value)
+ {
+ ProgressChanged?.Invoke(this, value);
+ }
+ }
+}
diff --git a/MediaBrowser.Common/Updates/IInstallationManager.cs b/MediaBrowser.Common/Updates/IInstallationManager.cs
index 950604432..965ffe0ec 100644
--- a/MediaBrowser.Common/Updates/IInstallationManager.cs
+++ b/MediaBrowser.Common/Updates/IInstallationManager.cs
@@ -12,28 +12,28 @@ namespace MediaBrowser.Common.Updates
{
public interface IInstallationManager : IDisposable
{
- event EventHandler<InstallationEventArgs> PackageInstalling;
+ event EventHandler<InstallationInfo> PackageInstalling;
- event EventHandler<InstallationEventArgs> PackageInstallationCompleted;
+ event EventHandler<InstallationInfo> PackageInstallationCompleted;
event EventHandler<InstallationFailedEventArgs> PackageInstallationFailed;
- event EventHandler<InstallationEventArgs> PackageInstallationCancelled;
+ event EventHandler<InstallationInfo> PackageInstallationCancelled;
/// <summary>
/// Occurs when a plugin is uninstalled.
/// </summary>
- event EventHandler<GenericEventArgs<IPlugin>> PluginUninstalled;
+ event EventHandler<IPlugin> PluginUninstalled;
/// <summary>
/// Occurs when a plugin is updated.
/// </summary>
- event EventHandler<GenericEventArgs<(IPlugin, VersionInfo)>> PluginUpdated;
+ event EventHandler<InstallationInfo> PluginUpdated;
/// <summary>
/// Occurs when a plugin is installed.
/// </summary>
- event EventHandler<GenericEventArgs<VersionInfo>> PluginInstalled;
+ event EventHandler<InstallationInfo> PluginInstalled;
/// <summary>
/// Gets the completed installations.
@@ -62,22 +62,12 @@ namespace MediaBrowser.Common.Updates
/// <summary>
/// Returns all compatible versions ordered from newest to oldest.
/// </summary>
- /// <param name="availableVersions">The available version of the plugin.</param>
- /// <param name="minVersion">The minimum required version of the plugin.</param>
- /// <returns>All compatible versions ordered from newest to oldest.</returns>
- IEnumerable<VersionInfo> GetCompatibleVersions(
- IEnumerable<VersionInfo> availableVersions,
- Version minVersion = null);
-
- /// <summary>
- /// Returns all compatible versions ordered from newest to oldest.
- /// </summary>
/// <param name="availablePackages">The available packages.</param>
/// <param name="name">The name.</param>
/// <param name="guid">The guid of the plugin.</param>
/// <param name="minVersion">The minimum required version of the plugin.</param>
/// <returns>All compatible versions ordered from newest to oldest.</returns>
- IEnumerable<VersionInfo> GetCompatibleVersions(
+ IEnumerable<InstallationInfo> GetCompatibleVersions(
IEnumerable<PackageInfo> availablePackages,
string name = null,
Guid guid = default,
@@ -88,7 +78,7 @@ namespace MediaBrowser.Common.Updates
/// </summary>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>The available plugin updates.</returns>
- Task<IEnumerable<VersionInfo>> GetAvailablePluginUpdates(CancellationToken cancellationToken = default);
+ Task<IEnumerable<InstallationInfo>> GetAvailablePluginUpdates(CancellationToken cancellationToken = default);
/// <summary>
/// Installs the package.
@@ -96,7 +86,7 @@ namespace MediaBrowser.Common.Updates
/// <param name="package">The package.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns><see cref="Task" />.</returns>
- Task InstallPackage(VersionInfo package, CancellationToken cancellationToken = default);
+ Task InstallPackage(InstallationInfo package, CancellationToken cancellationToken = default);
/// <summary>
/// Uninstalls a plugin.
diff --git a/MediaBrowser.Controller/Devices/CameraImageUploadInfo.cs b/MediaBrowser.Controller/Devices/CameraImageUploadInfo.cs
deleted file mode 100644
index 89d0be58f..000000000
--- a/MediaBrowser.Controller/Devices/CameraImageUploadInfo.cs
+++ /dev/null
@@ -1,10 +0,0 @@
-using MediaBrowser.Model.Devices;
-
-namespace MediaBrowser.Controller.Devices
-{
- public class CameraImageUploadInfo
- {
- public LocalFileInfo FileInfo { get; set; }
- public DeviceInfo Device { get; set; }
- }
-}
diff --git a/MediaBrowser.Controller/Drawing/IImageEncoder.cs b/MediaBrowser.Controller/Drawing/IImageEncoder.cs
index 88e67b648..e09ccd204 100644
--- a/MediaBrowser.Controller/Drawing/IImageEncoder.cs
+++ b/MediaBrowser.Controller/Drawing/IImageEncoder.cs
@@ -44,6 +44,15 @@ namespace MediaBrowser.Controller.Drawing
ImageDimensions GetImageSize(string path);
/// <summary>
+ /// Gets the blurhash of an image.
+ /// </summary>
+ /// <param name="xComp">Amount of X components of DCT to take.</param>
+ /// <param name="yComp">Amount of Y components of DCT to take.</param>
+ /// <param name="path">The filepath of the image.</param>
+ /// <returns>The blurhash.</returns>
+ string GetImageBlurHash(int xComp, int yComp, string path);
+
+ /// <summary>
/// Encode an image.
/// </summary>
string EncodeImage(string inputPath, DateTime dateModified, string outputPath, bool autoOrient, ImageOrientation? orientation, int quality, ImageProcessingOptions options, ImageFormat outputFormat);
diff --git a/MediaBrowser.Controller/Drawing/IImageProcessor.cs b/MediaBrowser.Controller/Drawing/IImageProcessor.cs
index c00d1c335..f1873d539 100644
--- a/MediaBrowser.Controller/Drawing/IImageProcessor.cs
+++ b/MediaBrowser.Controller/Drawing/IImageProcessor.cs
@@ -42,6 +42,13 @@ namespace MediaBrowser.Controller.Drawing
ImageDimensions GetImageDimensions(BaseItem item, ItemImageInfo info);
/// <summary>
+ /// Gets the blurhash of the image.
+ /// </summary>
+ /// <param name="path">Path to the image file.</param>
+ /// <returns>BlurHash</returns>
+ string GetImageBlurHash(string path);
+
+ /// <summary>
/// Gets the image cache tag.
/// </summary>
/// <param name="item">The item.</param>
diff --git a/MediaBrowser.Controller/Entities/BaseItem.cs b/MediaBrowser.Controller/Entities/BaseItem.cs
index 3feef1d32..dd6e251c6 100644
--- a/MediaBrowser.Controller/Entities/BaseItem.cs
+++ b/MediaBrowser.Controller/Entities/BaseItem.cs
@@ -1375,6 +1375,7 @@ namespace MediaBrowser.Controller.Entities
new List<FileSystemMetadata>();
var ownedItemsChanged = await RefreshedOwnedItems(options, files, cancellationToken).ConfigureAwait(false);
+ LibraryManager.UpdateImages(this); // ensure all image properties in DB are fresh
if (ownedItemsChanged)
{
@@ -2219,6 +2220,7 @@ namespace MediaBrowser.Controller.Entities
existingImage.DateModified = image.DateModified;
existingImage.Width = image.Width;
existingImage.Height = image.Height;
+ existingImage.BlurHash = image.BlurHash;
}
else
{
@@ -2370,6 +2372,46 @@ namespace MediaBrowser.Controller.Entities
.ElementAtOrDefault(imageIndex);
}
+ /// <summary>
+ /// Computes image index for given image or raises if no matching image found.
+ /// </summary>
+ /// <param name="image">Image to compute index for.</param>
+ /// <exception cref="ArgumentException">Image index cannot be computed as no matching image found.
+ /// </exception>
+ /// <returns>Image index.</returns>
+ public int GetImageIndex(ItemImageInfo image)
+ {
+ if (image == null)
+ {
+ throw new ArgumentNullException(nameof(image));
+ }
+
+ if (image.Type == ImageType.Chapter)
+ {
+ var chapters = ItemRepository.GetChapters(this);
+ for (var i = 0; i < chapters.Count; i++)
+ {
+ if (chapters[i].ImagePath == image.Path)
+ {
+ return i;
+ }
+ }
+
+ throw new ArgumentException("No chapter index found for image path", image.Path);
+ }
+
+ var images = GetImages(image.Type).ToArray();
+ for (var i = 0; i < images.Length; i++)
+ {
+ if (images[i].Path == image.Path)
+ {
+ return i;
+ }
+ }
+
+ throw new ArgumentException("No image index found for image path", image.Path);
+ }
+
public IEnumerable<ItemImageInfo> GetImages(ImageType imageType)
{
if (imageType == ImageType.Chapter)
diff --git a/MediaBrowser.Controller/Entities/Folder.cs b/MediaBrowser.Controller/Entities/Folder.cs
index 399813aa2..2f9bc38df 100644
--- a/MediaBrowser.Controller/Entities/Folder.cs
+++ b/MediaBrowser.Controller/Entities/Folder.cs
@@ -348,6 +348,11 @@ namespace MediaBrowser.Controller.Entities
{
currentChild.UpdateToRepository(ItemUpdateType.MetadataImport, cancellationToken);
}
+ else
+ {
+ // metadata is up-to-date; make sure DB has correct images dimensions and hash
+ LibraryManager.UpdateImages(currentChild);
+ }
continue;
}
diff --git a/MediaBrowser.Controller/Entities/ItemImageInfo.cs b/MediaBrowser.Controller/Entities/ItemImageInfo.cs
index fc46dec2e..12f5db2e0 100644
--- a/MediaBrowser.Controller/Entities/ItemImageInfo.cs
+++ b/MediaBrowser.Controller/Entities/ItemImageInfo.cs
@@ -28,6 +28,12 @@ namespace MediaBrowser.Controller.Entities
public int Height { get; set; }
+ /// <summary>
+ /// Gets or sets the blurhash.
+ /// </summary>
+ /// <value>The blurhash.</value>
+ public string BlurHash { get; set; }
+
[JsonIgnore]
public bool IsLocalFile => Path == null || !Path.StartsWith("http", StringComparison.OrdinalIgnoreCase);
}
diff --git a/MediaBrowser.Controller/Library/ILibraryManager.cs b/MediaBrowser.Controller/Library/ILibraryManager.cs
index 1f7a5861a..b37101435 100644
--- a/MediaBrowser.Controller/Library/ILibraryManager.cs
+++ b/MediaBrowser.Controller/Library/ILibraryManager.cs
@@ -120,7 +120,7 @@ namespace MediaBrowser.Controller.Library
/// </summary>
void QueueLibraryScan();
- void UpdateImages(BaseItem item);
+ void UpdateImages(BaseItem item, bool forceUpdate = false);
/// <summary>
/// Gets the default view.
@@ -197,6 +197,7 @@ namespace MediaBrowser.Controller.Library
/// Updates the item.
/// </summary>
void UpdateItems(IEnumerable<BaseItem> items, BaseItem parent, ItemUpdateType updateReason, CancellationToken cancellationToken);
+
void UpdateItem(BaseItem item, BaseItem parent, ItemUpdateType updateReason, CancellationToken cancellationToken);
/// <summary>
diff --git a/MediaBrowser.Controller/LiveTv/TimerEventInfo.cs b/MediaBrowser.Controller/LiveTv/TimerEventInfo.cs
index cfec39b4e..1b8f41db6 100644
--- a/MediaBrowser.Controller/LiveTv/TimerEventInfo.cs
+++ b/MediaBrowser.Controller/LiveTv/TimerEventInfo.cs
@@ -1,10 +1,19 @@
+#nullable enable
+#pragma warning disable CS1591
+
using System;
namespace MediaBrowser.Controller.LiveTv
{
public class TimerEventInfo
{
- public string Id { get; set; }
- public Guid ProgramId { get; set; }
+ public TimerEventInfo(string id)
+ {
+ Id = id;
+ }
+
+ public string Id { get; }
+
+ public Guid? ProgramId { get; set; }
}
}
diff --git a/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs b/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs
index 2559bc248..8ce106469 100644
--- a/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs
+++ b/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs
@@ -1339,7 +1339,7 @@ namespace MediaBrowser.Controller.MediaEncoding
transcoderChannelLimit = 6;
}
- var isTranscodingAudio = !string.Equals(codec, "copy", StringComparison.OrdinalIgnoreCase);
+ var isTranscodingAudio = !EncodingHelper.IsCopyCodec(codec);
int? resultChannels = state.GetRequestedAudioChannels(codec);
if (isTranscodingAudio)
@@ -1735,7 +1735,8 @@ namespace MediaBrowser.Controller.MediaEncoding
var hasTextSubs = state.SubtitleStream != null && state.SubtitleStream.IsTextSubtitleStream && state.SubtitleDeliveryMethod == SubtitleDeliveryMethod.Encode;
- if (string.Equals(videoEncoder, "h264_vaapi", StringComparison.OrdinalIgnoreCase) || (string.Equals(videoEncoder, "h264_qsv", StringComparison.OrdinalIgnoreCase) && !hasTextSubs)
+ if ((string.Equals(videoEncoder, "h264_vaapi", StringComparison.OrdinalIgnoreCase)
+ || (string.Equals(videoEncoder, "h264_qsv", StringComparison.OrdinalIgnoreCase) && !hasTextSubs))
&& width.HasValue
&& height.HasValue)
{
@@ -2249,7 +2250,7 @@ namespace MediaBrowser.Controller.MediaEncoding
flags.Add("+ignidx");
}
- if (state.GenPtsInput || string.Equals(state.OutputVideoCodec, "copy", StringComparison.OrdinalIgnoreCase))
+ if (state.GenPtsInput || EncodingHelper.IsCopyCodec(state.OutputVideoCodec))
{
flags.Add("+genpts");
}
@@ -2512,7 +2513,7 @@ namespace MediaBrowser.Controller.MediaEncoding
/// </summary>
protected string GetHardwareAcceleratedVideoDecoder(EncodingJobInfo state, EncodingOptions encodingOptions)
{
- if (string.Equals(state.OutputVideoCodec, "copy", StringComparison.OrdinalIgnoreCase))
+ if (EncodingHelper.IsCopyCodec(state.OutputVideoCodec))
{
return null;
}
@@ -2800,7 +2801,7 @@ namespace MediaBrowser.Controller.MediaEncoding
args += " -mpegts_m2ts_mode 1";
}
- if (string.Equals(videoCodec, "copy", StringComparison.OrdinalIgnoreCase))
+ if (EncodingHelper.IsCopyCodec(videoCodec))
{
if (state.VideoStream != null
&& string.Equals(state.OutputContainer, "ts", StringComparison.OrdinalIgnoreCase)
@@ -2902,7 +2903,7 @@ namespace MediaBrowser.Controller.MediaEncoding
var args = "-codec:a:0 " + codec;
- if (string.Equals(codec, "copy", StringComparison.OrdinalIgnoreCase))
+ if (EncodingHelper.IsCopyCodec(codec))
{
return args;
}
@@ -2974,5 +2975,10 @@ namespace MediaBrowser.Controller.MediaEncoding
string.Empty,
string.Empty).Trim();
}
+
+ public static bool IsCopyCodec(string codec)
+ {
+ return string.Equals(codec, "copy", StringComparison.OrdinalIgnoreCase);
+ }
}
}
diff --git a/MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs b/MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs
index c4ebdac8b..acf1aae89 100644
--- a/MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs
+++ b/MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs
@@ -317,7 +317,7 @@ namespace MediaBrowser.Controller.MediaEncoding
return false;
}
- return BaseRequest.BreakOnNonKeyFrames && string.Equals(videoCodec, "copy", StringComparison.OrdinalIgnoreCase);
+ return BaseRequest.BreakOnNonKeyFrames && EncodingHelper.IsCopyCodec(videoCodec);
}
return false;
@@ -382,7 +382,7 @@ namespace MediaBrowser.Controller.MediaEncoding
get
{
if (BaseRequest.Static
- || string.Equals(OutputAudioCodec, "copy", StringComparison.OrdinalIgnoreCase))
+ || EncodingHelper.IsCopyCodec(OutputAudioCodec))
{
if (AudioStream != null)
{
@@ -405,7 +405,7 @@ namespace MediaBrowser.Controller.MediaEncoding
get
{
if (BaseRequest.Static
- || string.Equals(OutputAudioCodec, "copy", StringComparison.OrdinalIgnoreCase))
+ || EncodingHelper.IsCopyCodec(OutputAudioCodec))
{
if (AudioStream != null)
{
@@ -424,7 +424,7 @@ namespace MediaBrowser.Controller.MediaEncoding
{
get
{
- if (BaseRequest.Static || string.Equals(OutputVideoCodec, "copy", StringComparison.OrdinalIgnoreCase))
+ if (BaseRequest.Static || EncodingHelper.IsCopyCodec(OutputVideoCodec))
{
return VideoStream?.Level;
}
@@ -448,7 +448,7 @@ namespace MediaBrowser.Controller.MediaEncoding
get
{
if (BaseRequest.Static
- || string.Equals(OutputVideoCodec, "copy", StringComparison.OrdinalIgnoreCase))
+ || EncodingHelper.IsCopyCodec(OutputVideoCodec))
{
return VideoStream?.BitDepth;
}
@@ -466,7 +466,7 @@ namespace MediaBrowser.Controller.MediaEncoding
get
{
if (BaseRequest.Static
- || string.Equals(OutputVideoCodec, "copy", StringComparison.OrdinalIgnoreCase))
+ || EncodingHelper.IsCopyCodec(OutputVideoCodec))
{
return VideoStream?.RefFrames;
}
@@ -483,7 +483,7 @@ namespace MediaBrowser.Controller.MediaEncoding
get
{
if (BaseRequest.Static
- || string.Equals(OutputVideoCodec, "copy", StringComparison.OrdinalIgnoreCase))
+ || EncodingHelper.IsCopyCodec(OutputVideoCodec))
{
return VideoStream == null ? null : (VideoStream.AverageFrameRate ?? VideoStream.RealFrameRate);
}
@@ -514,7 +514,7 @@ namespace MediaBrowser.Controller.MediaEncoding
{
get
{
- if (BaseRequest.Static || string.Equals(OutputVideoCodec, "copy", StringComparison.OrdinalIgnoreCase))
+ if (BaseRequest.Static || EncodingHelper.IsCopyCodec(OutputVideoCodec))
{
return VideoStream?.PacketLength;
}
@@ -530,7 +530,7 @@ namespace MediaBrowser.Controller.MediaEncoding
{
get
{
- if (BaseRequest.Static || string.Equals(OutputVideoCodec, "copy", StringComparison.OrdinalIgnoreCase))
+ if (BaseRequest.Static || EncodingHelper.IsCopyCodec(OutputVideoCodec))
{
return VideoStream?.Profile;
}
@@ -550,7 +550,7 @@ namespace MediaBrowser.Controller.MediaEncoding
get
{
if (BaseRequest.Static
- || string.Equals(OutputVideoCodec, "copy", StringComparison.OrdinalIgnoreCase))
+ || EncodingHelper.IsCopyCodec(OutputVideoCodec))
{
return VideoStream?.CodecTag;
}
@@ -564,7 +564,7 @@ namespace MediaBrowser.Controller.MediaEncoding
get
{
if (BaseRequest.Static
- || string.Equals(OutputVideoCodec, "copy", StringComparison.OrdinalIgnoreCase))
+ || EncodingHelper.IsCopyCodec(OutputVideoCodec))
{
return VideoStream?.IsAnamorphic;
}
@@ -577,7 +577,7 @@ namespace MediaBrowser.Controller.MediaEncoding
{
get
{
- if (string.Equals(OutputVideoCodec, "copy", StringComparison.OrdinalIgnoreCase))
+ if (EncodingHelper.IsCopyCodec(OutputVideoCodec))
{
return VideoStream?.Codec;
}
@@ -590,7 +590,7 @@ namespace MediaBrowser.Controller.MediaEncoding
{
get
{
- if (string.Equals(OutputAudioCodec, "copy", StringComparison.OrdinalIgnoreCase))
+ if (EncodingHelper.IsCopyCodec(OutputAudioCodec))
{
return AudioStream?.Codec;
}
@@ -604,7 +604,7 @@ namespace MediaBrowser.Controller.MediaEncoding
get
{
if (BaseRequest.Static
- || string.Equals(OutputVideoCodec, "copy", StringComparison.OrdinalIgnoreCase))
+ || EncodingHelper.IsCopyCodec(OutputVideoCodec))
{
return VideoStream?.IsInterlaced;
}
@@ -622,7 +622,7 @@ namespace MediaBrowser.Controller.MediaEncoding
{
get
{
- if (BaseRequest.Static || string.Equals(OutputVideoCodec, "copy", StringComparison.OrdinalIgnoreCase))
+ if (BaseRequest.Static || EncodingHelper.IsCopyCodec(OutputVideoCodec))
{
return VideoStream?.IsAVC;
}
diff --git a/MediaBrowser.Controller/Net/BasePeriodicWebSocketListener.cs b/MediaBrowser.Controller/Net/BasePeriodicWebSocketListener.cs
index 1162bff13..5be656bdb 100644
--- a/MediaBrowser.Controller/Net/BasePeriodicWebSocketListener.cs
+++ b/MediaBrowser.Controller/Net/BasePeriodicWebSocketListener.cs
@@ -104,7 +104,7 @@ namespace MediaBrowser.Controller.Net
}
}
- protected void SendData(bool force)
+ protected async Task SendData(bool force)
{
Tuple<IWebSocketConnection, CancellationTokenSource, TStateType>[] tuples;
@@ -128,13 +128,18 @@ namespace MediaBrowser.Controller.Net
.ToArray();
}
- foreach (var tuple in tuples)
+ IEnumerable<Task> GetTasks()
{
- SendData(tuple);
+ foreach (var tuple in tuples)
+ {
+ yield return SendData(tuple);
+ }
}
+
+ await Task.WhenAll(GetTasks()).ConfigureAwait(false);
}
- private async void SendData(Tuple<IWebSocketConnection, CancellationTokenSource, TStateType> tuple)
+ private async Task SendData(Tuple<IWebSocketConnection, CancellationTokenSource, TStateType> tuple)
{
var connection = tuple.Item1;
@@ -148,11 +153,13 @@ namespace MediaBrowser.Controller.Net
if (data != null)
{
- await connection.SendAsync(new WebSocketMessage<TReturnDataType>
- {
- MessageType = Name,
- Data = data
- }, cancellationToken).ConfigureAwait(false);
+ await connection.SendAsync(
+ new WebSocketMessage<TReturnDataType>
+ {
+ MessageType = Name,
+ Data = data
+ },
+ cancellationToken).ConfigureAwait(false);
state.DateLastSendUtc = DateTime.UtcNow;
}
diff --git a/MediaBrowser.MediaEncoding/Subtitles/AssParser.cs b/MediaBrowser.MediaEncoding/Subtitles/AssParser.cs
index 293cf5ea5..f44cf1452 100644
--- a/MediaBrowser.MediaEncoding/Subtitles/AssParser.cs
+++ b/MediaBrowser.MediaEncoding/Subtitles/AssParser.cs
@@ -33,10 +33,12 @@ namespace MediaBrowser.MediaEncoding.Subtitles
{
continue;
}
+
if (line.StartsWith("["))
+ {
break;
- if (string.IsNullOrEmpty(line))
- continue;
+ }
+
var subEvent = new SubtitleTrackEvent { Id = eventIndex.ToString(_usCulture) };
eventIndex++;
var sections = line.Substring(10).Split(',');
diff --git a/MediaBrowser.Model/Activity/ActivityLogEntry.cs b/MediaBrowser.Model/Activity/ActivityLogEntry.cs
index 5ab904394..1d47ef9f6 100644
--- a/MediaBrowser.Model/Activity/ActivityLogEntry.cs
+++ b/MediaBrowser.Model/Activity/ActivityLogEntry.cs
@@ -1,3 +1,4 @@
+#nullable disable
#pragma warning disable CS1591
using System;
diff --git a/MediaBrowser.Model/ApiClient/ServerDiscoveryInfo.cs b/MediaBrowser.Model/ApiClient/ServerDiscoveryInfo.cs
index bb203f895..fcc90a1f7 100644
--- a/MediaBrowser.Model/ApiClient/ServerDiscoveryInfo.cs
+++ b/MediaBrowser.Model/ApiClient/ServerDiscoveryInfo.cs
@@ -1,3 +1,4 @@
+#nullable disable
#pragma warning disable CS1591
namespace MediaBrowser.Model.ApiClient
diff --git a/MediaBrowser.Model/Branding/BrandingOptions.cs b/MediaBrowser.Model/Branding/BrandingOptions.cs
index 8ab268a64..5ddf1e7e6 100644
--- a/MediaBrowser.Model/Branding/BrandingOptions.cs
+++ b/MediaBrowser.Model/Branding/BrandingOptions.cs
@@ -1,3 +1,4 @@
+#nullable disable
#pragma warning disable CS1591
namespace MediaBrowser.Model.Branding
diff --git a/MediaBrowser.Model/Channels/ChannelFeatures.cs b/MediaBrowser.Model/Channels/ChannelFeatures.cs
index c4e97ffe5..496102d83 100644
--- a/MediaBrowser.Model/Channels/ChannelFeatures.cs
+++ b/MediaBrowser.Model/Channels/ChannelFeatures.cs
@@ -1,3 +1,4 @@
+#nullable disable
#pragma warning disable CS1591
using System;
diff --git a/MediaBrowser.Model/Channels/ChannelInfo.cs b/MediaBrowser.Model/Channels/ChannelInfo.cs
index bfb34db55..f2432aaeb 100644
--- a/MediaBrowser.Model/Channels/ChannelInfo.cs
+++ b/MediaBrowser.Model/Channels/ChannelInfo.cs
@@ -1,3 +1,4 @@
+#nullable disable
#pragma warning disable CS1591
namespace MediaBrowser.Model.Channels
diff --git a/MediaBrowser.Model/Channels/ChannelQuery.cs b/MediaBrowser.Model/Channels/ChannelQuery.cs
index 88fc94a6f..d11260039 100644
--- a/MediaBrowser.Model/Channels/ChannelQuery.cs
+++ b/MediaBrowser.Model/Channels/ChannelQuery.cs
@@ -1,3 +1,4 @@
+#nullable disable
#pragma warning disable CS1591
using System;
@@ -13,8 +14,11 @@ namespace MediaBrowser.Model.Channels
/// </summary>
/// <value>The fields.</value>
public ItemFields[] Fields { get; set; }
+
public bool? EnableImages { get; set; }
+
public int? ImageTypeLimit { get; set; }
+
public ImageType[] EnableImageTypes { get; set; }
/// <summary>
@@ -48,7 +52,9 @@ namespace MediaBrowser.Model.Channels
/// </summary>
/// <value><c>null</c> if [is favorite] contains no value, <c>true</c> if [is favorite]; otherwise, <c>false</c>.</value>
public bool? IsFavorite { get; set; }
+
public bool? IsRecordingsFolder { get; set; }
+
public bool RefreshLatestChannelItems { get; set; }
}
}
diff --git a/MediaBrowser.Model/Configuration/BaseApplicationConfiguration.cs b/MediaBrowser.Model/Configuration/BaseApplicationConfiguration.cs
index cc2541f74..cdd322c94 100644
--- a/MediaBrowser.Model/Configuration/BaseApplicationConfiguration.cs
+++ b/MediaBrowser.Model/Configuration/BaseApplicationConfiguration.cs
@@ -1,3 +1,4 @@
+#nullable disable
using System;
using System.Xml.Serialization;
diff --git a/MediaBrowser.Model/Configuration/EncodingOptions.cs b/MediaBrowser.Model/Configuration/EncodingOptions.cs
index 648568fd7..0c0e01f11 100644
--- a/MediaBrowser.Model/Configuration/EncodingOptions.cs
+++ b/MediaBrowser.Model/Configuration/EncodingOptions.cs
@@ -1,3 +1,4 @@
+#nullable disable
#pragma warning disable CS1591
namespace MediaBrowser.Model.Configuration
@@ -5,10 +6,15 @@ namespace MediaBrowser.Model.Configuration
public class EncodingOptions
{
public int EncodingThreadCount { get; set; }
+
public string TranscodingTempPath { get; set; }
+
public double DownMixAudioBoost { get; set; }
+
public bool EnableThrottling { get; set; }
+
public int ThrottleDelaySeconds { get; set; }
+
public string HardwareAccelerationType { get; set; }
/// <summary>
@@ -20,12 +26,19 @@ namespace MediaBrowser.Model.Configuration
/// The current FFmpeg path being used by the system and displayed on the transcode page.
/// </summary>
public string EncoderAppPathDisplay { get; set; }
+
public string VaapiDevice { get; set; }
+
public int H264Crf { get; set; }
+
public int H265Crf { get; set; }
+
public string EncoderPreset { get; set; }
+
public string DeinterlaceMethod { get; set; }
+
public bool EnableHardwareEncoding { get; set; }
+
public bool EnableSubtitleExtraction { get; set; }
public string[] HardwareDecodingCodecs { get; set; }
diff --git a/MediaBrowser.Model/Configuration/LibraryOptions.cs b/MediaBrowser.Model/Configuration/LibraryOptions.cs
index 4342ccd8a..4229a4335 100644
--- a/MediaBrowser.Model/Configuration/LibraryOptions.cs
+++ b/MediaBrowser.Model/Configuration/LibraryOptions.cs
@@ -1,3 +1,4 @@
+#nullable disable
#pragma warning disable CS1591
using System;
diff --git a/MediaBrowser.Model/Configuration/MetadataOptions.cs b/MediaBrowser.Model/Configuration/MetadataOptions.cs
index 625054b9e..e7dc3da3c 100644
--- a/MediaBrowser.Model/Configuration/MetadataOptions.cs
+++ b/MediaBrowser.Model/Configuration/MetadataOptions.cs
@@ -1,3 +1,4 @@
+#nullable disable
#pragma warning disable CS1591
using System;
@@ -12,12 +13,15 @@ namespace MediaBrowser.Model.Configuration
public string ItemType { get; set; }
public string[] DisabledMetadataSavers { get; set; }
+
public string[] LocalMetadataReaderOrder { get; set; }
public string[] DisabledMetadataFetchers { get; set; }
+
public string[] MetadataFetcherOrder { get; set; }
public string[] DisabledImageFetchers { get; set; }
+
public string[] ImageFetcherOrder { get; set; }
public MetadataOptions()
diff --git a/MediaBrowser.Model/Configuration/MetadataPlugin.cs b/MediaBrowser.Model/Configuration/MetadataPlugin.cs
index c2b47eb9b..db8cd1875 100644
--- a/MediaBrowser.Model/Configuration/MetadataPlugin.cs
+++ b/MediaBrowser.Model/Configuration/MetadataPlugin.cs
@@ -1,3 +1,4 @@
+#nullable disable
#pragma warning disable CS1591
namespace MediaBrowser.Model.Configuration
diff --git a/MediaBrowser.Model/Configuration/MetadataPluginSummary.cs b/MediaBrowser.Model/Configuration/MetadataPluginSummary.cs
index 53063810b..0c197ee02 100644
--- a/MediaBrowser.Model/Configuration/MetadataPluginSummary.cs
+++ b/MediaBrowser.Model/Configuration/MetadataPluginSummary.cs
@@ -1,3 +1,4 @@
+#nullable disable
#pragma warning disable CS1591
using System;
diff --git a/MediaBrowser.Model/Configuration/ServerConfiguration.cs b/MediaBrowser.Model/Configuration/ServerConfiguration.cs
index 1f5981f10..60b1e6eae 100644
--- a/MediaBrowser.Model/Configuration/ServerConfiguration.cs
+++ b/MediaBrowser.Model/Configuration/ServerConfiguration.cs
@@ -1,3 +1,4 @@
+#nullable disable
#pragma warning disable CS1591
using System;
diff --git a/MediaBrowser.Model/Configuration/UserConfiguration.cs b/MediaBrowser.Model/Configuration/UserConfiguration.cs
index 79cf0a065..85d864eec 100644
--- a/MediaBrowser.Model/Configuration/UserConfiguration.cs
+++ b/MediaBrowser.Model/Configuration/UserConfiguration.cs
@@ -1,3 +1,4 @@
+#nullable disable
#pragma warning disable CS1591
using System;
diff --git a/MediaBrowser.Model/Configuration/XbmcMetadataOptions.cs b/MediaBrowser.Model/Configuration/XbmcMetadataOptions.cs
index d6c1295f4..c48a38192 100644
--- a/MediaBrowser.Model/Configuration/XbmcMetadataOptions.cs
+++ b/MediaBrowser.Model/Configuration/XbmcMetadataOptions.cs
@@ -1,3 +1,4 @@
+#nullable disable
#pragma warning disable CS1591
namespace MediaBrowser.Model.Configuration
diff --git a/MediaBrowser.Model/Cryptography/ICryptoProvider.cs b/MediaBrowser.Model/Cryptography/ICryptoProvider.cs
index 656c04f46..d8b7d848a 100644
--- a/MediaBrowser.Model/Cryptography/ICryptoProvider.cs
+++ b/MediaBrowser.Model/Cryptography/ICryptoProvider.cs
@@ -10,7 +10,7 @@ namespace MediaBrowser.Model.Cryptography
IEnumerable<string> GetSupportedHashMethods();
- byte[] ComputeHash(string HashMethod, byte[] bytes, byte[] salt);
+ byte[] ComputeHash(string hashMethod, byte[] bytes, byte[] salt);
byte[] ComputeHashWithDefaultMethod(byte[] bytes, byte[] salt);
diff --git a/MediaBrowser.Model/Devices/ContentUploadHistory.cs b/MediaBrowser.Model/Devices/ContentUploadHistory.cs
deleted file mode 100644
index c493760d5..000000000
--- a/MediaBrowser.Model/Devices/ContentUploadHistory.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-#pragma warning disable CS1591
-
-namespace MediaBrowser.Model.Devices
-{
- public class ContentUploadHistory
- {
- public string DeviceId { get; set; }
- public LocalFileInfo[] FilesUploaded { get; set; }
-
- public ContentUploadHistory()
- {
- FilesUploaded = new LocalFileInfo[] { };
- }
- }
-}
diff --git a/MediaBrowser.Model/Devices/DeviceInfo.cs b/MediaBrowser.Model/Devices/DeviceInfo.cs
index d2563d1d0..0cccf931c 100644
--- a/MediaBrowser.Model/Devices/DeviceInfo.cs
+++ b/MediaBrowser.Model/Devices/DeviceInfo.cs
@@ -1,3 +1,4 @@
+#nullable disable
#pragma warning disable CS1591
using System;
diff --git a/MediaBrowser.Model/Devices/DeviceOptions.cs b/MediaBrowser.Model/Devices/DeviceOptions.cs
index 8b77fd7fc..037ffeb5e 100644
--- a/MediaBrowser.Model/Devices/DeviceOptions.cs
+++ b/MediaBrowser.Model/Devices/DeviceOptions.cs
@@ -4,6 +4,6 @@ namespace MediaBrowser.Model.Devices
{
public class DeviceOptions
{
- public string CustomName { get; set; }
+ public string? CustomName { get; set; }
}
}
diff --git a/MediaBrowser.Model/Devices/LocalFileInfo.cs b/MediaBrowser.Model/Devices/LocalFileInfo.cs
deleted file mode 100644
index 63a8dc2aa..000000000
--- a/MediaBrowser.Model/Devices/LocalFileInfo.cs
+++ /dev/null
@@ -1,12 +0,0 @@
-#pragma warning disable CS1591
-
-namespace MediaBrowser.Model.Devices
-{
- public class LocalFileInfo
- {
- public string Name { get; set; }
- public string Id { get; set; }
- public string Album { get; set; }
- public string MimeType { get; set; }
- }
-}
diff --git a/MediaBrowser.Model/Dlna/AudioOptions.cs b/MediaBrowser.Model/Dlna/AudioOptions.cs
index 40081b282..fc555c5f7 100644
--- a/MediaBrowser.Model/Dlna/AudioOptions.cs
+++ b/MediaBrowser.Model/Dlna/AudioOptions.cs
@@ -1,3 +1,4 @@
+#nullable disable
#pragma warning disable CS1591
using System;
@@ -19,12 +20,17 @@ namespace MediaBrowser.Model.Dlna
}
public bool EnableDirectPlay { get; set; }
+
public bool EnableDirectStream { get; set; }
+
public bool ForceDirectPlay { get; set; }
+
public bool ForceDirectStream { get; set; }
public Guid ItemId { get; set; }
+
public MediaSourceInfo[] MediaSources { get; set; }
+
public DeviceProfile Profile { get; set; }
/// <summary>
diff --git a/MediaBrowser.Model/Dlna/CodecProfile.cs b/MediaBrowser.Model/Dlna/CodecProfile.cs
index 7bb961deb..d4fd3e673 100644
--- a/MediaBrowser.Model/Dlna/CodecProfile.cs
+++ b/MediaBrowser.Model/Dlna/CodecProfile.cs
@@ -1,3 +1,4 @@
+#nullable disable
#pragma warning disable CS1591
using System;
diff --git a/MediaBrowser.Model/Dlna/ConditionProcessor.cs b/MediaBrowser.Model/Dlna/ConditionProcessor.cs
index 0c3bd8882..faf1ee41b 100644
--- a/MediaBrowser.Model/Dlna/ConditionProcessor.cs
+++ b/MediaBrowser.Model/Dlna/ConditionProcessor.cs
@@ -15,7 +15,7 @@ namespace MediaBrowser.Model.Dlna
int? height,
int? videoBitDepth,
int? videoBitrate,
- string videoProfile,
+ string? videoProfile,
double? videoLevel,
float? videoFramerate,
int? packetLength,
@@ -25,7 +25,7 @@ namespace MediaBrowser.Model.Dlna
int? refFrames,
int? numVideoStreams,
int? numAudioStreams,
- string videoCodecTag,
+ string? videoCodecTag,
bool? isAvc)
{
switch (condition.Property)
@@ -103,7 +103,7 @@ namespace MediaBrowser.Model.Dlna
int? audioBitrate,
int? audioSampleRate,
int? audioBitDepth,
- string audioProfile,
+ string? audioProfile,
bool? isSecondaryTrack)
{
switch (condition.Property)
@@ -154,7 +154,7 @@ namespace MediaBrowser.Model.Dlna
return false;
}
- private static bool IsConditionSatisfied(ProfileCondition condition, string currentValue)
+ private static bool IsConditionSatisfied(ProfileCondition condition, string? currentValue)
{
if (string.IsNullOrEmpty(currentValue))
{
@@ -201,34 +201,6 @@ namespace MediaBrowser.Model.Dlna
return false;
}
- private static bool IsConditionSatisfied(ProfileCondition condition, float currentValue)
- {
- if (currentValue <= 0)
- {
- // If the value is unknown, it satisfies if not marked as required
- return !condition.IsRequired;
- }
-
- if (float.TryParse(condition.Value, NumberStyles.Any, CultureInfo.InvariantCulture, out var expected))
- {
- switch (condition.Condition)
- {
- case ProfileConditionType.Equals:
- return currentValue.Equals(expected);
- case ProfileConditionType.GreaterThanEqual:
- return currentValue >= expected;
- case ProfileConditionType.LessThanEqual:
- return currentValue <= expected;
- case ProfileConditionType.NotEquals:
- return !currentValue.Equals(expected);
- default:
- throw new InvalidOperationException("Unexpected ProfileConditionType: " + condition.Condition);
- }
- }
-
- return false;
- }
-
private static bool IsConditionSatisfied(ProfileCondition condition, double? currentValue)
{
if (!currentValue.HasValue)
diff --git a/MediaBrowser.Model/Dlna/ContainerProfile.cs b/MediaBrowser.Model/Dlna/ContainerProfile.cs
index cc2417a70..f77d9b267 100644
--- a/MediaBrowser.Model/Dlna/ContainerProfile.cs
+++ b/MediaBrowser.Model/Dlna/ContainerProfile.cs
@@ -1,3 +1,4 @@
+#nullable disable
#pragma warning disable CS1591
using System;
@@ -10,6 +11,7 @@ namespace MediaBrowser.Model.Dlna
{
[XmlAttribute("type")]
public DlnaProfileType Type { get; set; }
+
public ProfileCondition[] Conditions { get; set; }
[XmlAttribute("container")]
diff --git a/MediaBrowser.Model/Dlna/ContentFeatureBuilder.cs b/MediaBrowser.Model/Dlna/ContentFeatureBuilder.cs
index a20f11503..b055ad41a 100644
--- a/MediaBrowser.Model/Dlna/ContentFeatureBuilder.cs
+++ b/MediaBrowser.Model/Dlna/ContentFeatureBuilder.cs
@@ -1,3 +1,4 @@
+#nullable disable
#pragma warning disable CS1591
using System;
@@ -32,7 +33,10 @@ namespace MediaBrowser.Model.Dlna
DlnaFlags.InteractiveTransferMode |
DlnaFlags.DlnaV15;
- string dlnaflags = string.Format(";DLNA.ORG_FLAGS={0}", DlnaMaps.FlagsToString(flagValue));
+ string dlnaflags = string.Format(
+ CultureInfo.InvariantCulture,
+ ";DLNA.ORG_FLAGS={0}",
+ DlnaMaps.FlagsToString(flagValue));
ResponseProfile mediaProfile = _profile.GetImageMediaProfile(container,
width,
diff --git a/MediaBrowser.Model/Dlna/DeviceIdentification.cs b/MediaBrowser.Model/Dlna/DeviceIdentification.cs
index f1699d930..85cc9e3c1 100644
--- a/MediaBrowser.Model/Dlna/DeviceIdentification.cs
+++ b/MediaBrowser.Model/Dlna/DeviceIdentification.cs
@@ -1,3 +1,4 @@
+#nullable disable
#pragma warning disable CS1591
using System;
diff --git a/MediaBrowser.Model/Dlna/DeviceProfile.cs b/MediaBrowser.Model/Dlna/DeviceProfile.cs
index 3813ac5eb..6462ffdc1 100644
--- a/MediaBrowser.Model/Dlna/DeviceProfile.cs
+++ b/MediaBrowser.Model/Dlna/DeviceProfile.cs
@@ -1,3 +1,4 @@
+#nullable disable
#pragma warning disable CS1591
using System;
diff --git a/MediaBrowser.Model/Dlna/DeviceProfileInfo.cs b/MediaBrowser.Model/Dlna/DeviceProfileInfo.cs
index 347583965..74c32c523 100644
--- a/MediaBrowser.Model/Dlna/DeviceProfileInfo.cs
+++ b/MediaBrowser.Model/Dlna/DeviceProfileInfo.cs
@@ -1,3 +1,4 @@
+#nullable disable
#pragma warning disable CS1591
namespace MediaBrowser.Model.Dlna
diff --git a/MediaBrowser.Model/Dlna/DirectPlayProfile.cs b/MediaBrowser.Model/Dlna/DirectPlayProfile.cs
index b43f8633e..88cb83991 100644
--- a/MediaBrowser.Model/Dlna/DirectPlayProfile.cs
+++ b/MediaBrowser.Model/Dlna/DirectPlayProfile.cs
@@ -1,3 +1,4 @@
+#nullable disable
#pragma warning disable CS1591
using System.Xml.Serialization;
diff --git a/MediaBrowser.Model/Dlna/HttpHeaderInfo.cs b/MediaBrowser.Model/Dlna/HttpHeaderInfo.cs
index f23a24084..17c4dffcc 100644
--- a/MediaBrowser.Model/Dlna/HttpHeaderInfo.cs
+++ b/MediaBrowser.Model/Dlna/HttpHeaderInfo.cs
@@ -1,3 +1,4 @@
+#nullable disable
#pragma warning disable CS1591
using System.Xml.Serialization;
diff --git a/MediaBrowser.Model/Dlna/ITranscoderSupport.cs b/MediaBrowser.Model/Dlna/ITranscoderSupport.cs
index 7e35cc85b..d9bd094d9 100644
--- a/MediaBrowser.Model/Dlna/ITranscoderSupport.cs
+++ b/MediaBrowser.Model/Dlna/ITranscoderSupport.cs
@@ -1,3 +1,4 @@
+#nullable disable
#pragma warning disable CS1591
namespace MediaBrowser.Model.Dlna
@@ -5,7 +6,9 @@ namespace MediaBrowser.Model.Dlna
public interface ITranscoderSupport
{
bool CanEncodeToAudioCodec(string codec);
+
bool CanEncodeToSubtitleCodec(string codec);
+
bool CanExtractSubtitles(string codec);
}
@@ -15,10 +18,12 @@ namespace MediaBrowser.Model.Dlna
{
return true;
}
+
public bool CanEncodeToSubtitleCodec(string codec)
{
return true;
}
+
public bool CanExtractSubtitles(string codec)
{
return true;
diff --git a/MediaBrowser.Model/Dlna/MediaFormatProfileResolver.cs b/MediaBrowser.Model/Dlna/MediaFormatProfileResolver.cs
index 4cd318abb..10e9179c0 100644
--- a/MediaBrowser.Model/Dlna/MediaFormatProfileResolver.cs
+++ b/MediaBrowser.Model/Dlna/MediaFormatProfileResolver.cs
@@ -1,3 +1,4 @@
+#nullable disable
#pragma warning disable CS1591
using System;
@@ -21,13 +22,13 @@ namespace MediaBrowser.Model.Dlna
if (string.Equals(container, "asf", StringComparison.OrdinalIgnoreCase))
{
MediaFormatProfile? val = ResolveVideoASFFormat(videoCodec, audioCodec, width, height);
- return val.HasValue ? new MediaFormatProfile[] { val.Value } : new MediaFormatProfile[] { };
+ return val.HasValue ? new MediaFormatProfile[] { val.Value } : Array.Empty<MediaFormatProfile>();
}
if (string.Equals(container, "mp4", StringComparison.OrdinalIgnoreCase))
{
MediaFormatProfile? val = ResolveVideoMP4Format(videoCodec, audioCodec, width, height);
- return val.HasValue ? new MediaFormatProfile[] { val.Value } : new MediaFormatProfile[] { };
+ return val.HasValue ? new MediaFormatProfile[] { val.Value } : Array.Empty<MediaFormatProfile>();
}
if (string.Equals(container, "avi", StringComparison.OrdinalIgnoreCase))
@@ -61,18 +62,18 @@ namespace MediaBrowser.Model.Dlna
if (string.Equals(container, "3gp", StringComparison.OrdinalIgnoreCase))
{
MediaFormatProfile? val = ResolveVideo3GPFormat(videoCodec, audioCodec);
- return val.HasValue ? new MediaFormatProfile[] { val.Value } : new MediaFormatProfile[] { };
+ return val.HasValue ? new MediaFormatProfile[] { val.Value } : Array.Empty<MediaFormatProfile>();
}
if (string.Equals(container, "ogv", StringComparison.OrdinalIgnoreCase) || string.Equals(container, "ogg", StringComparison.OrdinalIgnoreCase))
return new MediaFormatProfile[] { MediaFormatProfile.OGV };
- return new MediaFormatProfile[] { };
+ return Array.Empty<MediaFormatProfile>();
}
private MediaFormatProfile[] ResolveVideoMPEG2TSFormat(string videoCodec, string audioCodec, int? width, int? height, TransportStreamTimestamp timestampType)
{
- string suffix = "";
+ string suffix = string.Empty;
switch (timestampType)
{
@@ -92,16 +93,18 @@ namespace MediaBrowser.Model.Dlna
if (string.Equals(videoCodec, "mpeg2video", StringComparison.OrdinalIgnoreCase))
{
- var list = new List<MediaFormatProfile>();
-
- list.Add(ValueOf("MPEG_TS_SD_NA" + suffix));
- list.Add(ValueOf("MPEG_TS_SD_EU" + suffix));
- list.Add(ValueOf("MPEG_TS_SD_KO" + suffix));
+ var list = new List<MediaFormatProfile>
+ {
+ ValueOf("MPEG_TS_SD_NA" + suffix),
+ ValueOf("MPEG_TS_SD_EU" + suffix),
+ ValueOf("MPEG_TS_SD_KO" + suffix)
+ };
if ((timestampType == TransportStreamTimestamp.Valid) && string.Equals(audioCodec, "aac", StringComparison.OrdinalIgnoreCase))
{
list.Add(MediaFormatProfile.MPEG_TS_JP_T);
}
+
return list.ToArray();
}
if (string.Equals(videoCodec, "h264", StringComparison.OrdinalIgnoreCase))
@@ -115,6 +118,7 @@ namespace MediaBrowser.Model.Dlna
{
return new MediaFormatProfile[] { MediaFormatProfile.AVC_TS_HD_DTS_ISO };
}
+
return new MediaFormatProfile[] { MediaFormatProfile.AVC_TS_HD_DTS_T };
}
diff --git a/MediaBrowser.Model/Dlna/ProfileCondition.cs b/MediaBrowser.Model/Dlna/ProfileCondition.cs
index 2021038d8..f8b5dee81 100644
--- a/MediaBrowser.Model/Dlna/ProfileCondition.cs
+++ b/MediaBrowser.Model/Dlna/ProfileCondition.cs
@@ -1,3 +1,4 @@
+#nullable disable
#pragma warning disable CS1591
using System.Xml.Serialization;
@@ -6,18 +7,6 @@ namespace MediaBrowser.Model.Dlna
{
public class ProfileCondition
{
- [XmlAttribute("condition")]
- public ProfileConditionType Condition { get; set; }
-
- [XmlAttribute("property")]
- public ProfileConditionValue Property { get; set; }
-
- [XmlAttribute("value")]
- public string Value { get; set; }
-
- [XmlAttribute("isRequired")]
- public bool IsRequired { get; set; }
-
public ProfileCondition()
{
IsRequired = true;
@@ -36,5 +25,17 @@ namespace MediaBrowser.Model.Dlna
Value = value;
IsRequired = isRequired;
}
+
+ [XmlAttribute("condition")]
+ public ProfileConditionType Condition { get; set; }
+
+ [XmlAttribute("property")]
+ public ProfileConditionValue Property { get; set; }
+
+ [XmlAttribute("value")]
+ public string Value { get; set; }
+
+ [XmlAttribute("isRequired")]
+ public bool IsRequired { get; set; }
}
}
diff --git a/MediaBrowser.Model/Dlna/ResolutionConfiguration.cs b/MediaBrowser.Model/Dlna/ResolutionConfiguration.cs
index c26eeec77..30c44fbe0 100644
--- a/MediaBrowser.Model/Dlna/ResolutionConfiguration.cs
+++ b/MediaBrowser.Model/Dlna/ResolutionConfiguration.cs
@@ -5,6 +5,7 @@ namespace MediaBrowser.Model.Dlna
public class ResolutionConfiguration
{
public int MaxWidth { get; set; }
+
public int MaxBitrate { get; set; }
public ResolutionConfiguration(int maxWidth, int maxBitrate)
diff --git a/MediaBrowser.Model/Dlna/ResolutionNormalizer.cs b/MediaBrowser.Model/Dlna/ResolutionNormalizer.cs
index 8235b72d1..102db3b44 100644
--- a/MediaBrowser.Model/Dlna/ResolutionNormalizer.cs
+++ b/MediaBrowser.Model/Dlna/ResolutionNormalizer.cs
@@ -1,3 +1,4 @@
+#nullable disable
#pragma warning disable CS1591
using System;
@@ -17,7 +18,8 @@ namespace MediaBrowser.Model.Dlna
new ResolutionConfiguration(3840, 35000000)
};
- public static ResolutionOptions Normalize(int? inputBitrate,
+ public static ResolutionOptions Normalize(
+ int? inputBitrate,
int? unused1,
int? unused2,
int outputBitrate,
@@ -83,6 +85,7 @@ namespace MediaBrowser.Model.Dlna
{
return .5;
}
+
return 1;
}
diff --git a/MediaBrowser.Model/Dlna/ResolutionOptions.cs b/MediaBrowser.Model/Dlna/ResolutionOptions.cs
index 5ea0252cb..774592abc 100644
--- a/MediaBrowser.Model/Dlna/ResolutionOptions.cs
+++ b/MediaBrowser.Model/Dlna/ResolutionOptions.cs
@@ -5,6 +5,7 @@ namespace MediaBrowser.Model.Dlna
public class ResolutionOptions
{
public int? MaxWidth { get; set; }
+
public int? MaxHeight { get; set; }
}
}
diff --git a/MediaBrowser.Model/Dlna/ResponseProfile.cs b/MediaBrowser.Model/Dlna/ResponseProfile.cs
index c264cb936..48f53f06c 100644
--- a/MediaBrowser.Model/Dlna/ResponseProfile.cs
+++ b/MediaBrowser.Model/Dlna/ResponseProfile.cs
@@ -1,5 +1,7 @@
+#nullable disable
#pragma warning disable CS1591
+using System;
using System.Xml.Serialization;
namespace MediaBrowser.Model.Dlna
@@ -28,7 +30,7 @@ namespace MediaBrowser.Model.Dlna
public ResponseProfile()
{
- Conditions = new ProfileCondition[] { };
+ Conditions = Array.Empty<ProfileCondition>();
}
public string[] GetContainers()
diff --git a/MediaBrowser.Model/Dlna/SearchCriteria.cs b/MediaBrowser.Model/Dlna/SearchCriteria.cs
index 394fb9af9..94f5bd3db 100644
--- a/MediaBrowser.Model/Dlna/SearchCriteria.cs
+++ b/MediaBrowser.Model/Dlna/SearchCriteria.cs
@@ -34,9 +34,9 @@ namespace MediaBrowser.Model.Dlna
public SearchCriteria(string search)
{
- if (string.IsNullOrEmpty(search))
+ if (search.Length == 0)
{
- throw new ArgumentNullException(nameof(search));
+ throw new ArgumentException("String can't be empty.", nameof(search));
}
SearchType = SearchType.Unknown;
@@ -48,11 +48,10 @@ namespace MediaBrowser.Model.Dlna
if (subFactors.Length == 3)
{
-
if (string.Equals("upnp:class", subFactors[0], StringComparison.OrdinalIgnoreCase) &&
- (string.Equals("=", subFactors[1]) || string.Equals("derivedfrom", subFactors[1], StringComparison.OrdinalIgnoreCase)))
+ (string.Equals("=", subFactors[1], StringComparison.Ordinal) || string.Equals("derivedfrom", subFactors[1], StringComparison.OrdinalIgnoreCase)))
{
- if (string.Equals("\"object.item.imageItem\"", subFactors[2]) || string.Equals("\"object.item.imageItem.photo\"", subFactors[2], StringComparison.OrdinalIgnoreCase))
+ if (string.Equals("\"object.item.imageItem\"", subFactors[2], StringComparison.Ordinal) || string.Equals("\"object.item.imageItem.photo\"", subFactors[2], StringComparison.OrdinalIgnoreCase))
{
SearchType = SearchType.Image;
}
diff --git a/MediaBrowser.Model/Dlna/StreamBuilder.cs b/MediaBrowser.Model/Dlna/StreamBuilder.cs
index 58755b171..a18ad36c5 100644
--- a/MediaBrowser.Model/Dlna/StreamBuilder.cs
+++ b/MediaBrowser.Model/Dlna/StreamBuilder.cs
@@ -1,3 +1,4 @@
+#nullable disable
#pragma warning disable CS1591
using System;
@@ -339,6 +340,7 @@ namespace MediaBrowser.Model.Dlna
{
transcodeReasons.Add(transcodeReason.Value);
}
+
all = false;
break;
}
diff --git a/MediaBrowser.Model/Dlna/StreamInfo.cs b/MediaBrowser.Model/Dlna/StreamInfo.cs
index c9fe679e1..244463803 100644
--- a/MediaBrowser.Model/Dlna/StreamInfo.cs
+++ b/MediaBrowser.Model/Dlna/StreamInfo.cs
@@ -1,3 +1,4 @@
+#nullable disable
#pragma warning disable CS1591
using System;
diff --git a/MediaBrowser.Model/Dlna/SubtitleProfile.cs b/MediaBrowser.Model/Dlna/SubtitleProfile.cs
index 9c28019aa..01e3c696b 100644
--- a/MediaBrowser.Model/Dlna/SubtitleProfile.cs
+++ b/MediaBrowser.Model/Dlna/SubtitleProfile.cs
@@ -1,3 +1,4 @@
+#nullable disable
#pragma warning disable CS1591
using System;
diff --git a/MediaBrowser.Model/Dlna/SubtitleStreamInfo.cs b/MediaBrowser.Model/Dlna/SubtitleStreamInfo.cs
index 02b3a198c..2f01836bd 100644
--- a/MediaBrowser.Model/Dlna/SubtitleStreamInfo.cs
+++ b/MediaBrowser.Model/Dlna/SubtitleStreamInfo.cs
@@ -1,3 +1,4 @@
+#nullable disable
#pragma warning disable CS1591
namespace MediaBrowser.Model.Dlna
@@ -5,13 +6,21 @@ namespace MediaBrowser.Model.Dlna
public class SubtitleStreamInfo
{
public string Url { get; set; }
+
public string Language { get; set; }
+
public string Name { get; set; }
+
public bool IsForced { get; set; }
+
public string Format { get; set; }
+
public string DisplayTitle { get; set; }
+
public int Index { get; set; }
+
public SubtitleDeliveryMethod DeliveryMethod { get; set; }
+
public bool IsExternalUrl { get; set; }
}
}
diff --git a/MediaBrowser.Model/Dlna/TranscodingProfile.cs b/MediaBrowser.Model/Dlna/TranscodingProfile.cs
index 570ee7baa..f05e31047 100644
--- a/MediaBrowser.Model/Dlna/TranscodingProfile.cs
+++ b/MediaBrowser.Model/Dlna/TranscodingProfile.cs
@@ -1,3 +1,4 @@
+#nullable disable
#pragma warning disable CS1591
using System.Xml.Serialization;
diff --git a/MediaBrowser.Model/Dlna/UpnpDeviceInfo.cs b/MediaBrowser.Model/Dlna/UpnpDeviceInfo.cs
index 3dc1fca36..d71013f01 100644
--- a/MediaBrowser.Model/Dlna/UpnpDeviceInfo.cs
+++ b/MediaBrowser.Model/Dlna/UpnpDeviceInfo.cs
@@ -1,3 +1,4 @@
+#nullable disable
#pragma warning disable CS1591
using System;
@@ -9,8 +10,11 @@ namespace MediaBrowser.Model.Dlna
public class UpnpDeviceInfo
{
public Uri Location { get; set; }
+
public Dictionary<string, string> Headers { get; set; }
+
public IPAddress LocalIpAddress { get; set; }
+
public int LocalPort { get; set; }
}
}
diff --git a/MediaBrowser.Model/Dlna/VideoOptions.cs b/MediaBrowser.Model/Dlna/VideoOptions.cs
index 5b12fff1c..4194f17c6 100644
--- a/MediaBrowser.Model/Dlna/VideoOptions.cs
+++ b/MediaBrowser.Model/Dlna/VideoOptions.cs
@@ -8,6 +8,7 @@ namespace MediaBrowser.Model.Dlna
public class VideoOptions : AudioOptions
{
public int? AudioStreamIndex { get; set; }
+
public int? SubtitleStreamIndex { get; set; }
}
}
diff --git a/MediaBrowser.Model/Dlna/XmlAttribute.cs b/MediaBrowser.Model/Dlna/XmlAttribute.cs
index 31603a754..3a8939a79 100644
--- a/MediaBrowser.Model/Dlna/XmlAttribute.cs
+++ b/MediaBrowser.Model/Dlna/XmlAttribute.cs
@@ -1,3 +1,4 @@
+#nullable disable
#pragma warning disable CS1591
using System.Xml.Serialization;
diff --git a/MediaBrowser.Model/Drawing/DrawingUtils.cs b/MediaBrowser.Model/Drawing/DrawingUtils.cs
index 0be30b0ba..1512c5233 100644
--- a/MediaBrowser.Model/Drawing/DrawingUtils.cs
+++ b/MediaBrowser.Model/Drawing/DrawingUtils.cs
@@ -16,7 +16,8 @@ namespace MediaBrowser.Model.Drawing
/// <param name="maxWidth">A max fixed width, if desired.</param>
/// <param name="maxHeight">A max fixed height, if desired.</param>
/// <returns>A new size object.</returns>
- public static ImageDimensions Resize(ImageDimensions size,
+ public static ImageDimensions Resize(
+ ImageDimensions size,
int width,
int height,
int maxWidth,
@@ -62,7 +63,7 @@ namespace MediaBrowser.Model.Drawing
/// <param name="currentHeight">Height of the current.</param>
/// <param name="currentWidth">Width of the current.</param>
/// <param name="newHeight">The new height.</param>
- /// <returns>the new width</returns>
+ /// <returns>The new width.</returns>
private static int GetNewWidth(int currentHeight, int currentWidth, int newHeight)
=> Convert.ToInt32((double)newHeight / currentHeight * currentWidth);
diff --git a/MediaBrowser.Model/Dto/BaseItemDto.cs b/MediaBrowser.Model/Dto/BaseItemDto.cs
index 607355d8d..c84c51efb 100644
--- a/MediaBrowser.Model/Dto/BaseItemDto.cs
+++ b/MediaBrowser.Model/Dto/BaseItemDto.cs
@@ -1,3 +1,4 @@
+#nullable disable
#pragma warning disable CS1591
using System;
@@ -511,6 +512,13 @@ namespace MediaBrowser.Model.Dto
public string SeriesThumbImageTag { get; set; }
/// <summary>
+ /// Gets or sets the blurhashes for the image tags.
+ /// Maps image type to dictionary mapping image tag to blurhash value.
+ /// </summary>
+ /// <value>The blurhashes.</value>
+ public Dictionary<ImageType, Dictionary<string, string>> ImageBlurHashes { get; set; }
+
+ /// <summary>
/// Gets or sets the series studio.
/// </summary>
/// <value>The series studio.</value>
diff --git a/MediaBrowser.Model/Dto/BaseItemPerson.cs b/MediaBrowser.Model/Dto/BaseItemPerson.cs
index 5b7eefd70..b080f3e4a 100644
--- a/MediaBrowser.Model/Dto/BaseItemPerson.cs
+++ b/MediaBrowser.Model/Dto/BaseItemPerson.cs
@@ -1,3 +1,4 @@
+#nullable disable
using System.Text.Json.Serialization;
namespace MediaBrowser.Model.Dto
diff --git a/MediaBrowser.Model/Dto/IHasServerId.cs b/MediaBrowser.Model/Dto/IHasServerId.cs
index 8c9798c5c..c754d276c 100644
--- a/MediaBrowser.Model/Dto/IHasServerId.cs
+++ b/MediaBrowser.Model/Dto/IHasServerId.cs
@@ -1,3 +1,4 @@
+#nullable disable
#pragma warning disable CS1591
namespace MediaBrowser.Model.Dto
diff --git a/MediaBrowser.Model/Dto/ImageByNameInfo.cs b/MediaBrowser.Model/Dto/ImageByNameInfo.cs
index d2e43634d..06cc3e73c 100644
--- a/MediaBrowser.Model/Dto/ImageByNameInfo.cs
+++ b/MediaBrowser.Model/Dto/ImageByNameInfo.cs
@@ -1,3 +1,4 @@
+#nullable disable
#pragma warning disable CS1591
namespace MediaBrowser.Model.Dto
diff --git a/MediaBrowser.Model/Dto/ImageInfo.cs b/MediaBrowser.Model/Dto/ImageInfo.cs
index 57942ac23..2e4b15a18 100644
--- a/MediaBrowser.Model/Dto/ImageInfo.cs
+++ b/MediaBrowser.Model/Dto/ImageInfo.cs
@@ -1,3 +1,4 @@
+#nullable disable
using MediaBrowser.Model.Entities;
namespace MediaBrowser.Model.Dto
@@ -20,9 +21,9 @@ namespace MediaBrowser.Model.Dto
public int? ImageIndex { get; set; }
/// <summary>
- /// The image tag
+ /// Gets or sets the image tag.
/// </summary>
- public string ImageTag;
+ public string ImageTag { get; set; }
/// <summary>
/// Gets or sets the path.
@@ -31,6 +32,12 @@ namespace MediaBrowser.Model.Dto
public string Path { get; set; }
/// <summary>
+ /// Gets or sets the blurhash.
+ /// </summary>
+ /// <value>The blurhash.</value>
+ public string BlurHash { get; set; }
+
+ /// <summary>
/// Gets or sets the height.
/// </summary>
/// <value>The height.</value>
diff --git a/MediaBrowser.Model/Dto/ImageOptions.cs b/MediaBrowser.Model/Dto/ImageOptions.cs
index 4e672a007..158e622a8 100644
--- a/MediaBrowser.Model/Dto/ImageOptions.cs
+++ b/MediaBrowser.Model/Dto/ImageOptions.cs
@@ -1,3 +1,4 @@
+#nullable disable
using MediaBrowser.Model.Drawing;
using MediaBrowser.Model.Entities;
@@ -9,6 +10,14 @@ namespace MediaBrowser.Model.Dto
public class ImageOptions
{
/// <summary>
+ /// Initializes a new instance of the <see cref="ImageOptions" /> class.
+ /// </summary>
+ public ImageOptions()
+ {
+ EnableImageEnhancers = true;
+ }
+
+ /// <summary>
/// Gets or sets the type of the image.
/// </summary>
/// <value>The type of the image.</value>
@@ -98,13 +107,5 @@ namespace MediaBrowser.Model.Dto
/// </summary>
/// <value>The color of the background.</value>
public string BackgroundColor { get; set; }
-
- /// <summary>
- /// Initializes a new instance of the <see cref="ImageOptions" /> class.
- /// </summary>
- public ImageOptions()
- {
- EnableImageEnhancers = true;
- }
}
}
diff --git a/MediaBrowser.Model/Dto/ItemIndex.cs b/MediaBrowser.Model/Dto/ItemIndex.cs
deleted file mode 100644
index 525576d61..000000000
--- a/MediaBrowser.Model/Dto/ItemIndex.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-namespace MediaBrowser.Model.Dto
-{
- /// <summary>
- /// Class ItemIndex.
- /// </summary>
- public class ItemIndex
- {
- /// <summary>
- /// Gets or sets the name.
- /// </summary>
- /// <value>The name.</value>
- public string Name { get; set; }
-
- /// <summary>
- /// Gets or sets the item count.
- /// </summary>
- /// <value>The item count.</value>
- public int ItemCount { get; set; }
- }
-}
diff --git a/MediaBrowser.Model/Dto/MediaSourceInfo.cs b/MediaBrowser.Model/Dto/MediaSourceInfo.cs
index 29613adbf..74c2cb4f4 100644
--- a/MediaBrowser.Model/Dto/MediaSourceInfo.cs
+++ b/MediaBrowser.Model/Dto/MediaSourceInfo.cs
@@ -1,3 +1,4 @@
+#nullable disable
#pragma warning disable CS1591
using System;
diff --git a/MediaBrowser.Model/Dto/MetadataEditorInfo.cs b/MediaBrowser.Model/Dto/MetadataEditorInfo.cs
index 21d8a31f2..1d840a300 100644
--- a/MediaBrowser.Model/Dto/MetadataEditorInfo.cs
+++ b/MediaBrowser.Model/Dto/MetadataEditorInfo.cs
@@ -1,3 +1,4 @@
+#nullable disable
#pragma warning disable CS1591
using System;
diff --git a/MediaBrowser.Model/Dto/NameIdPair.cs b/MediaBrowser.Model/Dto/NameIdPair.cs
index 1b4800863..efb2c157c 100644
--- a/MediaBrowser.Model/Dto/NameIdPair.cs
+++ b/MediaBrowser.Model/Dto/NameIdPair.cs
@@ -1,3 +1,4 @@
+#nullable disable
#pragma warning disable CS1591
using System;
diff --git a/MediaBrowser.Model/Dto/NameValuePair.cs b/MediaBrowser.Model/Dto/NameValuePair.cs
index 74040c2cb..e71ff3c21 100644
--- a/MediaBrowser.Model/Dto/NameValuePair.cs
+++ b/MediaBrowser.Model/Dto/NameValuePair.cs
@@ -1,3 +1,4 @@
+#nullable disable
#pragma warning disable CS1591
namespace MediaBrowser.Model.Dto
@@ -6,7 +7,6 @@ namespace MediaBrowser.Model.Dto
{
public NameValuePair()
{
-
}
public NameValuePair(string name, string value)
diff --git a/MediaBrowser.Model/Dto/RecommendationDto.cs b/MediaBrowser.Model/Dto/RecommendationDto.cs
index bc97dd6f1..107f41540 100644
--- a/MediaBrowser.Model/Dto/RecommendationDto.cs
+++ b/MediaBrowser.Model/Dto/RecommendationDto.cs
@@ -1,3 +1,4 @@
+#nullable disable
#pragma warning disable CS1591
using System;
diff --git a/MediaBrowser.Model/Dto/UserDto.cs b/MediaBrowser.Model/Dto/UserDto.cs
index d36706c38..40222c9dc 100644
--- a/MediaBrowser.Model/Dto/UserDto.cs
+++ b/MediaBrowser.Model/Dto/UserDto.cs
@@ -1,3 +1,4 @@
+#nullable disable
using System;
using MediaBrowser.Model.Configuration;
using MediaBrowser.Model.Users;
diff --git a/MediaBrowser.Model/Dto/UserItemDataDto.cs b/MediaBrowser.Model/Dto/UserItemDataDto.cs
index 92f06c973..adb2cd2ab 100644
--- a/MediaBrowser.Model/Dto/UserItemDataDto.cs
+++ b/MediaBrowser.Model/Dto/UserItemDataDto.cs
@@ -1,3 +1,4 @@
+#nullable disable
using System;
namespace MediaBrowser.Model.Dto
diff --git a/MediaBrowser.Model/Entities/ChapterInfo.cs b/MediaBrowser.Model/Entities/ChapterInfo.cs
index bea7ec1db..45554c3dc 100644
--- a/MediaBrowser.Model/Entities/ChapterInfo.cs
+++ b/MediaBrowser.Model/Entities/ChapterInfo.cs
@@ -1,3 +1,4 @@
+#nullable disable
#pragma warning disable CS1591
using System;
diff --git a/MediaBrowser.Model/Entities/DisplayPreferences.cs b/MediaBrowser.Model/Entities/DisplayPreferences.cs
index 2cd8bd306..0e5db01dd 100644
--- a/MediaBrowser.Model/Entities/DisplayPreferences.cs
+++ b/MediaBrowser.Model/Entities/DisplayPreferences.cs
@@ -1,3 +1,4 @@
+#nullable disable
using System.Collections.Generic;
namespace MediaBrowser.Model.Entities
diff --git a/MediaBrowser.Model/Entities/IHasProviderIds.cs b/MediaBrowser.Model/Entities/IHasProviderIds.cs
index c117efde9..1310f68ae 100644
--- a/MediaBrowser.Model/Entities/IHasProviderIds.cs
+++ b/MediaBrowser.Model/Entities/IHasProviderIds.cs
@@ -3,7 +3,7 @@ using System.Collections.Generic;
namespace MediaBrowser.Model.Entities
{
/// <summary>
- /// Since BaseItem and DTOBaseItem both have ProviderIds, this interface helps avoid code repition by using extension methods.
+ /// Since BaseItem and DTOBaseItem both have ProviderIds, this interface helps avoid code repetition by using extension methods.
/// </summary>
public interface IHasProviderIds
{
diff --git a/MediaBrowser.Model/Entities/LibraryUpdateInfo.cs b/MediaBrowser.Model/Entities/LibraryUpdateInfo.cs
index b98c00240..6dd6653dc 100644
--- a/MediaBrowser.Model/Entities/LibraryUpdateInfo.cs
+++ b/MediaBrowser.Model/Entities/LibraryUpdateInfo.cs
@@ -5,15 +5,29 @@ using System;
namespace MediaBrowser.Model.Entities
{
/// <summary>
- /// Class LibraryUpdateInfo
+ /// Class LibraryUpdateInfo.
/// </summary>
public class LibraryUpdateInfo
{
/// <summary>
+ /// Initializes a new instance of the <see cref="LibraryUpdateInfo"/> class.
+ /// </summary>
+ public LibraryUpdateInfo()
+ {
+ FoldersAddedTo = Array.Empty<string>();
+ FoldersRemovedFrom = Array.Empty<string>();
+ ItemsAdded = Array.Empty<string>();
+ ItemsRemoved = Array.Empty<string>();
+ ItemsUpdated = Array.Empty<string>();
+ CollectionFolders = Array.Empty<string>();
+ }
+
+ /// <summary>
/// Gets or sets the folders added to.
/// </summary>
/// <value>The folders added to.</value>
public string[] FoldersAddedTo { get; set; }
+
/// <summary>
/// Gets or sets the folders removed from.
/// </summary>
@@ -41,18 +55,5 @@ namespace MediaBrowser.Model.Entities
public string[] CollectionFolders { get; set; }
public bool IsEmpty => FoldersAddedTo.Length == 0 && FoldersRemovedFrom.Length == 0 && ItemsAdded.Length == 0 && ItemsRemoved.Length == 0 && ItemsUpdated.Length == 0 && CollectionFolders.Length == 0;
-
- /// <summary>
- /// Initializes a new instance of the <see cref="LibraryUpdateInfo"/> class.
- /// </summary>
- public LibraryUpdateInfo()
- {
- FoldersAddedTo = Array.Empty<string>();
- FoldersRemovedFrom = Array.Empty<string>();
- ItemsAdded = Array.Empty<string>();
- ItemsRemoved = Array.Empty<string>();
- ItemsUpdated = Array.Empty<string>();
- CollectionFolders = Array.Empty<string>();
- }
}
}
diff --git a/MediaBrowser.Model/Entities/MediaAttachment.cs b/MediaBrowser.Model/Entities/MediaAttachment.cs
index 167be18c9..34e3eabc9 100644
--- a/MediaBrowser.Model/Entities/MediaAttachment.cs
+++ b/MediaBrowser.Model/Entities/MediaAttachment.cs
@@ -1,3 +1,4 @@
+#nullable disable
namespace MediaBrowser.Model.Entities
{
/// <summary>
diff --git a/MediaBrowser.Model/Entities/MediaStream.cs b/MediaBrowser.Model/Entities/MediaStream.cs
index ac33f1da4..fa09cc513 100644
--- a/MediaBrowser.Model/Entities/MediaStream.cs
+++ b/MediaBrowser.Model/Entities/MediaStream.cs
@@ -1,3 +1,4 @@
+#nullable disable
#pragma warning disable CS1591
using System;
diff --git a/MediaBrowser.Model/Entities/MediaUrl.cs b/MediaBrowser.Model/Entities/MediaUrl.cs
index e44143755..74f982437 100644
--- a/MediaBrowser.Model/Entities/MediaUrl.cs
+++ b/MediaBrowser.Model/Entities/MediaUrl.cs
@@ -1,3 +1,4 @@
+#nullable disable
#pragma warning disable CS1591
namespace MediaBrowser.Model.Entities
diff --git a/MediaBrowser.Model/Entities/PackageReviewInfo.cs b/MediaBrowser.Model/Entities/PackageReviewInfo.cs
index a034de8ba..1ebbc3323 100644
--- a/MediaBrowser.Model/Entities/PackageReviewInfo.cs
+++ b/MediaBrowser.Model/Entities/PackageReviewInfo.cs
@@ -1,3 +1,4 @@
+#nullable disable
#pragma warning disable CS1591
using System;
@@ -7,32 +8,32 @@ namespace MediaBrowser.Model.Entities
public class PackageReviewInfo
{
/// <summary>
- /// The package id (database key) for this review
+ /// Gets or sets the package id (database key) for this review.
/// </summary>
public int id { get; set; }
/// <summary>
- /// The rating value
+ /// Gets or sets the rating value.
/// </summary>
public int rating { get; set; }
/// <summary>
- /// Whether or not this review recommends this item
+ /// Gets or sets whether or not this review recommends this item.
/// </summary>
public bool recommend { get; set; }
/// <summary>
- /// A short description of the review
+ /// Gets or sets a short description of the review.
/// </summary>
public string title { get; set; }
/// <summary>
- /// A full review
+ /// Gets or sets the full review.
/// </summary>
public string review { get; set; }
/// <summary>
- /// Time of review
+ /// Gets or sets the time of review.
/// </summary>
public DateTime timestamp { get; set; }
diff --git a/MediaBrowser.Model/Entities/ParentalRating.cs b/MediaBrowser.Model/Entities/ParentalRating.cs
index 4b37bd64a..17b2868a3 100644
--- a/MediaBrowser.Model/Entities/ParentalRating.cs
+++ b/MediaBrowser.Model/Entities/ParentalRating.cs
@@ -1,12 +1,23 @@
+#nullable disable
#pragma warning disable CS1591
namespace MediaBrowser.Model.Entities
{
/// <summary>
- /// Class ParentalRating
+ /// Class ParentalRating.
/// </summary>
public class ParentalRating
{
+ public ParentalRating()
+ {
+ }
+
+ public ParentalRating(string name, int value)
+ {
+ Name = name;
+ Value = value;
+ }
+
/// <summary>
/// Gets or sets the name.
/// </summary>
@@ -18,16 +29,5 @@ namespace MediaBrowser.Model.Entities
/// </summary>
/// <value>The value.</value>
public int Value { get; set; }
-
- public ParentalRating()
- {
-
- }
-
- public ParentalRating(string name, int value)
- {
- Name = name;
- Value = value;
- }
}
}
diff --git a/MediaBrowser.Model/Entities/ProviderIdsExtensions.cs b/MediaBrowser.Model/Entities/ProviderIdsExtensions.cs
index 922eb4ca7..e089dd1e5 100644
--- a/MediaBrowser.Model/Entities/ProviderIdsExtensions.cs
+++ b/MediaBrowser.Model/Entities/ProviderIdsExtensions.cs
@@ -25,7 +25,7 @@ namespace MediaBrowser.Model.Entities
/// <param name="instance">The instance.</param>
/// <param name="provider">The provider.</param>
/// <returns>System.String.</returns>
- public static string GetProviderId(this IHasProviderIds instance, MetadataProviders provider)
+ public static string? GetProviderId(this IHasProviderIds instance, MetadataProviders provider)
{
return instance.GetProviderId(provider.ToString());
}
@@ -36,7 +36,7 @@ namespace MediaBrowser.Model.Entities
/// <param name="instance">The instance.</param>
/// <param name="name">The name.</param>
/// <returns>System.String.</returns>
- public static string GetProviderId(this IHasProviderIds instance, string name)
+ public static string? GetProviderId(this IHasProviderIds instance, string name)
{
if (instance == null)
{
diff --git a/MediaBrowser.Model/Entities/VirtualFolderInfo.cs b/MediaBrowser.Model/Entities/VirtualFolderInfo.cs
index dd30c9c84..2de02e403 100644
--- a/MediaBrowser.Model/Entities/VirtualFolderInfo.cs
+++ b/MediaBrowser.Model/Entities/VirtualFolderInfo.cs
@@ -1,3 +1,4 @@
+#nullable disable
#pragma warning disable CS1591
using System;
diff --git a/MediaBrowser.Model/Events/GenericEventArgs.cs b/MediaBrowser.Model/Events/GenericEventArgs.cs
index 1ef0b25c9..44f60f811 100644
--- a/MediaBrowser.Model/Events/GenericEventArgs.cs
+++ b/MediaBrowser.Model/Events/GenericEventArgs.cs
@@ -22,12 +22,5 @@ namespace MediaBrowser.Model.Events
{
Argument = arg;
}
-
- /// <summary>
- /// Initializes a new instance of the <see cref="GenericEventArgs{T}"/> class.
- /// </summary>
- public GenericEventArgs()
- {
- }
}
}
diff --git a/MediaBrowser.Model/Extensions/ListHelper.cs b/MediaBrowser.Model/Extensions/ListHelper.cs
new file mode 100644
index 000000000..b893a3509
--- /dev/null
+++ b/MediaBrowser.Model/Extensions/ListHelper.cs
@@ -0,0 +1,29 @@
+#nullable disable
+#pragma warning disable CS1591
+
+using System;
+
+namespace MediaBrowser.Model.Extensions
+{
+ // TODO: @bond remove
+ public static class ListHelper
+ {
+ public static bool ContainsIgnoreCase(string[] list, string value)
+ {
+ if (value == null)
+ {
+ throw new ArgumentNullException(nameof(value));
+ }
+
+ foreach (var item in list)
+ {
+ if (string.Equals(item, value, StringComparison.OrdinalIgnoreCase))
+ {
+ return true;
+ }
+ }
+
+ return false;
+ }
+ }
+}
diff --git a/MediaBrowser.Model/Extensions/StringHelper.cs b/MediaBrowser.Model/Extensions/StringHelper.cs
index f819a295c..8ffa3c4ba 100644
--- a/MediaBrowser.Model/Extensions/StringHelper.cs
+++ b/MediaBrowser.Model/Extensions/StringHelper.cs
@@ -12,9 +12,9 @@ namespace MediaBrowser.Model.Extensions
/// <returns>The string with the first character as uppercase.</returns>
public static string FirstToUpper(string str)
{
- if (string.IsNullOrEmpty(str))
+ if (str.Length == 0)
{
- return string.Empty;
+ return str;
}
if (char.IsUpper(str[0]))
diff --git a/MediaBrowser.Model/Globalization/CountryInfo.cs b/MediaBrowser.Model/Globalization/CountryInfo.cs
index 72362f4f3..6f6979316 100644
--- a/MediaBrowser.Model/Globalization/CountryInfo.cs
+++ b/MediaBrowser.Model/Globalization/CountryInfo.cs
@@ -1,3 +1,4 @@
+#nullable disable
namespace MediaBrowser.Model.Globalization
{
/// <summary>
diff --git a/MediaBrowser.Model/Globalization/CultureDto.cs b/MediaBrowser.Model/Globalization/CultureDto.cs
index f415840b0..6af4a872c 100644
--- a/MediaBrowser.Model/Globalization/CultureDto.cs
+++ b/MediaBrowser.Model/Globalization/CultureDto.cs
@@ -1,3 +1,4 @@
+#nullable disable
#pragma warning disable CS1591
using System;
diff --git a/MediaBrowser.Model/Globalization/ILocalizationManager.cs b/MediaBrowser.Model/Globalization/ILocalizationManager.cs
index 613bfca69..baefeb39c 100644
--- a/MediaBrowser.Model/Globalization/ILocalizationManager.cs
+++ b/MediaBrowser.Model/Globalization/ILocalizationManager.cs
@@ -1,3 +1,4 @@
+#nullable disable
using System.Collections.Generic;
using System.Globalization;
using MediaBrowser.Model.Entities;
diff --git a/MediaBrowser.Model/Globalization/LocalizationOption.cs b/MediaBrowser.Model/Globalization/LocalizationOption.cs
index 00caf5e11..81f47d978 100644
--- a/MediaBrowser.Model/Globalization/LocalizationOption.cs
+++ b/MediaBrowser.Model/Globalization/LocalizationOption.cs
@@ -1,3 +1,4 @@
+#nullable disable
#pragma warning disable CS1591
namespace MediaBrowser.Model.Globalization
@@ -11,6 +12,7 @@ namespace MediaBrowser.Model.Globalization
}
public string Name { get; set; }
+
public string Value { get; set; }
}
}
diff --git a/MediaBrowser.Model/IO/FileSystemEntryInfo.cs b/MediaBrowser.Model/IO/FileSystemEntryInfo.cs
index a197f0fbe..36ff5d041 100644
--- a/MediaBrowser.Model/IO/FileSystemEntryInfo.cs
+++ b/MediaBrowser.Model/IO/FileSystemEntryInfo.cs
@@ -1,26 +1,39 @@
namespace MediaBrowser.Model.IO
{
/// <summary>
- /// Class FileSystemEntryInfo
+ /// Class FileSystemEntryInfo.
/// </summary>
public class FileSystemEntryInfo
{
/// <summary>
- /// Gets or sets the name.
+ /// Initializes a new instance of the <see cref="FileSystemEntryInfo" /> class.
+ /// </summary>
+ /// <param name="name">The filename.</param>
+ /// <param name="path">The file path.</param>
+ /// <param name="type">The file type.</param>
+ public FileSystemEntryInfo(string name, string path, FileSystemEntryType type)
+ {
+ Name = name;
+ Path = path;
+ Type = type;
+ }
+
+ /// <summary>
+ /// Gets the name.
/// </summary>
/// <value>The name.</value>
- public string Name { get; set; }
+ public string Name { get; }
/// <summary>
- /// Gets or sets the path.
+ /// Gets the path.
/// </summary>
/// <value>The path.</value>
- public string Path { get; set; }
+ public string Path { get; }
/// <summary>
- /// Gets or sets the type.
+ /// Gets the type.
/// </summary>
/// <value>The type.</value>
- public FileSystemEntryType Type { get; set; }
+ public FileSystemEntryType Type { get; }
}
}
diff --git a/MediaBrowser.Model/IO/FileSystemMetadata.cs b/MediaBrowser.Model/IO/FileSystemMetadata.cs
index 4b9102392..b23119d08 100644
--- a/MediaBrowser.Model/IO/FileSystemMetadata.cs
+++ b/MediaBrowser.Model/IO/FileSystemMetadata.cs
@@ -1,3 +1,4 @@
+#nullable disable
#pragma warning disable CS1591
using System;
diff --git a/MediaBrowser.Model/IO/IFileSystem.cs b/MediaBrowser.Model/IO/IFileSystem.cs
index 53f23a8e0..bba69d4b4 100644
--- a/MediaBrowser.Model/IO/IFileSystem.cs
+++ b/MediaBrowser.Model/IO/IFileSystem.cs
@@ -1,3 +1,4 @@
+#nullable disable
#pragma warning disable CS1591
using System;
diff --git a/MediaBrowser.Model/IO/IIsoManager.cs b/MediaBrowser.Model/IO/IIsoManager.cs
index 8b6af019d..299bb0a21 100644
--- a/MediaBrowser.Model/IO/IIsoManager.cs
+++ b/MediaBrowser.Model/IO/IIsoManager.cs
@@ -16,7 +16,6 @@ namespace MediaBrowser.Model.IO
/// <param name="isoPath">The iso path.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>IsoMount.</returns>
- /// <exception cref="ArgumentNullException">isoPath</exception>
/// <exception cref="IOException">Unable to create mount.</exception>
Task<IIsoMount> Mount(string isoPath, CancellationToken cancellationToken);
diff --git a/MediaBrowser.Model/IO/IIsoMount.cs b/MediaBrowser.Model/IO/IIsoMount.cs
index 72ec673ee..ea65d976a 100644
--- a/MediaBrowser.Model/IO/IIsoMount.cs
+++ b/MediaBrowser.Model/IO/IIsoMount.cs
@@ -8,7 +8,7 @@ namespace MediaBrowser.Model.IO
public interface IIsoMount : IDisposable
{
/// <summary>
- /// Gets or sets the iso path.
+ /// Gets the iso path.
/// </summary>
/// <value>The iso path.</value>
string IsoPath { get; }
diff --git a/MediaBrowser.Model/IO/IIsoMounter.cs b/MediaBrowser.Model/IO/IIsoMounter.cs
index 83fdb5fd6..0d257395a 100644
--- a/MediaBrowser.Model/IO/IIsoMounter.cs
+++ b/MediaBrowser.Model/IO/IIsoMounter.cs
@@ -10,6 +10,12 @@ namespace MediaBrowser.Model.IO
public interface IIsoMounter
{
/// <summary>
+ /// Gets the name.
+ /// </summary>
+ /// <value>The name.</value>
+ string Name { get; }
+
+ /// <summary>
/// Mounts the specified iso path.
/// </summary>
/// <param name="isoPath">The iso path.</param>
@@ -25,11 +31,5 @@ namespace MediaBrowser.Model.IO
/// <param name="path">The path.</param>
/// <returns><c>true</c> if this instance can mount the specified path; otherwise, <c>false</c>.</returns>
bool CanMount(string path);
-
- /// <summary>
- /// Gets the name.
- /// </summary>
- /// <value>The name.</value>
- string Name { get; }
}
}
diff --git a/MediaBrowser.Model/IO/IStreamHelper.cs b/MediaBrowser.Model/IO/IStreamHelper.cs
index e348cd725..af5ba5b17 100644
--- a/MediaBrowser.Model/IO/IStreamHelper.cs
+++ b/MediaBrowser.Model/IO/IStreamHelper.cs
@@ -14,6 +14,7 @@ namespace MediaBrowser.Model.IO
Task CopyToAsync(Stream source, Stream destination, int bufferSize, int emptyReadLimit, CancellationToken cancellationToken);
Task<int> CopyToAsync(Stream source, Stream destination, CancellationToken cancellationToken);
+
Task CopyToAsync(Stream source, Stream destination, long copyLength, CancellationToken cancellationToken);
Task CopyUntilCancelled(Stream source, Stream target, int bufferSize, CancellationToken cancellationToken);
diff --git a/MediaBrowser.Model/Library/UserViewQuery.cs b/MediaBrowser.Model/Library/UserViewQuery.cs
index a538efd25..8a49b6863 100644
--- a/MediaBrowser.Model/Library/UserViewQuery.cs
+++ b/MediaBrowser.Model/Library/UserViewQuery.cs
@@ -6,6 +6,12 @@ namespace MediaBrowser.Model.Library
{
public class UserViewQuery
{
+ public UserViewQuery()
+ {
+ IncludeExternalContent = true;
+ PresetViews = Array.Empty<string>();
+ }
+
/// <summary>
/// Gets or sets the user identifier.
/// </summary>
@@ -25,11 +31,5 @@ namespace MediaBrowser.Model.Library
public bool IncludeHidden { get; set; }
public string[] PresetViews { get; set; }
-
- public UserViewQuery()
- {
- IncludeExternalContent = true;
- PresetViews = Array.Empty<string>();
- }
}
}
diff --git a/MediaBrowser.Model/LiveTv/BaseTimerInfoDto.cs b/MediaBrowser.Model/LiveTv/BaseTimerInfoDto.cs
index 064ce6520..45970cf6b 100644
--- a/MediaBrowser.Model/LiveTv/BaseTimerInfoDto.cs
+++ b/MediaBrowser.Model/LiveTv/BaseTimerInfoDto.cs
@@ -1,3 +1,4 @@
+#nullable disable
#pragma warning disable CS1591
using System;
diff --git a/MediaBrowser.Model/LiveTv/GuideInfo.cs b/MediaBrowser.Model/LiveTv/GuideInfo.cs
index a224d73b7..b1cc8cfdf 100644
--- a/MediaBrowser.Model/LiveTv/GuideInfo.cs
+++ b/MediaBrowser.Model/LiveTv/GuideInfo.cs
@@ -1,3 +1,4 @@
+#nullable disable
#pragma warning disable CS1591
using System;
diff --git a/MediaBrowser.Model/LiveTv/LiveTvChannelQuery.cs b/MediaBrowser.Model/LiveTv/LiveTvChannelQuery.cs
index 8154fbd0e..d1a94d8b3 100644
--- a/MediaBrowser.Model/LiveTv/LiveTvChannelQuery.cs
+++ b/MediaBrowser.Model/LiveTv/LiveTvChannelQuery.cs
@@ -1,3 +1,4 @@
+#nullable disable
#pragma warning disable CS1591
using System;
diff --git a/MediaBrowser.Model/LiveTv/LiveTvInfo.cs b/MediaBrowser.Model/LiveTv/LiveTvInfo.cs
index 85b77af24..9767509d0 100644
--- a/MediaBrowser.Model/LiveTv/LiveTvInfo.cs
+++ b/MediaBrowser.Model/LiveTv/LiveTvInfo.cs
@@ -6,6 +6,12 @@ namespace MediaBrowser.Model.LiveTv
{
public class LiveTvInfo
{
+ public LiveTvInfo()
+ {
+ Services = Array.Empty<LiveTvServiceInfo>();
+ EnabledUsers = Array.Empty<string>();
+ }
+
/// <summary>
/// Gets or sets the services.
/// </summary>
@@ -23,11 +29,5 @@ namespace MediaBrowser.Model.LiveTv
/// </summary>
/// <value>The enabled users.</value>
public string[] EnabledUsers { get; set; }
-
- public LiveTvInfo()
- {
- Services = Array.Empty<LiveTvServiceInfo>();
- EnabledUsers = Array.Empty<string>();
- }
}
}
diff --git a/MediaBrowser.Model/LiveTv/LiveTvOptions.cs b/MediaBrowser.Model/LiveTv/LiveTvOptions.cs
index dc8e0f91b..69c43efd4 100644
--- a/MediaBrowser.Model/LiveTv/LiveTvOptions.cs
+++ b/MediaBrowser.Model/LiveTv/LiveTvOptions.cs
@@ -1,3 +1,4 @@
+#nullable disable
#pragma warning disable CS1591
using System;
diff --git a/MediaBrowser.Model/LiveTv/LiveTvServiceInfo.cs b/MediaBrowser.Model/LiveTv/LiveTvServiceInfo.cs
index 09e900643..856f638c5 100644
--- a/MediaBrowser.Model/LiveTv/LiveTvServiceInfo.cs
+++ b/MediaBrowser.Model/LiveTv/LiveTvServiceInfo.cs
@@ -1,3 +1,4 @@
+#nullable disable
#pragma warning disable CS1591
using System;
diff --git a/MediaBrowser.Model/LiveTv/RecordingQuery.cs b/MediaBrowser.Model/LiveTv/RecordingQuery.cs
index c75092b79..264982930 100644
--- a/MediaBrowser.Model/LiveTv/RecordingQuery.cs
+++ b/MediaBrowser.Model/LiveTv/RecordingQuery.cs
@@ -1,3 +1,4 @@
+#nullable disable
#pragma warning disable CS1591
using System;
diff --git a/MediaBrowser.Model/LiveTv/SeriesTimerInfoDto.cs b/MediaBrowser.Model/LiveTv/SeriesTimerInfoDto.cs
index 29f417489..90422d19c 100644
--- a/MediaBrowser.Model/LiveTv/SeriesTimerInfoDto.cs
+++ b/MediaBrowser.Model/LiveTv/SeriesTimerInfoDto.cs
@@ -1,3 +1,4 @@
+#nullable disable
#pragma warning disable CS1591
using System;
diff --git a/MediaBrowser.Model/LiveTv/SeriesTimerQuery.cs b/MediaBrowser.Model/LiveTv/SeriesTimerQuery.cs
index bb553a576..bda46dd2b 100644
--- a/MediaBrowser.Model/LiveTv/SeriesTimerQuery.cs
+++ b/MediaBrowser.Model/LiveTv/SeriesTimerQuery.cs
@@ -10,7 +10,7 @@ namespace MediaBrowser.Model.LiveTv
/// Gets or sets the sort by - SortName, Priority
/// </summary>
/// <value>The sort by.</value>
- public string SortBy { get; set; }
+ public string? SortBy { get; set; }
/// <summary>
/// Gets or sets the sort order.
diff --git a/MediaBrowser.Model/LiveTv/TimerInfoDto.cs b/MediaBrowser.Model/LiveTv/TimerInfoDto.cs
index a1fbc5177..19039d448 100644
--- a/MediaBrowser.Model/LiveTv/TimerInfoDto.cs
+++ b/MediaBrowser.Model/LiveTv/TimerInfoDto.cs
@@ -1,3 +1,4 @@
+#nullable disable
#pragma warning disable CS1591
using MediaBrowser.Model.Dto;
diff --git a/MediaBrowser.Model/LiveTv/TimerQuery.cs b/MediaBrowser.Model/LiveTv/TimerQuery.cs
index 1ef6dd67e..367c45b9d 100644
--- a/MediaBrowser.Model/LiveTv/TimerQuery.cs
+++ b/MediaBrowser.Model/LiveTv/TimerQuery.cs
@@ -1,3 +1,4 @@
+#nullable disable
#pragma warning disable CS1591
namespace MediaBrowser.Model.LiveTv
diff --git a/MediaBrowser.Model/MediaBrowser.Model.csproj b/MediaBrowser.Model/MediaBrowser.Model.csproj
index 461f59672..70b5cf3b7 100644
--- a/MediaBrowser.Model/MediaBrowser.Model.csproj
+++ b/MediaBrowser.Model/MediaBrowser.Model.csproj
@@ -17,6 +17,8 @@
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<TreatWarningsAsErrors Condition=" '$(Configuration)' == 'Release' ">true</TreatWarningsAsErrors>
+ <Nullable>enable</Nullable>
+ <LangVersion>latest</LangVersion>
</PropertyGroup>
<ItemGroup>
diff --git a/MediaBrowser.Model/MediaInfo/AudioCodec.cs b/MediaBrowser.Model/MediaInfo/AudioCodec.cs
index dcb6fa270..8b17757b8 100644
--- a/MediaBrowser.Model/MediaInfo/AudioCodec.cs
+++ b/MediaBrowser.Model/MediaInfo/AudioCodec.cs
@@ -10,9 +10,9 @@ namespace MediaBrowser.Model.MediaInfo
public static string GetFriendlyName(string codec)
{
- if (string.IsNullOrEmpty(codec))
+ if (codec.Length == 0)
{
- return string.Empty;
+ return codec;
}
switch (codec.ToLowerInvariant())
diff --git a/MediaBrowser.Model/MediaInfo/BlurayDiscInfo.cs b/MediaBrowser.Model/MediaInfo/BlurayDiscInfo.cs
index 29ba10dbb..83f982a5c 100644
--- a/MediaBrowser.Model/MediaInfo/BlurayDiscInfo.cs
+++ b/MediaBrowser.Model/MediaInfo/BlurayDiscInfo.cs
@@ -1,3 +1,4 @@
+#nullable disable
#pragma warning disable CS1591
using MediaBrowser.Model.Entities;
diff --git a/MediaBrowser.Model/MediaInfo/LiveStreamRequest.cs b/MediaBrowser.Model/MediaInfo/LiveStreamRequest.cs
index 52348f802..cce508809 100644
--- a/MediaBrowser.Model/MediaInfo/LiveStreamRequest.cs
+++ b/MediaBrowser.Model/MediaInfo/LiveStreamRequest.cs
@@ -1,3 +1,4 @@
+#nullable disable
#pragma warning disable CS1591
using System;
@@ -7,21 +8,6 @@ namespace MediaBrowser.Model.MediaInfo
{
public class LiveStreamRequest
{
- public string OpenToken { get; set; }
- public Guid UserId { get; set; }
- public string PlaySessionId { get; set; }
- public long? MaxStreamingBitrate { get; set; }
- public long? StartTimeTicks { get; set; }
- public int? AudioStreamIndex { get; set; }
- public int? SubtitleStreamIndex { get; set; }
- public int? MaxAudioChannels { get; set; }
- public Guid ItemId { get; set; }
- public DeviceProfile DeviceProfile { get; set; }
-
- public bool EnableDirectPlay { get; set; }
- public bool EnableDirectStream { get; set; }
- public MediaProtocol[] DirectPlayProtocols { get; set; }
-
public LiveStreamRequest()
{
EnableDirectPlay = true;
@@ -38,12 +24,26 @@ namespace MediaBrowser.Model.MediaInfo
DirectPlayProtocols = new MediaProtocol[] { MediaProtocol.Http };
- var videoOptions = options as VideoOptions;
- if (videoOptions != null)
+ if (options is VideoOptions videoOptions)
{
AudioStreamIndex = videoOptions.AudioStreamIndex;
SubtitleStreamIndex = videoOptions.SubtitleStreamIndex;
}
}
+
+ public string OpenToken { get; set; }
+ public Guid UserId { get; set; }
+ public string PlaySessionId { get; set; }
+ public long? MaxStreamingBitrate { get; set; }
+ public long? StartTimeTicks { get; set; }
+ public int? AudioStreamIndex { get; set; }
+ public int? SubtitleStreamIndex { get; set; }
+ public int? MaxAudioChannels { get; set; }
+ public Guid ItemId { get; set; }
+ public DeviceProfile DeviceProfile { get; set; }
+
+ public bool EnableDirectPlay { get; set; }
+ public bool EnableDirectStream { get; set; }
+ public MediaProtocol[] DirectPlayProtocols { get; set; }
}
}
diff --git a/MediaBrowser.Model/MediaInfo/LiveStreamResponse.cs b/MediaBrowser.Model/MediaInfo/LiveStreamResponse.cs
index 45b8fcce9..f017c1a11 100644
--- a/MediaBrowser.Model/MediaInfo/LiveStreamResponse.cs
+++ b/MediaBrowser.Model/MediaInfo/LiveStreamResponse.cs
@@ -6,6 +6,11 @@ namespace MediaBrowser.Model.MediaInfo
{
public class LiveStreamResponse
{
- public MediaSourceInfo MediaSource { get; set; }
+ public LiveStreamResponse(MediaSourceInfo mediaSource)
+ {
+ MediaSource = mediaSource;
+ }
+
+ public MediaSourceInfo MediaSource { get; }
}
}
diff --git a/MediaBrowser.Model/MediaInfo/MediaInfo.cs b/MediaBrowser.Model/MediaInfo/MediaInfo.cs
index ad174f15d..97b979935 100644
--- a/MediaBrowser.Model/MediaInfo/MediaInfo.cs
+++ b/MediaBrowser.Model/MediaInfo/MediaInfo.cs
@@ -1,3 +1,4 @@
+#nullable disable
#pragma warning disable CS1591
using System;
diff --git a/MediaBrowser.Model/MediaInfo/PlaybackInfoRequest.cs b/MediaBrowser.Model/MediaInfo/PlaybackInfoRequest.cs
index a2f163422..82e13e0eb 100644
--- a/MediaBrowser.Model/MediaInfo/PlaybackInfoRequest.cs
+++ b/MediaBrowser.Model/MediaInfo/PlaybackInfoRequest.cs
@@ -1,3 +1,4 @@
+#nullable disable
#pragma warning disable CS1591
using System;
diff --git a/MediaBrowser.Model/MediaInfo/PlaybackInfoResponse.cs b/MediaBrowser.Model/MediaInfo/PlaybackInfoResponse.cs
index 440818c3e..273350182 100644
--- a/MediaBrowser.Model/MediaInfo/PlaybackInfoResponse.cs
+++ b/MediaBrowser.Model/MediaInfo/PlaybackInfoResponse.cs
@@ -20,7 +20,7 @@ namespace MediaBrowser.Model.MediaInfo
/// Gets or sets the play session identifier.
/// </summary>
/// <value>The play session identifier.</value>
- public string PlaySessionId { get; set; }
+ public string? PlaySessionId { get; set; }
/// <summary>
/// Gets or sets the error code.
diff --git a/MediaBrowser.Model/MediaInfo/SubtitleTrackEvent.cs b/MediaBrowser.Model/MediaInfo/SubtitleTrackEvent.cs
index 5b0ccb28a..72bb3d9c6 100644
--- a/MediaBrowser.Model/MediaInfo/SubtitleTrackEvent.cs
+++ b/MediaBrowser.Model/MediaInfo/SubtitleTrackEvent.cs
@@ -1,3 +1,4 @@
+#nullable disable
#pragma warning disable CS1591
namespace MediaBrowser.Model.MediaInfo
@@ -5,8 +6,11 @@ namespace MediaBrowser.Model.MediaInfo
public class SubtitleTrackEvent
{
public string Id { get; set; }
+
public string Text { get; set; }
+
public long StartPositionTicks { get; set; }
+
public long EndPositionTicks { get; set; }
}
}
diff --git a/MediaBrowser.Model/Net/EndPointInfo.cs b/MediaBrowser.Model/Net/EndPointInfo.cs
index f5ac3d169..034734a9e 100644
--- a/MediaBrowser.Model/Net/EndPointInfo.cs
+++ b/MediaBrowser.Model/Net/EndPointInfo.cs
@@ -5,6 +5,7 @@ namespace MediaBrowser.Model.Net
public class EndPointInfo
{
public bool IsLocal { get; set; }
+
public bool IsInNetwork { get; set; }
}
}
diff --git a/MediaBrowser.Model/Net/ISocket.cs b/MediaBrowser.Model/Net/ISocket.cs
index 2bfbfcb20..5b6ed92df 100644
--- a/MediaBrowser.Model/Net/ISocket.cs
+++ b/MediaBrowser.Model/Net/ISocket.cs
@@ -17,6 +17,7 @@ namespace MediaBrowser.Model.Net
Task<SocketReceiveResult> ReceiveAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken);
IAsyncResult BeginReceive(byte[] buffer, int offset, int count, AsyncCallback callback);
+
SocketReceiveResult EndReceive(IAsyncResult result);
/// <summary>
diff --git a/MediaBrowser.Model/Net/MimeTypes.cs b/MediaBrowser.Model/Net/MimeTypes.cs
index b6d7b4245..771ca84f7 100644
--- a/MediaBrowser.Model/Net/MimeTypes.cs
+++ b/MediaBrowser.Model/Net/MimeTypes.cs
@@ -8,12 +8,12 @@ using System.Linq;
namespace MediaBrowser.Model.Net
{
/// <summary>
- /// Class MimeTypes
+ /// Class MimeTypes.
/// </summary>
public static class MimeTypes
{
/// <summary>
- /// Any extension in this list is considered a video file
+ /// Any extension in this list is considered a video file.
/// </summary>
private static readonly HashSet<string> _videoFileExtensions = new HashSet<string>(StringComparer.OrdinalIgnoreCase)
{
@@ -163,16 +163,16 @@ namespace MediaBrowser.Model.Net
return dict;
}
- public static string GetMimeType(string path) => GetMimeType(path, true);
+ public static string? GetMimeType(string path) => GetMimeType(path, true);
/// <summary>
/// Gets the type of the MIME.
/// </summary>
- public static string GetMimeType(string path, bool enableStreamDefault)
+ public static string? GetMimeType(string path, bool enableStreamDefault)
{
- if (string.IsNullOrEmpty(path))
+ if (path.Length == 0)
{
- throw new ArgumentNullException(nameof(path));
+ throw new ArgumentException("String can't be empty.", nameof(path));
}
var ext = Path.GetExtension(path);
@@ -210,11 +210,11 @@ namespace MediaBrowser.Model.Net
return enableStreamDefault ? "application/octet-stream" : null;
}
- public static string ToExtension(string mimeType)
+ public static string? ToExtension(string mimeType)
{
- if (string.IsNullOrEmpty(mimeType))
+ if (mimeType.Length == 0)
{
- throw new ArgumentNullException(nameof(mimeType));
+ throw new ArgumentException("String can't be empty.", nameof(mimeType));
}
// handle text/html; charset=UTF-8
diff --git a/MediaBrowser.Model/Net/NetworkShare.cs b/MediaBrowser.Model/Net/NetworkShare.cs
index 744c6ec14..a40cf73e4 100644
--- a/MediaBrowser.Model/Net/NetworkShare.cs
+++ b/MediaBrowser.Model/Net/NetworkShare.cs
@@ -1,3 +1,4 @@
+#nullable disable
#pragma warning disable CS1591
namespace MediaBrowser.Model.Net
diff --git a/MediaBrowser.Model/Net/SocketReceiveResult.cs b/MediaBrowser.Model/Net/SocketReceiveResult.cs
index 141ae1608..54139fe9c 100644
--- a/MediaBrowser.Model/Net/SocketReceiveResult.cs
+++ b/MediaBrowser.Model/Net/SocketReceiveResult.cs
@@ -1,4 +1,4 @@
-#pragma warning disable CS1591
+#nullable disable
using System.Net;
@@ -10,12 +10,12 @@ namespace MediaBrowser.Model.Net
public sealed class SocketReceiveResult
{
/// <summary>
- /// The buffer to place received data into.
+ /// Gets or sets the buffer to place received data into.
/// </summary>
public byte[] Buffer { get; set; }
/// <summary>
- /// The number of bytes received.
+ /// Gets or sets the number of bytes received.
/// </summary>
public int ReceivedBytes { get; set; }
@@ -23,6 +23,10 @@ namespace MediaBrowser.Model.Net
/// The <see cref="IPEndPoint"/> the data was received from.
/// </summary>
public IPEndPoint RemoteEndPoint { get; set; }
+
+ /// <summary>
+ /// The local <see cref="IPAddress"/>.
+ /// </summary>
public IPAddress LocalIPAddress { get; set; }
}
}
diff --git a/MediaBrowser.Model/Net/WebSocketMessage.cs b/MediaBrowser.Model/Net/WebSocketMessage.cs
index 03f03e4cc..660eebeda 100644
--- a/MediaBrowser.Model/Net/WebSocketMessage.cs
+++ b/MediaBrowser.Model/Net/WebSocketMessage.cs
@@ -1,4 +1,4 @@
-
+#nullable disable
#pragma warning disable CS1591
using System;
diff --git a/MediaBrowser.Model/Notifications/NotificationOption.cs b/MediaBrowser.Model/Notifications/NotificationOption.cs
index 4fb724515..144949a3b 100644
--- a/MediaBrowser.Model/Notifications/NotificationOption.cs
+++ b/MediaBrowser.Model/Notifications/NotificationOption.cs
@@ -6,6 +6,15 @@ namespace MediaBrowser.Model.Notifications
{
public class NotificationOption
{
+ public NotificationOption(string type)
+ {
+ Type = type;
+
+ DisabledServices = Array.Empty<string>();
+ DisabledMonitorUsers = Array.Empty<string>();
+ SendToUsers = Array.Empty<string>();
+ }
+
public string Type { get; set; }
/// <summary>
@@ -35,12 +44,5 @@ namespace MediaBrowser.Model.Notifications
/// </summary>
/// <value>The send to user mode.</value>
public SendToUserType SendToUserMode { get; set; }
-
- public NotificationOption()
- {
- DisabledServices = Array.Empty<string>();
- DisabledMonitorUsers = Array.Empty<string>();
- SendToUsers = Array.Empty<string>();
- }
}
}
diff --git a/MediaBrowser.Model/Notifications/NotificationOptions.cs b/MediaBrowser.Model/Notifications/NotificationOptions.cs
index 0d6b0a645..239a3777e 100644
--- a/MediaBrowser.Model/Notifications/NotificationOptions.cs
+++ b/MediaBrowser.Model/Notifications/NotificationOptions.cs
@@ -1,3 +1,4 @@
+#nullable disable
#pragma warning disable CS1591
using System;
@@ -17,63 +18,53 @@ namespace MediaBrowser.Model.Notifications
{
Options = new[]
{
- new NotificationOption
+ new NotificationOption(NotificationType.TaskFailed.ToString())
{
- Type = NotificationType.TaskFailed.ToString(),
Enabled = true,
SendToUserMode = SendToUserType.Admins
},
- new NotificationOption
+ new NotificationOption(NotificationType.ServerRestartRequired.ToString())
{
- Type = NotificationType.ServerRestartRequired.ToString(),
Enabled = true,
SendToUserMode = SendToUserType.Admins
},
- new NotificationOption
+ new NotificationOption(NotificationType.ApplicationUpdateAvailable.ToString())
{
- Type = NotificationType.ApplicationUpdateAvailable.ToString(),
Enabled = true,
SendToUserMode = SendToUserType.Admins
},
- new NotificationOption
+ new NotificationOption(NotificationType.ApplicationUpdateInstalled.ToString())
{
- Type = NotificationType.ApplicationUpdateInstalled.ToString(),
Enabled = true,
SendToUserMode = SendToUserType.Admins
},
- new NotificationOption
+ new NotificationOption(NotificationType.PluginUpdateInstalled.ToString())
{
- Type = NotificationType.PluginUpdateInstalled.ToString(),
Enabled = true,
SendToUserMode = SendToUserType.Admins
},
- new NotificationOption
+ new NotificationOption(NotificationType.PluginUninstalled.ToString())
{
- Type = NotificationType.PluginUninstalled.ToString(),
Enabled = true,
SendToUserMode = SendToUserType.Admins
},
- new NotificationOption
+ new NotificationOption(NotificationType.InstallationFailed.ToString())
{
- Type = NotificationType.InstallationFailed.ToString(),
Enabled = true,
SendToUserMode = SendToUserType.Admins
},
- new NotificationOption
+ new NotificationOption(NotificationType.PluginInstalled.ToString())
{
- Type = NotificationType.PluginInstalled.ToString(),
Enabled = true,
SendToUserMode = SendToUserType.Admins
},
- new NotificationOption
+ new NotificationOption(NotificationType.PluginError.ToString())
{
- Type = NotificationType.PluginError.ToString(),
Enabled = true,
SendToUserMode = SendToUserType.Admins
},
- new NotificationOption
+ new NotificationOption(NotificationType.UserLockedOut.ToString())
{
- Type = NotificationType.UserLockedOut.ToString(),
Enabled = true,
SendToUserMode = SendToUserType.Admins
}
diff --git a/MediaBrowser.Model/Notifications/NotificationRequest.cs b/MediaBrowser.Model/Notifications/NotificationRequest.cs
index ffcfab24f..febc2bc09 100644
--- a/MediaBrowser.Model/Notifications/NotificationRequest.cs
+++ b/MediaBrowser.Model/Notifications/NotificationRequest.cs
@@ -1,3 +1,4 @@
+#nullable disable
#pragma warning disable CS1591
using System;
diff --git a/MediaBrowser.Model/Notifications/NotificationTypeInfo.cs b/MediaBrowser.Model/Notifications/NotificationTypeInfo.cs
index bfa163b40..402fbe81a 100644
--- a/MediaBrowser.Model/Notifications/NotificationTypeInfo.cs
+++ b/MediaBrowser.Model/Notifications/NotificationTypeInfo.cs
@@ -1,3 +1,4 @@
+#nullable disable
#pragma warning disable CS1591
namespace MediaBrowser.Model.Notifications
diff --git a/MediaBrowser.Model/Playlists/PlaylistCreationRequest.cs b/MediaBrowser.Model/Playlists/PlaylistCreationRequest.cs
index b7003c4c8..ef435b21e 100644
--- a/MediaBrowser.Model/Playlists/PlaylistCreationRequest.cs
+++ b/MediaBrowser.Model/Playlists/PlaylistCreationRequest.cs
@@ -1,3 +1,4 @@
+#nullable disable
#pragma warning disable CS1591
using System;
diff --git a/MediaBrowser.Model/Playlists/PlaylistCreationResult.cs b/MediaBrowser.Model/Playlists/PlaylistCreationResult.cs
index 4f2067b98..f3a1518ed 100644
--- a/MediaBrowser.Model/Playlists/PlaylistCreationResult.cs
+++ b/MediaBrowser.Model/Playlists/PlaylistCreationResult.cs
@@ -4,6 +4,11 @@ namespace MediaBrowser.Model.Playlists
{
public class PlaylistCreationResult
{
- public string Id { get; set; }
+ public PlaylistCreationResult(string id)
+ {
+ Id = id;
+ }
+
+ public string Id { get; }
}
}
diff --git a/MediaBrowser.Model/Playlists/PlaylistItemQuery.cs b/MediaBrowser.Model/Playlists/PlaylistItemQuery.cs
deleted file mode 100644
index 324a38e70..000000000
--- a/MediaBrowser.Model/Playlists/PlaylistItemQuery.cs
+++ /dev/null
@@ -1,39 +0,0 @@
-#pragma warning disable CS1591
-
-using MediaBrowser.Model.Querying;
-
-namespace MediaBrowser.Model.Playlists
-{
- public class PlaylistItemQuery
- {
- /// <summary>
- /// Gets or sets the identifier.
- /// </summary>
- /// <value>The identifier.</value>
- public string Id { get; set; }
-
- /// <summary>
- /// Gets or sets the user identifier.
- /// </summary>
- /// <value>The user identifier.</value>
- public string UserId { get; set; }
-
- /// <summary>
- /// Gets or sets the start index.
- /// </summary>
- /// <value>The start index.</value>
- public int? StartIndex { get; set; }
-
- /// <summary>
- /// Gets or sets the limit.
- /// </summary>
- /// <value>The limit.</value>
- public int? Limit { get; set; }
-
- /// <summary>
- /// Gets or sets the fields.
- /// </summary>
- /// <value>The fields.</value>
- public ItemFields[] Fields { get; set; }
- }
-}
diff --git a/MediaBrowser.Model/Plugins/PluginInfo.cs b/MediaBrowser.Model/Plugins/PluginInfo.cs
index 9ff9ea457..c13f1a89f 100644
--- a/MediaBrowser.Model/Plugins/PluginInfo.cs
+++ b/MediaBrowser.Model/Plugins/PluginInfo.cs
@@ -1,3 +1,4 @@
+#nullable disable
namespace MediaBrowser.Model.Plugins
{
/// <summary>
diff --git a/MediaBrowser.Model/Plugins/PluginPageInfo.cs b/MediaBrowser.Model/Plugins/PluginPageInfo.cs
index eb6a1527d..ca72e19ee 100644
--- a/MediaBrowser.Model/Plugins/PluginPageInfo.cs
+++ b/MediaBrowser.Model/Plugins/PluginPageInfo.cs
@@ -1,3 +1,4 @@
+#nullable disable
#pragma warning disable CS1591
namespace MediaBrowser.Model.Plugins
diff --git a/MediaBrowser.Model/Providers/ExternalIdInfo.cs b/MediaBrowser.Model/Providers/ExternalIdInfo.cs
index 2b481ad7e..f2e6d8ef3 100644
--- a/MediaBrowser.Model/Providers/ExternalIdInfo.cs
+++ b/MediaBrowser.Model/Providers/ExternalIdInfo.cs
@@ -1,3 +1,4 @@
+#nullable disable
#pragma warning disable CS1591
namespace MediaBrowser.Model.Providers
diff --git a/MediaBrowser.Model/Providers/ExternalUrl.cs b/MediaBrowser.Model/Providers/ExternalUrl.cs
index d4f4fa840..9467a2b00 100644
--- a/MediaBrowser.Model/Providers/ExternalUrl.cs
+++ b/MediaBrowser.Model/Providers/ExternalUrl.cs
@@ -1,3 +1,4 @@
+#nullable disable
#pragma warning disable CS1591
namespace MediaBrowser.Model.Providers
diff --git a/MediaBrowser.Model/Providers/ImageProviderInfo.cs b/MediaBrowser.Model/Providers/ImageProviderInfo.cs
index a22ec3c07..19af81c85 100644
--- a/MediaBrowser.Model/Providers/ImageProviderInfo.cs
+++ b/MediaBrowser.Model/Providers/ImageProviderInfo.cs
@@ -1,6 +1,3 @@
-#pragma warning disable CS1591
-
-using System;
using MediaBrowser.Model.Entities;
namespace MediaBrowser.Model.Providers
@@ -11,16 +8,25 @@ namespace MediaBrowser.Model.Providers
public class ImageProviderInfo
{
/// <summary>
- /// Gets or sets the name.
+ /// Initializes a new instance of the <see cref="ImageProviderInfo" /> class.
/// </summary>
- /// <value>The name.</value>
- public string Name { get; set; }
-
- public ImageType[] SupportedImages { get; set; }
-
- public ImageProviderInfo()
+ /// <param name="name">The name of the image provider.</param>
+ /// <param name="supportedImages">The image types supported by the image provider.</param>
+ public ImageProviderInfo(string name, ImageType[] supportedImages)
{
- SupportedImages = Array.Empty<ImageType>();
+ Name = name;
+ SupportedImages = supportedImages;
}
+
+ /// <summary>
+ /// Gets the name.
+ /// </summary>
+ /// <value>The name.</value>
+ public string Name { get; }
+
+ /// <summary>
+ /// Gets the supported image types.
+ /// </summary>
+ public ImageType[] SupportedImages { get; }
}
}
diff --git a/MediaBrowser.Model/Providers/RemoteImageInfo.cs b/MediaBrowser.Model/Providers/RemoteImageInfo.cs
index ee2b9d8fd..78ab6c706 100644
--- a/MediaBrowser.Model/Providers/RemoteImageInfo.cs
+++ b/MediaBrowser.Model/Providers/RemoteImageInfo.cs
@@ -1,3 +1,4 @@
+#nullable disable
using MediaBrowser.Model.Dto;
using MediaBrowser.Model.Entities;
diff --git a/MediaBrowser.Model/Providers/RemoteImageQuery.cs b/MediaBrowser.Model/Providers/RemoteImageQuery.cs
index 2873c1003..b7fad87ab 100644
--- a/MediaBrowser.Model/Providers/RemoteImageQuery.cs
+++ b/MediaBrowser.Model/Providers/RemoteImageQuery.cs
@@ -6,7 +6,12 @@ namespace MediaBrowser.Model.Providers
{
public class RemoteImageQuery
{
- public string ProviderName { get; set; }
+ public RemoteImageQuery(string providerName)
+ {
+ ProviderName = providerName;
+ }
+
+ public string ProviderName { get; }
public ImageType? ImageType { get; set; }
diff --git a/MediaBrowser.Model/Providers/RemoteImageResult.cs b/MediaBrowser.Model/Providers/RemoteImageResult.cs
index 5ca00f770..e6067ee6e 100644
--- a/MediaBrowser.Model/Providers/RemoteImageResult.cs
+++ b/MediaBrowser.Model/Providers/RemoteImageResult.cs
@@ -1,3 +1,4 @@
+#nullable disable
namespace MediaBrowser.Model.Providers
{
/// <summary>
diff --git a/MediaBrowser.Model/Providers/RemoteSearchResult.cs b/MediaBrowser.Model/Providers/RemoteSearchResult.cs
index 161e04821..c96eb0b59 100644
--- a/MediaBrowser.Model/Providers/RemoteSearchResult.cs
+++ b/MediaBrowser.Model/Providers/RemoteSearchResult.cs
@@ -1,3 +1,4 @@
+#nullable disable
#pragma warning disable CS1591
using System;
@@ -8,23 +9,34 @@ namespace MediaBrowser.Model.Providers
{
public class RemoteSearchResult : IHasProviderIds
{
+ public RemoteSearchResult()
+ {
+ ProviderIds = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
+ Artists = Array.Empty<RemoteSearchResult>();
+ }
+
/// <summary>
/// Gets or sets the name.
/// </summary>
/// <value>The name.</value>
public string Name { get; set; }
+
/// <summary>
/// Gets or sets the provider ids.
/// </summary>
/// <value>The provider ids.</value>
public Dictionary<string, string> ProviderIds { get; set; }
+
/// <summary>
/// Gets or sets the year.
/// </summary>
/// <value>The year.</value>
public int? ProductionYear { get; set; }
+
public int? IndexNumber { get; set; }
+
public int? IndexNumberEnd { get; set; }
+
public int? ParentIndexNumber { get; set; }
public DateTime? PremiereDate { get; set; }
@@ -32,15 +44,13 @@ namespace MediaBrowser.Model.Providers
public string ImageUrl { get; set; }
public string SearchProviderName { get; set; }
+
public string Overview { get; set; }
public RemoteSearchResult AlbumArtist { get; set; }
+
public RemoteSearchResult[] Artists { get; set; }
- public RemoteSearchResult()
- {
- ProviderIds = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
- Artists = new RemoteSearchResult[] { };
- }
+
}
}
diff --git a/MediaBrowser.Model/Providers/RemoteSubtitleInfo.cs b/MediaBrowser.Model/Providers/RemoteSubtitleInfo.cs
index 06f29df3f..d9f7a852c 100644
--- a/MediaBrowser.Model/Providers/RemoteSubtitleInfo.cs
+++ b/MediaBrowser.Model/Providers/RemoteSubtitleInfo.cs
@@ -1,3 +1,4 @@
+#nullable disable
#pragma warning disable CS1591
using System;
diff --git a/MediaBrowser.Model/Providers/SubtitleOptions.cs b/MediaBrowser.Model/Providers/SubtitleOptions.cs
index 9e6049246..c07379570 100644
--- a/MediaBrowser.Model/Providers/SubtitleOptions.cs
+++ b/MediaBrowser.Model/Providers/SubtitleOptions.cs
@@ -1,3 +1,4 @@
+#nullable disable
#pragma warning disable CS1591
using System;
diff --git a/MediaBrowser.Model/Providers/SubtitleProviderInfo.cs b/MediaBrowser.Model/Providers/SubtitleProviderInfo.cs
index fca93d176..ee25be4b6 100644
--- a/MediaBrowser.Model/Providers/SubtitleProviderInfo.cs
+++ b/MediaBrowser.Model/Providers/SubtitleProviderInfo.cs
@@ -1,3 +1,4 @@
+#nullable disable
#pragma warning disable CS1591
namespace MediaBrowser.Model.Providers
diff --git a/MediaBrowser.Model/Querying/AllThemeMediaResult.cs b/MediaBrowser.Model/Querying/AllThemeMediaResult.cs
index a264c6178..6b503ba6b 100644
--- a/MediaBrowser.Model/Querying/AllThemeMediaResult.cs
+++ b/MediaBrowser.Model/Querying/AllThemeMediaResult.cs
@@ -1,15 +1,10 @@
+#nullable disable
#pragma warning disable CS1591
namespace MediaBrowser.Model.Querying
{
public class AllThemeMediaResult
{
- public ThemeMediaResult ThemeVideosResult { get; set; }
-
- public ThemeMediaResult ThemeSongsResult { get; set; }
-
- public ThemeMediaResult SoundtrackSongsResult { get; set; }
-
public AllThemeMediaResult()
{
ThemeVideosResult = new ThemeMediaResult();
@@ -18,5 +13,11 @@ namespace MediaBrowser.Model.Querying
SoundtrackSongsResult = new ThemeMediaResult();
}
+
+ public ThemeMediaResult ThemeVideosResult { get; set; }
+
+ public ThemeMediaResult ThemeSongsResult { get; set; }
+
+ public ThemeMediaResult SoundtrackSongsResult { get; set; }
}
}
diff --git a/MediaBrowser.Model/Querying/EpisodeQuery.cs b/MediaBrowser.Model/Querying/EpisodeQuery.cs
index 6fb4df676..13b1a0dcb 100644
--- a/MediaBrowser.Model/Querying/EpisodeQuery.cs
+++ b/MediaBrowser.Model/Querying/EpisodeQuery.cs
@@ -1,3 +1,4 @@
+#nullable disable
#pragma warning disable CS1591
using System;
diff --git a/MediaBrowser.Model/Querying/ItemCountsQuery.cs b/MediaBrowser.Model/Querying/ItemCountsQuery.cs
deleted file mode 100644
index f113cf380..000000000
--- a/MediaBrowser.Model/Querying/ItemCountsQuery.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-namespace MediaBrowser.Model.Querying
-{
- /// <summary>
- /// Class ItemCountsQuery.
- /// </summary>
- public class ItemCountsQuery
- {
- /// <summary>
- /// Gets or sets the user id.
- /// </summary>
- /// <value>The user id.</value>
- public string UserId { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether this instance is favorite.
- /// </summary>
- /// <value><c>null</c> if [is favorite] contains no value, <c>true</c> if [is favorite]; otherwise, <c>false</c>.</value>
- public bool? IsFavorite { get; set; }
- }
-}
diff --git a/MediaBrowser.Model/Querying/ItemSortBy.cs b/MediaBrowser.Model/Querying/ItemSortBy.cs
index 15b60ad84..edf71c1a7 100644
--- a/MediaBrowser.Model/Querying/ItemSortBy.cs
+++ b/MediaBrowser.Model/Querying/ItemSortBy.cs
@@ -8,73 +8,99 @@ namespace MediaBrowser.Model.Querying
public static class ItemSortBy
{
public const string AiredEpisodeOrder = "AiredEpisodeOrder";
+
/// <summary>
- /// The album
+ /// The album.
/// </summary>
public const string Album = "Album";
+
/// <summary>
- /// The album artist
+ /// The album artist.
/// </summary>
public const string AlbumArtist = "AlbumArtist";
+
/// <summary>
- /// The artist
+ /// The artist.
/// </summary>
public const string Artist = "Artist";
+
/// <summary>
- /// The date created
+ /// The date created.
/// </summary>
public const string DateCreated = "DateCreated";
+
/// <summary>
- /// The official rating
+ /// The official rating.
/// </summary>
public const string OfficialRating = "OfficialRating";
+
/// <summary>
- /// The date played
+ /// The date played.
/// </summary>
public const string DatePlayed = "DatePlayed";
+
/// <summary>
- /// The premiere date
+ /// The premiere date.
/// </summary>
public const string PremiereDate = "PremiereDate";
+
public const string StartDate = "StartDate";
+
/// <summary>
- /// The sort name
+ /// The sort name.
/// </summary>
public const string SortName = "SortName";
+
public const string Name = "Name";
+
/// <summary>
- /// The random
+ /// The random.
/// </summary>
public const string Random = "Random";
+
/// <summary>
- /// The runtime
+ /// The runtime.
/// </summary>
public const string Runtime = "Runtime";
+
/// <summary>
- /// The community rating
+ /// The community rating.
/// </summary>
public const string CommunityRating = "CommunityRating";
+
/// <summary>
- /// The production year
+ /// The production year.
/// </summary>
public const string ProductionYear = "ProductionYear";
+
/// <summary>
- /// The play count
+ /// The play count.
/// </summary>
public const string PlayCount = "PlayCount";
+
/// <summary>
- /// The critic rating
+ /// The critic rating.
/// </summary>
public const string CriticRating = "CriticRating";
+
public const string IsFolder = "IsFolder";
+
public const string IsUnplayed = "IsUnplayed";
+
public const string IsPlayed = "IsPlayed";
+
public const string SeriesSortName = "SeriesSortName";
+
public const string VideoBitRate = "VideoBitRate";
+
public const string AirTime = "AirTime";
+
public const string Studio = "Studio";
+
public const string IsFavoriteOrLiked = "IsFavoriteOrLiked";
+
public const string DateLastContentAdded = "DateLastContentAdded";
+
public const string SeriesDatePlayed = "SeriesDatePlayed";
}
}
diff --git a/MediaBrowser.Model/Querying/LatestItemsQuery.cs b/MediaBrowser.Model/Querying/LatestItemsQuery.cs
index 84e29e76a..7954ef4b4 100644
--- a/MediaBrowser.Model/Querying/LatestItemsQuery.cs
+++ b/MediaBrowser.Model/Querying/LatestItemsQuery.cs
@@ -1,3 +1,4 @@
+#nullable disable
#pragma warning disable CS1591
using System;
@@ -7,8 +8,13 @@ namespace MediaBrowser.Model.Querying
{
public class LatestItemsQuery
{
+ public LatestItemsQuery()
+ {
+ EnableImageTypes = Array.Empty<ImageType>();
+ }
+
/// <summary>
- /// The user to localize search results for
+ /// The user to localize search results for.
/// </summary>
/// <value>The user id.</value>
public Guid UserId { get; set; }
@@ -26,13 +32,13 @@ namespace MediaBrowser.Model.Querying
public int? StartIndex { get; set; }
/// <summary>
- /// The maximum number of items to return
+ /// The maximum number of items to return.
/// </summary>
/// <value>The limit.</value>
public int? Limit { get; set; }
/// <summary>
- /// Fields to return within the items, in addition to basic information
+ /// Fields to return within the items, in addition to basic information.
/// </summary>
/// <value>The fields.</value>
public ItemFields[] Fields { get; set; }
@@ -54,25 +60,23 @@ namespace MediaBrowser.Model.Querying
/// </summary>
/// <value><c>true</c> if [group items]; otherwise, <c>false</c>.</value>
public bool GroupItems { get; set; }
+
/// <summary>
/// Gets or sets a value indicating whether [enable images].
/// </summary>
/// <value><c>null</c> if [enable images] contains no value, <c>true</c> if [enable images]; otherwise, <c>false</c>.</value>
public bool? EnableImages { get; set; }
+
/// <summary>
/// Gets or sets the image type limit.
/// </summary>
/// <value>The image type limit.</value>
public int? ImageTypeLimit { get; set; }
+
/// <summary>
/// Gets or sets the enable image types.
/// </summary>
/// <value>The enable image types.</value>
public ImageType[] EnableImageTypes { get; set; }
-
- public LatestItemsQuery()
- {
- EnableImageTypes = new ImageType[] { };
- }
}
}
diff --git a/MediaBrowser.Model/Querying/MovieRecommendationQuery.cs b/MediaBrowser.Model/Querying/MovieRecommendationQuery.cs
index 93de0a8cd..1c8875890 100644
--- a/MediaBrowser.Model/Querying/MovieRecommendationQuery.cs
+++ b/MediaBrowser.Model/Querying/MovieRecommendationQuery.cs
@@ -1,3 +1,4 @@
+#nullable disable
#pragma warning disable CS1591
using System;
diff --git a/MediaBrowser.Model/Querying/NextUpQuery.cs b/MediaBrowser.Model/Querying/NextUpQuery.cs
index 1543aea16..0df86cb22 100644
--- a/MediaBrowser.Model/Querying/NextUpQuery.cs
+++ b/MediaBrowser.Model/Querying/NextUpQuery.cs
@@ -1,3 +1,4 @@
+#nullable disable
#pragma warning disable CS1591
using System;
diff --git a/MediaBrowser.Model/Querying/QueryFilters.cs b/MediaBrowser.Model/Querying/QueryFilters.cs
index 8d879c174..e04208f76 100644
--- a/MediaBrowser.Model/Querying/QueryFilters.cs
+++ b/MediaBrowser.Model/Querying/QueryFilters.cs
@@ -1,3 +1,4 @@
+#nullable disable
#pragma warning disable CS1591
using System;
diff --git a/MediaBrowser.Model/Querying/QueryResult.cs b/MediaBrowser.Model/Querying/QueryResult.cs
index 266f1c7e6..42586243d 100644
--- a/MediaBrowser.Model/Querying/QueryResult.cs
+++ b/MediaBrowser.Model/Querying/QueryResult.cs
@@ -1,3 +1,4 @@
+#nullable disable
#pragma warning disable CS1591
using System;
diff --git a/MediaBrowser.Model/Querying/ThemeMediaResult.cs b/MediaBrowser.Model/Querying/ThemeMediaResult.cs
index bae954d78..5afedeeaf 100644
--- a/MediaBrowser.Model/Querying/ThemeMediaResult.cs
+++ b/MediaBrowser.Model/Querying/ThemeMediaResult.cs
@@ -4,7 +4,7 @@ using MediaBrowser.Model.Dto;
namespace MediaBrowser.Model.Querying
{
/// <summary>
- /// Class ThemeMediaResult
+ /// Class ThemeMediaResult.
/// </summary>
public class ThemeMediaResult : QueryResult<BaseItemDto>
{
diff --git a/MediaBrowser.Model/Querying/UpcomingEpisodesQuery.cs b/MediaBrowser.Model/Querying/UpcomingEpisodesQuery.cs
index 123d0fad2..ed1aa7ac6 100644
--- a/MediaBrowser.Model/Querying/UpcomingEpisodesQuery.cs
+++ b/MediaBrowser.Model/Querying/UpcomingEpisodesQuery.cs
@@ -1,3 +1,4 @@
+#nullable disable
#pragma warning disable CS1591
using MediaBrowser.Model.Entities;
diff --git a/MediaBrowser.Model/Search/SearchHint.cs b/MediaBrowser.Model/Search/SearchHint.cs
index 6e52314fa..c7a721df6 100644
--- a/MediaBrowser.Model/Search/SearchHint.cs
+++ b/MediaBrowser.Model/Search/SearchHint.cs
@@ -1,3 +1,4 @@
+#nullable disable
#pragma warning disable CS1591
using System;
diff --git a/MediaBrowser.Model/Search/SearchHintResult.cs b/MediaBrowser.Model/Search/SearchHintResult.cs
index 3c4fbec9e..92ba4139e 100644
--- a/MediaBrowser.Model/Search/SearchHintResult.cs
+++ b/MediaBrowser.Model/Search/SearchHintResult.cs
@@ -1,3 +1,4 @@
+#nullable disable
namespace MediaBrowser.Model.Search
{
/// <summary>
diff --git a/MediaBrowser.Model/Search/SearchQuery.cs b/MediaBrowser.Model/Search/SearchQuery.cs
index 8a018312e..4470f1ad9 100644
--- a/MediaBrowser.Model/Search/SearchQuery.cs
+++ b/MediaBrowser.Model/Search/SearchQuery.cs
@@ -1,3 +1,4 @@
+#nullable disable
#pragma warning disable CS1591
using System;
diff --git a/MediaBrowser.Model/Serialization/IJsonSerializer.cs b/MediaBrowser.Model/Serialization/IJsonSerializer.cs
index 6223bb559..09b6ff9b5 100644
--- a/MediaBrowser.Model/Serialization/IJsonSerializer.cs
+++ b/MediaBrowser.Model/Serialization/IJsonSerializer.cs
@@ -1,3 +1,4 @@
+#nullable disable
#pragma warning disable CS1591
using System;
diff --git a/MediaBrowser.Model/Serialization/IXmlSerializer.cs b/MediaBrowser.Model/Serialization/IXmlSerializer.cs
index 1edd98fad..16d126ac7 100644
--- a/MediaBrowser.Model/Serialization/IXmlSerializer.cs
+++ b/MediaBrowser.Model/Serialization/IXmlSerializer.cs
@@ -1,3 +1,4 @@
+#nullable disable
#pragma warning disable CS1591
using System;
diff --git a/MediaBrowser.Model/Services/ApiMemberAttribute.cs b/MediaBrowser.Model/Services/ApiMemberAttribute.cs
index 8e50836f4..7c23eee44 100644
--- a/MediaBrowser.Model/Services/ApiMemberAttribute.cs
+++ b/MediaBrowser.Model/Services/ApiMemberAttribute.cs
@@ -1,3 +1,4 @@
+#nullable disable
using System;
namespace MediaBrowser.Model.Services
diff --git a/MediaBrowser.Model/Services/IHasRequestFilter.cs b/MediaBrowser.Model/Services/IHasRequestFilter.cs
index 3e49e9872..b83d3b075 100644
--- a/MediaBrowser.Model/Services/IHasRequestFilter.cs
+++ b/MediaBrowser.Model/Services/IHasRequestFilter.cs
@@ -7,7 +7,7 @@ namespace MediaBrowser.Model.Services
public interface IHasRequestFilter
{
/// <summary>
- /// Order in which Request Filters are executed.
+ /// Gets the order in which Request Filters are executed.
/// &lt;0 Executed before global request filters.
/// &gt;0 Executed after global request filters.
/// </summary>
diff --git a/MediaBrowser.Model/Services/IHttpRequest.cs b/MediaBrowser.Model/Services/IHttpRequest.cs
index 4dccd2d68..3ea65195c 100644
--- a/MediaBrowser.Model/Services/IHttpRequest.cs
+++ b/MediaBrowser.Model/Services/IHttpRequest.cs
@@ -5,12 +5,12 @@ namespace MediaBrowser.Model.Services
public interface IHttpRequest : IRequest
{
/// <summary>
- /// The HTTP Verb
+ /// Gets the HTTP Verb.
/// </summary>
string HttpMethod { get; }
/// <summary>
- /// The value of the Accept HTTP Request Header
+ /// Gets the value of the Accept HTTP Request Header.
/// </summary>
string Accept { get; }
}
diff --git a/MediaBrowser.Model/Services/IHttpResult.cs b/MediaBrowser.Model/Services/IHttpResult.cs
index b153f15ec..abc581d8e 100644
--- a/MediaBrowser.Model/Services/IHttpResult.cs
+++ b/MediaBrowser.Model/Services/IHttpResult.cs
@@ -1,3 +1,4 @@
+#nullable disable
#pragma warning disable CS1591
using System.Net;
@@ -7,27 +8,27 @@ namespace MediaBrowser.Model.Services
public interface IHttpResult : IHasHeaders
{
/// <summary>
- /// The HTTP Response Status
+ /// The HTTP Response Status.
/// </summary>
int Status { get; set; }
/// <summary>
- /// The HTTP Response Status Code
+ /// The HTTP Response Status Code.
/// </summary>
HttpStatusCode StatusCode { get; set; }
/// <summary>
- /// The HTTP Response ContentType
+ /// The HTTP Response ContentType.
/// </summary>
string ContentType { get; set; }
/// <summary>
- /// Response DTO
+ /// Response DTO.
/// </summary>
object Response { get; set; }
/// <summary>
- /// Holds the request call context
+ /// Holds the request call context.
/// </summary>
IRequest RequestContext { get; set; }
}
diff --git a/MediaBrowser.Model/Services/IRequest.cs b/MediaBrowser.Model/Services/IRequest.cs
index 3f4edced6..f413f1e17 100644
--- a/MediaBrowser.Model/Services/IRequest.cs
+++ b/MediaBrowser.Model/Services/IRequest.cs
@@ -1,3 +1,4 @@
+#nullable disable
#pragma warning disable CS1591
using System;
diff --git a/MediaBrowser.Model/Services/QueryParamCollection.cs b/MediaBrowser.Model/Services/QueryParamCollection.cs
index 19e9e53e7..d07ff1548 100644
--- a/MediaBrowser.Model/Services/QueryParamCollection.cs
+++ b/MediaBrowser.Model/Services/QueryParamCollection.cs
@@ -1,3 +1,4 @@
+#nullable disable
#pragma warning disable CS1591
using System;
@@ -19,11 +20,6 @@ namespace MediaBrowser.Model.Services
return StringComparison.OrdinalIgnoreCase;
}
- private static StringComparer GetStringComparer()
- {
- return StringComparer.OrdinalIgnoreCase;
- }
-
/// <summary>
/// Adds a new query parameter.
/// </summary>
diff --git a/MediaBrowser.Model/Services/RouteAttribute.cs b/MediaBrowser.Model/Services/RouteAttribute.cs
index 197ba05e5..162576aa7 100644
--- a/MediaBrowser.Model/Services/RouteAttribute.cs
+++ b/MediaBrowser.Model/Services/RouteAttribute.cs
@@ -1,3 +1,4 @@
+#nullable disable
#pragma warning disable CS1591
using System;
diff --git a/MediaBrowser.Model/Session/BrowseRequest.cs b/MediaBrowser.Model/Session/BrowseRequest.cs
index f485d680e..1c997d584 100644
--- a/MediaBrowser.Model/Session/BrowseRequest.cs
+++ b/MediaBrowser.Model/Session/BrowseRequest.cs
@@ -1,3 +1,4 @@
+#nullable disable
namespace MediaBrowser.Model.Session
{
/// <summary>
diff --git a/MediaBrowser.Model/Session/ClientCapabilities.cs b/MediaBrowser.Model/Session/ClientCapabilities.cs
index 5da4998e8..51db66d21 100644
--- a/MediaBrowser.Model/Session/ClientCapabilities.cs
+++ b/MediaBrowser.Model/Session/ClientCapabilities.cs
@@ -1,3 +1,4 @@
+#nullable disable
#pragma warning disable CS1591
using System;
diff --git a/MediaBrowser.Model/Session/GeneralCommand.cs b/MediaBrowser.Model/Session/GeneralCommand.cs
index 980e1f88b..9794bd292 100644
--- a/MediaBrowser.Model/Session/GeneralCommand.cs
+++ b/MediaBrowser.Model/Session/GeneralCommand.cs
@@ -1,3 +1,4 @@
+#nullable disable
#pragma warning disable CS1591
using System;
diff --git a/MediaBrowser.Model/Session/MessageCommand.cs b/MediaBrowser.Model/Session/MessageCommand.cs
index 473a7bccc..09abfbb3f 100644
--- a/MediaBrowser.Model/Session/MessageCommand.cs
+++ b/MediaBrowser.Model/Session/MessageCommand.cs
@@ -1,3 +1,4 @@
+#nullable disable
#pragma warning disable CS1591
namespace MediaBrowser.Model.Session
diff --git a/MediaBrowser.Model/Session/PlayRequest.cs b/MediaBrowser.Model/Session/PlayRequest.cs
index bdb2b2439..62b68b49e 100644
--- a/MediaBrowser.Model/Session/PlayRequest.cs
+++ b/MediaBrowser.Model/Session/PlayRequest.cs
@@ -1,3 +1,4 @@
+#nullable disable
#pragma warning disable CS1591
using System;
diff --git a/MediaBrowser.Model/Session/PlaybackProgressInfo.cs b/MediaBrowser.Model/Session/PlaybackProgressInfo.cs
index 5687ba84b..6b4cfe4f0 100644
--- a/MediaBrowser.Model/Session/PlaybackProgressInfo.cs
+++ b/MediaBrowser.Model/Session/PlaybackProgressInfo.cs
@@ -1,3 +1,4 @@
+#nullable disable
#pragma warning disable CS1591
using System;
diff --git a/MediaBrowser.Model/Session/PlaybackStopInfo.cs b/MediaBrowser.Model/Session/PlaybackStopInfo.cs
index f8cfacc20..b0827ac99 100644
--- a/MediaBrowser.Model/Session/PlaybackStopInfo.cs
+++ b/MediaBrowser.Model/Session/PlaybackStopInfo.cs
@@ -1,3 +1,4 @@
+#nullable disable
#pragma warning disable CS1591
using System;
diff --git a/MediaBrowser.Model/Session/PlayerStateInfo.cs b/MediaBrowser.Model/Session/PlayerStateInfo.cs
index 0f9956873..0f10605ea 100644
--- a/MediaBrowser.Model/Session/PlayerStateInfo.cs
+++ b/MediaBrowser.Model/Session/PlayerStateInfo.cs
@@ -1,3 +1,4 @@
+#nullable disable
#pragma warning disable CS1591
namespace MediaBrowser.Model.Session
diff --git a/MediaBrowser.Model/Session/PlaystateRequest.cs b/MediaBrowser.Model/Session/PlaystateRequest.cs
index 493a8063a..ba2c024b7 100644
--- a/MediaBrowser.Model/Session/PlaystateRequest.cs
+++ b/MediaBrowser.Model/Session/PlaystateRequest.cs
@@ -12,6 +12,6 @@ namespace MediaBrowser.Model.Session
/// Gets or sets the controlling user identifier.
/// </summary>
/// <value>The controlling user identifier.</value>
- public string ControllingUserId { get; set; }
+ public string? ControllingUserId { get; set; }
}
}
diff --git a/MediaBrowser.Model/Session/SessionUserInfo.cs b/MediaBrowser.Model/Session/SessionUserInfo.cs
index 42a56b92b..4d6f35efc 100644
--- a/MediaBrowser.Model/Session/SessionUserInfo.cs
+++ b/MediaBrowser.Model/Session/SessionUserInfo.cs
@@ -1,3 +1,4 @@
+#nullable disable
using System;
namespace MediaBrowser.Model.Session
@@ -12,6 +13,7 @@ namespace MediaBrowser.Model.Session
/// </summary>
/// <value>The user identifier.</value>
public Guid UserId { get; set; }
+
/// <summary>
/// Gets or sets the name of the user.
/// </summary>
diff --git a/MediaBrowser.Model/Session/TranscodingInfo.cs b/MediaBrowser.Model/Session/TranscodingInfo.cs
index 8f4e688f0..d6dc83413 100644
--- a/MediaBrowser.Model/Session/TranscodingInfo.cs
+++ b/MediaBrowser.Model/Session/TranscodingInfo.cs
@@ -1,5 +1,8 @@
+#nullable disable
#pragma warning disable CS1591
+using System;
+
namespace MediaBrowser.Model.Session
{
public class TranscodingInfo
@@ -22,7 +25,7 @@ namespace MediaBrowser.Model.Session
public TranscodingInfo()
{
- TranscodeReasons = new TranscodeReason[] { };
+ TranscodeReasons = Array.Empty<TranscodeReason>();
}
}
diff --git a/MediaBrowser.Model/Session/UserDataChangeInfo.cs b/MediaBrowser.Model/Session/UserDataChangeInfo.cs
index 0872eb4b1..0fd24edcc 100644
--- a/MediaBrowser.Model/Session/UserDataChangeInfo.cs
+++ b/MediaBrowser.Model/Session/UserDataChangeInfo.cs
@@ -1,3 +1,4 @@
+#nullable disable
using MediaBrowser.Model.Dto;
namespace MediaBrowser.Model.Session
diff --git a/MediaBrowser.Model/Sync/SyncJob.cs b/MediaBrowser.Model/Sync/SyncJob.cs
index 30bf27f38..3cc9ff726 100644
--- a/MediaBrowser.Model/Sync/SyncJob.cs
+++ b/MediaBrowser.Model/Sync/SyncJob.cs
@@ -1,3 +1,4 @@
+#nullable disable
#pragma warning disable CS1591
using System;
diff --git a/MediaBrowser.Model/Sync/SyncTarget.cs b/MediaBrowser.Model/Sync/SyncTarget.cs
index 20a0c8cc7..9e6bbbc00 100644
--- a/MediaBrowser.Model/Sync/SyncTarget.cs
+++ b/MediaBrowser.Model/Sync/SyncTarget.cs
@@ -1,3 +1,4 @@
+#nullable disable
#pragma warning disable CS1591
namespace MediaBrowser.Model.Sync
diff --git a/MediaBrowser.Model/SyncPlay/GroupInfoView.cs b/MediaBrowser.Model/SyncPlay/GroupInfoView.cs
index f28ecf16d..f4c685998 100644
--- a/MediaBrowser.Model/SyncPlay/GroupInfoView.cs
+++ b/MediaBrowser.Model/SyncPlay/GroupInfoView.cs
@@ -1,3 +1,5 @@
+#nullable disable
+
using System.Collections.Generic;
namespace MediaBrowser.Model.SyncPlay
diff --git a/MediaBrowser.Model/SyncPlay/GroupUpdate.cs b/MediaBrowser.Model/SyncPlay/GroupUpdate.cs
index 895702f3d..8c7208211 100644
--- a/MediaBrowser.Model/SyncPlay/GroupUpdate.cs
+++ b/MediaBrowser.Model/SyncPlay/GroupUpdate.cs
@@ -1,3 +1,5 @@
+#nullable disable
+
namespace MediaBrowser.Model.SyncPlay
{
/// <summary>
diff --git a/MediaBrowser.Model/SyncPlay/SendCommand.cs b/MediaBrowser.Model/SyncPlay/SendCommand.cs
index 0f06e381f..0f0be0152 100644
--- a/MediaBrowser.Model/SyncPlay/SendCommand.cs
+++ b/MediaBrowser.Model/SyncPlay/SendCommand.cs
@@ -1,3 +1,5 @@
+#nullable disable
+
namespace MediaBrowser.Model.SyncPlay
{
/// <summary>
diff --git a/MediaBrowser.Model/SyncPlay/UtcTimeResponse.cs b/MediaBrowser.Model/SyncPlay/UtcTimeResponse.cs
index 0a6036154..8ec5eaab3 100644
--- a/MediaBrowser.Model/SyncPlay/UtcTimeResponse.cs
+++ b/MediaBrowser.Model/SyncPlay/UtcTimeResponse.cs
@@ -1,3 +1,5 @@
+#nullable disable
+
namespace MediaBrowser.Model.SyncPlay
{
/// <summary>
diff --git a/MediaBrowser.Model/System/LogFile.cs b/MediaBrowser.Model/System/LogFile.cs
index a2b701664..aec910c92 100644
--- a/MediaBrowser.Model/System/LogFile.cs
+++ b/MediaBrowser.Model/System/LogFile.cs
@@ -1,3 +1,4 @@
+#nullable disable
#pragma warning disable CS1591
using System;
diff --git a/MediaBrowser.Model/System/PublicSystemInfo.cs b/MediaBrowser.Model/System/PublicSystemInfo.cs
index 1775470b5..b6196a43f 100644
--- a/MediaBrowser.Model/System/PublicSystemInfo.cs
+++ b/MediaBrowser.Model/System/PublicSystemInfo.cs
@@ -1,3 +1,4 @@
+#nullable disable
#pragma warning disable CS1591
namespace MediaBrowser.Model.System
diff --git a/MediaBrowser.Model/System/SystemInfo.cs b/MediaBrowser.Model/System/SystemInfo.cs
index f2c5aa1e3..a67c38c3a 100644
--- a/MediaBrowser.Model/System/SystemInfo.cs
+++ b/MediaBrowser.Model/System/SystemInfo.cs
@@ -1,3 +1,4 @@
+#nullable disable
#pragma warning disable CS1591
using System;
@@ -32,7 +33,6 @@ namespace MediaBrowser.Model.System
/// <value>The display name of the operating system.</value>
public string OperatingSystemDisplayName { get; set; }
-
/// <summary>
/// Get or sets the package name.
/// </summary>
diff --git a/MediaBrowser.Model/System/WakeOnLanInfo.cs b/MediaBrowser.Model/System/WakeOnLanInfo.cs
index 534ad19ec..b2cbe737d 100644
--- a/MediaBrowser.Model/System/WakeOnLanInfo.cs
+++ b/MediaBrowser.Model/System/WakeOnLanInfo.cs
@@ -8,35 +8,20 @@ namespace MediaBrowser.Model.System
public class WakeOnLanInfo
{
/// <summary>
- /// Returns the MAC address of the device.
- /// </summary>
- /// <value>The MAC address.</value>
- public string MacAddress { get; set; }
-
- /// <summary>
- /// Returns the wake-on-LAN port.
- /// </summary>
- /// <value>The wake-on-LAN port.</value>
- public int Port { get; set; }
-
- /// <summary>
/// Initializes a new instance of the <see cref="WakeOnLanInfo" /> class.
/// </summary>
/// <param name="macAddress">The MAC address.</param>
- public WakeOnLanInfo(PhysicalAddress macAddress)
+ public WakeOnLanInfo(PhysicalAddress macAddress) : this(macAddress.ToString())
{
- MacAddress = macAddress.ToString();
- Port = 9;
}
/// <summary>
/// Initializes a new instance of the <see cref="WakeOnLanInfo" /> class.
/// </summary>
/// <param name="macAddress">The MAC address.</param>
- public WakeOnLanInfo(string macAddress)
+ public WakeOnLanInfo(string macAddress) : this()
{
MacAddress = macAddress;
- Port = 9;
}
/// <summary>
@@ -46,5 +31,17 @@ namespace MediaBrowser.Model.System
{
Port = 9;
}
+
+ /// <summary>
+ /// Gets the MAC address of the device.
+ /// </summary>
+ /// <value>The MAC address.</value>
+ public string? MacAddress { get; set; }
+
+ /// <summary>
+ /// Gets or sets the wake-on-LAN port.
+ /// </summary>
+ /// <value>The wake-on-LAN port.</value>
+ public int Port { get; set; }
}
}
diff --git a/MediaBrowser.Model/Tasks/IScheduledTask.cs b/MediaBrowser.Model/Tasks/IScheduledTask.cs
index ed160e176..bf87088e4 100644
--- a/MediaBrowser.Model/Tasks/IScheduledTask.cs
+++ b/MediaBrowser.Model/Tasks/IScheduledTask.cs
@@ -1,5 +1,3 @@
-#pragma warning disable CS1591
-
using System;
using System.Collections.Generic;
using System.Threading;
@@ -8,16 +6,19 @@ using System.Threading.Tasks;
namespace MediaBrowser.Model.Tasks
{
/// <summary>
- /// Interface IScheduledTaskWorker
+ /// Interface IScheduledTaskWorker.
/// </summary>
public interface IScheduledTask
{
/// <summary>
- /// Gets the name of the task
+ /// Gets the name of the task.
/// </summary>
/// <value>The name.</value>
string Name { get; }
+ /// <summary>
+ /// Gets the key of the task.
+ /// </summary>
string Key { get; }
/// <summary>
@@ -33,7 +34,7 @@ namespace MediaBrowser.Model.Tasks
string Category { get; }
/// <summary>
- /// Executes the task
+ /// Executes the task.
/// </summary>
/// <param name="cancellationToken">The cancellation token.</param>
/// <param name="progress">The progress.</param>
diff --git a/MediaBrowser.Model/Tasks/IScheduledTaskWorker.cs b/MediaBrowser.Model/Tasks/IScheduledTaskWorker.cs
index 4dd1bb5d0..c79d7fe75 100644
--- a/MediaBrowser.Model/Tasks/IScheduledTaskWorker.cs
+++ b/MediaBrowser.Model/Tasks/IScheduledTaskWorker.cs
@@ -1,3 +1,4 @@
+#nullable disable
using System;
using MediaBrowser.Model.Events;
diff --git a/MediaBrowser.Model/Tasks/ScheduledTaskHelpers.cs b/MediaBrowser.Model/Tasks/ScheduledTaskHelpers.cs
index ca0743cca..9063903ae 100644
--- a/MediaBrowser.Model/Tasks/ScheduledTaskHelpers.cs
+++ b/MediaBrowser.Model/Tasks/ScheduledTaskHelpers.cs
@@ -14,9 +14,7 @@ namespace MediaBrowser.Model.Tasks
{
var isHidden = false;
- var configurableTask = task.ScheduledTask as IConfigurableScheduledTask;
-
- if (configurableTask != null)
+ if (task.ScheduledTask is IConfigurableScheduledTask configurableTask)
{
isHidden = configurableTask.IsHidden;
}
diff --git a/MediaBrowser.Model/Tasks/TaskCompletionEventArgs.cs b/MediaBrowser.Model/Tasks/TaskCompletionEventArgs.cs
index cc6c2b62b..48950667e 100644
--- a/MediaBrowser.Model/Tasks/TaskCompletionEventArgs.cs
+++ b/MediaBrowser.Model/Tasks/TaskCompletionEventArgs.cs
@@ -6,8 +6,14 @@ namespace MediaBrowser.Model.Tasks
{
public class TaskCompletionEventArgs : EventArgs
{
- public IScheduledTaskWorker Task { get; set; }
+ public TaskCompletionEventArgs(IScheduledTaskWorker task, TaskResult result)
+ {
+ Task = task;
+ Result = result;
+ }
- public TaskResult Result { get; set; }
+ public IScheduledTaskWorker Task { get; }
+
+ public TaskResult Result { get; }
}
}
diff --git a/MediaBrowser.Model/Tasks/TaskInfo.cs b/MediaBrowser.Model/Tasks/TaskInfo.cs
index 5144c035a..77100dfe7 100644
--- a/MediaBrowser.Model/Tasks/TaskInfo.cs
+++ b/MediaBrowser.Model/Tasks/TaskInfo.cs
@@ -1,3 +1,4 @@
+#nullable disable
using System;
namespace MediaBrowser.Model.Tasks
diff --git a/MediaBrowser.Model/Tasks/TaskResult.cs b/MediaBrowser.Model/Tasks/TaskResult.cs
index c6f92e7ed..31001aeb2 100644
--- a/MediaBrowser.Model/Tasks/TaskResult.cs
+++ b/MediaBrowser.Model/Tasks/TaskResult.cs
@@ -1,3 +1,4 @@
+#nullable disable
using System;
namespace MediaBrowser.Model.Tasks
diff --git a/MediaBrowser.Model/Tasks/TaskTriggerInfo.cs b/MediaBrowser.Model/Tasks/TaskTriggerInfo.cs
index 699e0ea3a..5aeaffc2b 100644
--- a/MediaBrowser.Model/Tasks/TaskTriggerInfo.cs
+++ b/MediaBrowser.Model/Tasks/TaskTriggerInfo.cs
@@ -1,3 +1,4 @@
+#nullable disable
#pragma warning disable CS1591
using System;
diff --git a/MediaBrowser.Model/Updates/InstallationInfo.cs b/MediaBrowser.Model/Updates/InstallationInfo.cs
index e0d450d06..a6d80dba6 100644
--- a/MediaBrowser.Model/Updates/InstallationInfo.cs
+++ b/MediaBrowser.Model/Updates/InstallationInfo.cs
@@ -1,3 +1,4 @@
+#nullable disable
using System;
namespace MediaBrowser.Model.Updates
@@ -11,7 +12,7 @@ namespace MediaBrowser.Model.Updates
/// Gets or sets the guid.
/// </summary>
/// <value>The guid.</value>
- public string Guid { get; set; }
+ public Guid Guid { get; set; }
/// <summary>
/// Gets or sets the name.
@@ -23,6 +24,24 @@ namespace MediaBrowser.Model.Updates
/// Gets or sets the version.
/// </summary>
/// <value>The version.</value>
- public string Version { get; set; }
+ public Version Version { get; set; }
+
+ /// <summary>
+ /// Gets or sets the changelog for this version.
+ /// </summary>
+ /// <value>The changelog.</value>
+ public string Changelog { get; set; }
+
+ /// <summary>
+ /// Gets or sets the source URL.
+ /// </summary>
+ /// <value>The source URL.</value>
+ public string SourceUrl { get; set; }
+
+ /// <summary>
+ /// Gets or sets a checksum for the binary.
+ /// </summary>
+ /// <value>The checksum.</value>
+ public string Checksum { get; set; }
}
}
diff --git a/MediaBrowser.Model/Updates/PackageInfo.cs b/MediaBrowser.Model/Updates/PackageInfo.cs
index f5aa8b6fa..d9eb1386e 100644
--- a/MediaBrowser.Model/Updates/PackageInfo.cs
+++ b/MediaBrowser.Model/Updates/PackageInfo.cs
@@ -1,3 +1,4 @@
+#nullable disable
using System;
using System.Collections.Generic;
diff --git a/MediaBrowser.Model/Updates/VersionInfo.cs b/MediaBrowser.Model/Updates/VersionInfo.cs
index fe5826ad2..a4aa0e75f 100644
--- a/MediaBrowser.Model/Updates/VersionInfo.cs
+++ b/MediaBrowser.Model/Updates/VersionInfo.cs
@@ -1,3 +1,5 @@
+#nullable disable
+
using System;
namespace MediaBrowser.Model.Updates
@@ -8,22 +10,10 @@ namespace MediaBrowser.Model.Updates
public class VersionInfo
{
/// <summary>
- /// Gets or sets the name.
- /// </summary>
- /// <value>The name.</value>
- public string name { get; set; }
-
- /// <summary>
- /// Gets or sets the guid.
- /// </summary>
- /// <value>The guid.</value>
- public string guid { get; set; }
-
- /// <summary>
/// Gets or sets the version.
/// </summary>
/// <value>The version.</value>
- public Version version { get; set; }
+ public string version { get; set; }
/// <summary>
/// Gets or sets the changelog for this version.
@@ -50,9 +40,9 @@ namespace MediaBrowser.Model.Updates
public string checksum { get; set; }
/// <summary>
- /// Gets or sets the target filename for the downloaded binary.
+ /// Gets or sets a timestamp of when the binary was built.
/// </summary>
- /// <value>The target filename.</value>
- public string filename { get; set; }
+ /// <value>The timestamp.</value>
+ public string timestamp { get; set; }
}
}
diff --git a/MediaBrowser.Model/Users/ForgotPasswordResult.cs b/MediaBrowser.Model/Users/ForgotPasswordResult.cs
index 368c642e8..6bb13d4c9 100644
--- a/MediaBrowser.Model/Users/ForgotPasswordResult.cs
+++ b/MediaBrowser.Model/Users/ForgotPasswordResult.cs
@@ -1,3 +1,4 @@
+#nullable disable
#pragma warning disable CS1591
using System;
diff --git a/MediaBrowser.Model/Users/PinRedeemResult.cs b/MediaBrowser.Model/Users/PinRedeemResult.cs
index ab868cad4..7e4553bac 100644
--- a/MediaBrowser.Model/Users/PinRedeemResult.cs
+++ b/MediaBrowser.Model/Users/PinRedeemResult.cs
@@ -1,3 +1,4 @@
+#nullable disable
#pragma warning disable CS1591
namespace MediaBrowser.Model.Users
diff --git a/MediaBrowser.Model/Users/UserAction.cs b/MediaBrowser.Model/Users/UserAction.cs
index f6bb6451b..36b8e6ee5 100644
--- a/MediaBrowser.Model/Users/UserAction.cs
+++ b/MediaBrowser.Model/Users/UserAction.cs
@@ -1,3 +1,4 @@
+#nullable disable
#pragma warning disable CS1591
using System;
diff --git a/MediaBrowser.Model/Users/UserPolicy.cs b/MediaBrowser.Model/Users/UserPolicy.cs
index 66e5529e3..152d525b0 100644
--- a/MediaBrowser.Model/Users/UserPolicy.cs
+++ b/MediaBrowser.Model/Users/UserPolicy.cs
@@ -1,3 +1,4 @@
+#nullable disable
#pragma warning disable CS1591
using System;
diff --git a/MediaBrowser.Providers/Manager/ItemImageProvider.cs b/MediaBrowser.Providers/Manager/ItemImageProvider.cs
index 6ef0e44a2..48e1c94ad 100644
--- a/MediaBrowser.Providers/Manager/ItemImageProvider.cs
+++ b/MediaBrowser.Providers/Manager/ItemImageProvider.cs
@@ -230,7 +230,9 @@ namespace MediaBrowser.Providers.Manager
/// <param name="result">The result.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task.</returns>
- private async Task RefreshFromProvider(BaseItem item, LibraryOptions libraryOptions,
+ private async Task RefreshFromProvider(
+ BaseItem item,
+ LibraryOptions libraryOptions,
IRemoteImageProvider provider,
ImageRefreshOptions refreshOptions,
TypeOptions savedOptions,
@@ -256,20 +258,24 @@ namespace MediaBrowser.Providers.Manager
_logger.LogDebug("Running {0} for {1}", provider.GetType().Name, item.Path ?? item.Name);
- var images = await _providerManager.GetAvailableRemoteImages(item, new RemoteImageQuery
- {
- ProviderName = provider.Name,
- IncludeAllLanguages = false,
- IncludeDisabledProviders = false,
-
- }, cancellationToken).ConfigureAwait(false);
+ var images = await _providerManager.GetAvailableRemoteImages(
+ item,
+ new RemoteImageQuery(provider.Name)
+ {
+ IncludeAllLanguages = false,
+ IncludeDisabledProviders = false,
+ },
+ cancellationToken).ConfigureAwait(false);
var list = images.ToList();
int minWidth;
foreach (var imageType in _singularImages)
{
- if (!IsEnabled(savedOptions, imageType, item)) continue;
+ if (!IsEnabled(savedOptions, imageType, item))
+ {
+ continue;
+ }
if (!HasImage(item, imageType) || (refreshOptions.IsReplacingImage(imageType) && !downloadedImages.Contains(imageType)))
{
diff --git a/MediaBrowser.Providers/Manager/ProviderManager.cs b/MediaBrowser.Providers/Manager/ProviderManager.cs
index be8fe3e1c..d29736c58 100644
--- a/MediaBrowser.Providers/Manager/ProviderManager.cs
+++ b/MediaBrowser.Providers/Manager/ProviderManager.cs
@@ -267,11 +267,7 @@ namespace MediaBrowser.Providers.Manager
/// <returns>IEnumerable{IImageProvider}.</returns>
public IEnumerable<ImageProviderInfo> GetRemoteImageProviderInfo(BaseItem item)
{
- return GetRemoteImageProviders(item, true).Select(i => new ImageProviderInfo
- {
- Name = i.Name,
- SupportedImages = i.GetSupportedImages(item).ToArray()
- });
+ return GetRemoteImageProviders(item, true).Select(i => new ImageProviderInfo(i.Name, i.GetSupportedImages(item).ToArray()));
}
public IEnumerable<IImageProvider> GetImageProviders(BaseItem item, ImageRefreshOptions refreshOptions)
diff --git a/MediaBrowser.WebDashboard/Api/DashboardService.cs b/MediaBrowser.WebDashboard/Api/DashboardService.cs
index 133a35527..55fc463d0 100644
--- a/MediaBrowser.WebDashboard/Api/DashboardService.cs
+++ b/MediaBrowser.WebDashboard/Api/DashboardService.cs
@@ -52,12 +52,6 @@ namespace MediaBrowser.WebDashboard.Api
public string Name { get; set; }
}
- [Route("/web/Package", "GET", IsHidden = true)]
- public class GetDashboardPackage
- {
- public string Mode { get; set; }
- }
-
[Route("/robots.txt", "GET", IsHidden = true)]
public class GetRobotsTxt
{
@@ -225,7 +219,7 @@ namespace MediaBrowser.WebDashboard.Api
return _resultFactory.GetStaticResult(Request, plugin.Version.ToString().GetMD5(), null, null, MimeTypes.GetMimeType("page.html"), () => Task.FromResult(stream));
}
- return _resultFactory.GetStaticResult(Request, plugin.Version.ToString().GetMD5(), null, null, MimeTypes.GetMimeType("page.html"), () => PackageCreator.ModifyHtml(false, stream, null, _appHost.ApplicationVersionString, null));
+ return _resultFactory.GetStaticResult(Request, plugin.Version.ToString().GetMD5(), null, null, MimeTypes.GetMimeType("page.html"), () => Task.FromResult(stream));
}
throw new ResourceNotFoundException();
@@ -328,154 +322,19 @@ namespace MediaBrowser.WebDashboard.Api
throw new ResourceNotFoundException();
}
- var path = request.ResourceName;
-
- var contentType = MimeTypes.GetMimeType(path);
+ var path = request?.ResourceName;
var basePath = DashboardUIPath;
// Bounce them to the startup wizard if it hasn't been completed yet
- if (!_serverConfigurationManager.Configuration.IsStartupWizardCompleted &&
- Request.RawUrl.IndexOf("wizard", StringComparison.OrdinalIgnoreCase) == -1 &&
- PackageCreator.IsCoreHtml(path))
- {
- // But don't redirect if an html import is being requested.
- if (path.IndexOf("bower_components", StringComparison.OrdinalIgnoreCase) == -1)
- {
- Request.Response.Redirect("index.html?start=wizard#!/wizardstart.html");
- return null;
- }
- }
-
- var localizationCulture = GetLocalizationCulture();
-
- // Don't cache if not configured to do so
- // But always cache images to simulate production
- if (!_serverConfigurationManager.Configuration.EnableDashboardResponseCaching &&
- !contentType.StartsWith("image/", StringComparison.OrdinalIgnoreCase) &&
- !contentType.StartsWith("font/", StringComparison.OrdinalIgnoreCase))
- {
- var stream = await GetResourceStream(basePath, path, localizationCulture).ConfigureAwait(false);
- return _resultFactory.GetResult(Request, stream, contentType);
- }
-
- TimeSpan? cacheDuration = null;
-
- // Cache images unconditionally - updates to image files will require new filename
- // If there's a version number in the query string we can cache this unconditionally
- if (contentType.StartsWith("image/", StringComparison.OrdinalIgnoreCase) || contentType.StartsWith("font/", StringComparison.OrdinalIgnoreCase) || !string.IsNullOrEmpty(request.V))
+ if (!_serverConfigurationManager.Configuration.IsStartupWizardCompleted
+ && !Request.RawUrl.Contains("wizard", StringComparison.OrdinalIgnoreCase)
+ && Request.RawUrl.Contains("index", StringComparison.OrdinalIgnoreCase))
{
- cacheDuration = TimeSpan.FromDays(365);
- }
-
- var cacheKey = (_appHost.ApplicationVersionString + (localizationCulture ?? string.Empty) + path).GetMD5();
-
- // html gets modified on the fly
- if (contentType.StartsWith("text/html", StringComparison.OrdinalIgnoreCase))
- {
- return await _resultFactory.GetStaticResult(Request, cacheKey, null, cacheDuration, contentType, () => GetResourceStream(basePath, path, localizationCulture)).ConfigureAwait(false);
+ Request.Response.Redirect("index.html?start=wizard#!/wizardstart.html");
+ return null;
}
return await _resultFactory.GetStaticFileResult(Request, _resourceFileManager.GetResourcePath(basePath, path)).ConfigureAwait(false);
}
-
- private string GetLocalizationCulture()
- {
- return _serverConfigurationManager.Configuration.UICulture;
- }
-
- /// <summary>
- /// Gets the resource stream.
- /// </summary>
- private Task<Stream> GetResourceStream(string basePath, string virtualPath, string localizationCulture)
- {
- return GetPackageCreator(basePath)
- .GetResource(virtualPath, null, localizationCulture, _appHost.ApplicationVersionString);
- }
-
- private PackageCreator GetPackageCreator(string basePath)
- {
- return new PackageCreator(basePath, _resourceFileManager);
- }
-
- public async Task<object> Get(GetDashboardPackage request)
- {
- if (!_appConfig.HostWebClient() || DashboardUIPath == null)
- {
- throw new ResourceNotFoundException();
- }
-
- var mode = request.Mode;
-
- var inputPath = string.IsNullOrWhiteSpace(mode) ?
- DashboardUIPath
- : "C:\\dev\\emby-web-mobile-master\\dist";
-
- var targetPath = !string.IsNullOrWhiteSpace(mode) ?
- inputPath
- : "C:\\dev\\emby-web-mobile\\src";
-
- var packageCreator = GetPackageCreator(inputPath);
-
- if (!string.Equals(inputPath, targetPath, StringComparison.OrdinalIgnoreCase))
- {
- try
- {
- Directory.Delete(targetPath, true);
- }
- catch (IOException ex)
- {
- _logger.LogError(ex, "Error deleting {Path}", targetPath);
- }
-
- CopyDirectory(inputPath, targetPath);
- }
-
- var appVersion = _appHost.ApplicationVersionString;
-
- await DumpHtml(packageCreator, inputPath, targetPath, mode, appVersion).ConfigureAwait(false);
-
- return string.Empty;
- }
-
- private async Task DumpHtml(PackageCreator packageCreator, string source, string destination, string mode, string appVersion)
- {
- foreach (var file in _fileSystem.GetFiles(source))
- {
- var filename = file.Name;
-
- if (!string.Equals(file.Extension, ".html", StringComparison.OrdinalIgnoreCase))
- {
- continue;
- }
-
- await DumpFile(packageCreator, filename, Path.Combine(destination, filename), mode, appVersion).ConfigureAwait(false);
- }
- }
-
- private async Task DumpFile(PackageCreator packageCreator, string resourceVirtualPath, string destinationFilePath, string mode, string appVersion)
- {
- using (var stream = await packageCreator.GetResource(resourceVirtualPath, mode, null, appVersion).ConfigureAwait(false))
- using (var fs = new FileStream(destinationFilePath, FileMode.Create, FileAccess.Write, FileShare.Read))
- {
- await stream.CopyToAsync(fs).ConfigureAwait(false);
- }
- }
-
- private void CopyDirectory(string source, string destination)
- {
- Directory.CreateDirectory(destination);
-
- // Now Create all of the directories
- foreach (var dirPath in _fileSystem.GetDirectories(source, true))
- {
- Directory.CreateDirectory(dirPath.FullName.Replace(source, destination, StringComparison.Ordinal));
- }
-
- // Copy all the files & Replaces any files with the same name
- foreach (var newPath in _fileSystem.GetFiles(source, true))
- {
- File.Copy(newPath.FullName, newPath.FullName.Replace(source, destination, StringComparison.Ordinal), true);
- }
- }
}
}
diff --git a/MediaBrowser.WebDashboard/Api/PackageCreator.cs b/MediaBrowser.WebDashboard/Api/PackageCreator.cs
deleted file mode 100644
index b7c15a840..000000000
--- a/MediaBrowser.WebDashboard/Api/PackageCreator.cs
+++ /dev/null
@@ -1,161 +0,0 @@
-#pragma warning disable CS1591
-
-using System;
-using System.Globalization;
-using System.IO;
-using System.Text;
-using System.Threading.Tasks;
-using MediaBrowser.Controller;
-
-namespace MediaBrowser.WebDashboard.Api
-{
- public class PackageCreator
- {
- private readonly string _basePath;
- private readonly IResourceFileManager _resourceFileManager;
-
- public PackageCreator(string basePath, IResourceFileManager resourceFileManager)
- {
- _basePath = basePath;
- _resourceFileManager = resourceFileManager;
- }
-
- public async Task<Stream> GetResource(
- string virtualPath,
- string mode,
- string localizationCulture,
- string appVersion)
- {
- var resourcePath = _resourceFileManager.GetResourcePath(_basePath, virtualPath);
- Stream resourceStream = File.OpenRead(resourcePath);
-
- if (resourceStream != null && IsCoreHtml(virtualPath))
- {
- bool isMainIndexPage = string.Equals(virtualPath, "index.html", StringComparison.OrdinalIgnoreCase);
- resourceStream = await ModifyHtml(isMainIndexPage, resourceStream, mode, appVersion, localizationCulture).ConfigureAwait(false);
- }
-
- return resourceStream;
- }
-
- public static bool IsCoreHtml(string path)
- {
- if (path.IndexOf(".template.html", StringComparison.OrdinalIgnoreCase) != -1)
- {
- return false;
- }
-
- return string.Equals(Path.GetExtension(path), ".html", StringComparison.OrdinalIgnoreCase);
- }
-
- /// <summary>
- /// Modifies the source HTML stream by adding common meta tags, css and js.
- /// </summary>
- /// <param name="isMainIndexPage">True if the stream contains content for the main index page.</param>
- /// <param name="sourceStream">The stream whose content should be modified.</param>
- /// <param name="mode">The client mode ('cordova', 'android', etc).</param>
- /// <param name="appVersion">The application version.</param>
- /// <param name="localizationCulture">The localization culture.</param>
- /// <returns>
- /// A task that represents the async operation to read and modify the input stream.
- /// The task result contains a stream containing the modified HTML content.
- /// </returns>
- public static async Task<Stream> ModifyHtml(
- bool isMainIndexPage,
- Stream sourceStream,
- string mode,
- string appVersion,
- string localizationCulture)
- {
- string html;
- using (var reader = new StreamReader(sourceStream, Encoding.UTF8))
- {
- html = await reader.ReadToEndAsync().ConfigureAwait(false);
- }
-
- if (isMainIndexPage && !string.IsNullOrWhiteSpace(localizationCulture))
- {
- var lang = localizationCulture.Split('-')[0];
-
- html = html.Replace("<html", "<html data-culture=\"" + localizationCulture + "\" lang=\"" + lang + "\"", StringComparison.Ordinal);
- }
-
- if (isMainIndexPage)
- {
- html = html.Replace("<head>", "<head>" + GetMetaTags(mode), StringComparison.Ordinal);
- }
-
- // Disable embedded scripts from plugins. We'll run them later once resources have loaded
- if (html.IndexOf("<script", StringComparison.OrdinalIgnoreCase) != -1)
- {
- html = html.Replace("<script", "<!--<script", StringComparison.Ordinal);
- html = html.Replace("</script>", "</script>-->", StringComparison.Ordinal);
- }
-
- if (isMainIndexPage)
- {
- html = html.Replace("</body>", GetCommonJavascript(mode, appVersion) + "</body>", StringComparison.Ordinal);
- }
-
- var bytes = Encoding.UTF8.GetBytes(html);
-
- return new MemoryStream(bytes);
- }
-
- /// <summary>
- /// Gets the meta tags.
- /// </summary>
- /// <returns>System.String.</returns>
- private static string GetMetaTags(string mode)
- {
- var sb = new StringBuilder();
-
- if (string.Equals(mode, "cordova", StringComparison.OrdinalIgnoreCase)
- || string.Equals(mode, "android", StringComparison.OrdinalIgnoreCase))
- {
- sb.Append("<meta http-equiv=\"Content-Security-Policy\" content=\"default-src * 'self' 'unsafe-inline' 'unsafe-eval' data: gap: file: filesystem: ws: wss:;\">");
- }
-
- return sb.ToString();
- }
-
- /// <summary>
- /// Gets the common javascript.
- /// </summary>
- /// <param name="mode">The mode.</param>
- /// <param name="version">The version.</param>
- /// <returns>System.String.</returns>
- private static string GetCommonJavascript(string mode, string version)
- {
- var builder = new StringBuilder();
-
- builder.Append("<script>");
- if (!string.IsNullOrWhiteSpace(mode))
- {
- builder.AppendFormat(CultureInfo.InvariantCulture, "window.appMode='{0}';", mode);
- }
- else
- {
- builder.AppendFormat(CultureInfo.InvariantCulture, "window.dashboardVersion='{0}';", version);
- }
-
- builder.Append("</script>");
-
- if (string.Equals(mode, "cordova", StringComparison.OrdinalIgnoreCase))
- {
- builder.Append("<script src=\"cordova.js\" defer></script>");
- }
-
- builder.Append("<script src=\"scripts/apploader.js");
- if (!string.IsNullOrWhiteSpace(version))
- {
- builder.Append("?v=");
- builder.Append(version);
- }
-
- builder.Append("\" defer></script>");
-
- return builder.ToString();
- }
- }
-}
diff --git a/RSSDP/RSSDP.csproj b/RSSDP/RSSDP.csproj
index e3f3127b6..553693171 100644
--- a/RSSDP/RSSDP.csproj
+++ b/RSSDP/RSSDP.csproj
@@ -14,6 +14,7 @@
<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
+ <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
</Project>