aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.ci/azure-pipelines.yml37
-rw-r--r--.drone.yml81
-rw-r--r--.github/ISSUE_TEMPLATE/bug_report.md1
-rw-r--r--.gitignore3
-rw-r--r--BDInfo/Properties/AssemblyInfo.cs4
-rw-r--r--Dockerfile5
-rw-r--r--Dockerfile.arm4
-rw-r--r--Dockerfile.arm644
-rw-r--r--Doxyfile2565
-rw-r--r--DvdLib/Properties/AssemblyInfo.cs4
-rw-r--r--Emby.Dlna/ConnectionManager/ConnectionManager.cs7
-rw-r--r--Emby.Dlna/ConnectionManager/ControlHandler.cs4
-rw-r--r--Emby.Dlna/ContentDirectory/ContentDirectory.cs11
-rw-r--r--Emby.Dlna/ContentDirectory/ControlHandler.cs19
-rw-r--r--Emby.Dlna/Main/DlnaEntryPoint.cs23
-rw-r--r--Emby.Dlna/MediaReceiverRegistrar/ControlHandler.cs5
-rw-r--r--Emby.Dlna/MediaReceiverRegistrar/MediaReceiverRegistrar.cs7
-rw-r--r--Emby.Dlna/PlayTo/PlayToController.cs55
-rw-r--r--Emby.Dlna/Properties/AssemblyInfo.cs4
-rw-r--r--Emby.Dlna/Service/BaseControlHandler.cs17
-rw-r--r--Emby.Drawing/ImageProcessor.cs8
-rw-r--r--Emby.Drawing/Properties/AssemblyInfo.cs4
-rw-r--r--Emby.IsoMounting/IsoMounter/LinuxIsoManager.cs10
-rw-r--r--Emby.IsoMounting/IsoMounter/Properties/AssemblyInfo.cs4
-rw-r--r--Emby.Naming/Properties/AssemblyInfo.cs4
-rw-r--r--Emby.Notifications/Properties/AssemblyInfo.cs4
-rw-r--r--Emby.Photos/Properties/AssemblyInfo.cs4
-rw-r--r--Emby.Server.Implementations/Activity/ActivityLogEntryPoint.cs181
-rw-r--r--Emby.Server.Implementations/AppBase/BaseApplicationPaths.cs10
-rw-r--r--Emby.Server.Implementations/ApplicationHost.cs295
-rw-r--r--Emby.Server.Implementations/ConfigurationOptions.cs3
-rw-r--r--Emby.Server.Implementations/Cryptography/CryptographyProvider.cs3
-rw-r--r--Emby.Server.Implementations/Data/SqliteDisplayPreferencesRepository.cs3
-rw-r--r--Emby.Server.Implementations/Data/SqliteItemRepository.cs15
-rw-r--r--Emby.Server.Implementations/Data/TypeMapper.cs9
-rw-r--r--Emby.Server.Implementations/Diagnostics/CommonProcess.cs72
-rw-r--r--Emby.Server.Implementations/Emby.Server.Implementations.csproj16
-rw-r--r--Emby.Server.Implementations/EntryPoints/LibraryChangedNotifier.cs4
-rw-r--r--Emby.Server.Implementations/EnvironmentInfo/EnvironmentInfo.cs36
-rw-r--r--Emby.Server.Implementations/HttpServer/HttpResultFactory.cs8
-rw-r--r--Emby.Server.Implementations/HttpServer/Security/AuthService.cs4
-rw-r--r--Emby.Server.Implementations/HttpServer/StreamWriter.cs4
-rw-r--r--Emby.Server.Implementations/IO/LibraryMonitor.cs15
-rw-r--r--Emby.Server.Implementations/IO/ManagedFileSystem.cs16
-rw-r--r--Emby.Server.Implementations/IO/StreamHelper.cs226
-rw-r--r--Emby.Server.Implementations/IStartupOptions.cs5
-rw-r--r--Emby.Server.Implementations/Library/DefaultAuthenticationProvider.cs2
-rw-r--r--Emby.Server.Implementations/Library/LibraryManager.cs319
-rw-r--r--Emby.Server.Implementations/Library/UserManager.cs20
-rw-r--r--Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs8
-rw-r--r--Emby.Server.Implementations/LiveTv/LiveTvManager.cs4
-rw-r--r--Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunUdpStream.cs3
-rw-r--r--Emby.Server.Implementations/LiveTv/TunerHosts/LiveStream.cs58
-rw-r--r--Emby.Server.Implementations/LiveTv/TunerHosts/M3UTunerHost.cs14
-rw-r--r--Emby.Server.Implementations/LiveTv/TunerHosts/M3uParser.cs20
-rw-r--r--Emby.Server.Implementations/Localization/Core/es-AR.json184
-rw-r--r--Emby.Server.Implementations/Localization/Core/fr-CA.json170
-rw-r--r--Emby.Server.Implementations/Localization/Core/fr.json4
-rw-r--r--Emby.Server.Implementations/Localization/Core/he.json6
-rw-r--r--Emby.Server.Implementations/Localization/Core/it.json12
-rw-r--r--Emby.Server.Implementations/Localization/Core/kk.json10
-rw-r--r--Emby.Server.Implementations/Localization/Core/pt-BR.json16
-rw-r--r--Emby.Server.Implementations/Localization/Core/sl-SI.json112
-rw-r--r--Emby.Server.Implementations/Localization/Core/tr.json36
-rw-r--r--Emby.Server.Implementations/Localization/Core/zh-CN.json6
-rw-r--r--Emby.Server.Implementations/Localization/LocalizationManager.cs37
-rw-r--r--Emby.Server.Implementations/Net/DisposableManagedObjectBase.cs66
-rw-r--r--Emby.Server.Implementations/Net/SocketFactory.cs134
-rw-r--r--Emby.Server.Implementations/Net/UdpSocket.cs72
-rw-r--r--Emby.Server.Implementations/Networking/NetworkManager.cs8
-rw-r--r--Emby.Server.Implementations/Properties/AssemblyInfo.cs2
-rw-r--r--Emby.Server.Implementations/Reflection/AssemblyInfo.cs25
-rw-r--r--Emby.Server.Implementations/ServerApplicationPaths.cs6
-rw-r--r--Emby.Server.Implementations/Session/SessionManager.cs244
-rw-r--r--Emby.Server.Implementations/SocketSharp/HttpPostedFile.cs44
-rw-r--r--Emby.Server.Implementations/Sorting/AlbumArtistComparer.cs2
-rw-r--r--Emby.Server.Implementations/Sorting/SeriesSortNameComparer.cs14
-rw-r--r--Emby.Server.Implementations/Updates/InstallationManager.cs32
-rw-r--r--Emby.Server.Implementations/Xml/XmlReaderSettingsFactory.cs20
-rw-r--r--Emby.XmlTv/Emby.XmlTv/Properties/AssemblyInfo.cs4
-rw-r--r--Jellyfin.Drawing.Skia/Properties/AssemblyInfo.cs4
-rw-r--r--Jellyfin.Drawing.Skia/StripCollageBuilder.cs54
-rw-r--r--Jellyfin.Server/CoreAppHost.cs3
-rw-r--r--Jellyfin.Server/Jellyfin.Server.csproj7
-rw-r--r--Jellyfin.Server/Program.cs78
-rw-r--r--Jellyfin.Server/Properties/AssemblyInfo.cs4
-rw-r--r--Jellyfin.Server/StartupOptions.cs6
-rw-r--r--MediaBrowser.Api/BaseApiService.cs35
-rw-r--r--MediaBrowser.Api/LiveTv/LiveTvService.cs38
-rw-r--r--MediaBrowser.Api/LiveTv/ProgressiveFileCopier.cs45
-rw-r--r--MediaBrowser.Api/Playback/Progressive/AudioService.cs8
-rw-r--r--MediaBrowser.Api/Playback/Progressive/BaseProgressiveStreamingService.cs15
-rw-r--r--MediaBrowser.Api/Playback/Progressive/ProgressiveStreamWriter.cs10
-rw-r--r--MediaBrowser.Api/Playback/Progressive/VideoService.cs8
-rw-r--r--MediaBrowser.Api/Playback/UniversalAudioService.cs7
-rw-r--r--MediaBrowser.Api/Properties/AssemblyInfo.cs4
-rw-r--r--MediaBrowser.Api/UserLibrary/ArtistsService.cs10
-rw-r--r--MediaBrowser.Common/Configuration/IApplicationPaths.cs6
-rw-r--r--MediaBrowser.Common/Extensions/BaseExtensions.cs10
-rw-r--r--MediaBrowser.Common/IApplicationHost.cs9
-rw-r--r--MediaBrowser.Common/Properties/AssemblyInfo.cs4
-rw-r--r--MediaBrowser.Common/Providers/SubtitleConfigurationFactory.cs18
-rw-r--r--MediaBrowser.Common/System/OperatingSystem.cs72
-rw-r--r--MediaBrowser.Controller/IServerApplicationHost.cs2
-rw-r--r--MediaBrowser.Controller/MediaEncoding/JobLogger.cs11
-rw-r--r--MediaBrowser.Controller/Properties/AssemblyInfo.cs4
-rw-r--r--MediaBrowser.LocalMetadata/Parsers/BaseItemXmlParser.cs53
-rw-r--r--MediaBrowser.LocalMetadata/Parsers/BoxSetXmlParser.cs5
-rw-r--r--MediaBrowser.LocalMetadata/Parsers/PlaylistXmlParser.cs5
-rw-r--r--MediaBrowser.LocalMetadata/Properties/AssemblyInfo.cs4
-rw-r--r--MediaBrowser.LocalMetadata/Providers/BoxSetXmlProvider.cs7
-rw-r--r--MediaBrowser.LocalMetadata/Providers/PlaylistXmlProvider.cs7
-rw-r--r--MediaBrowser.LocalMetadata/Savers/BaseXmlSaver.cs7
-rw-r--r--MediaBrowser.LocalMetadata/Savers/BoxSetXmlSaver.cs4
-rw-r--r--MediaBrowser.LocalMetadata/Savers/PlaylistXmlSaver.cs4
-rw-r--r--MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs17
-rw-r--r--MediaBrowser.MediaEncoding/MediaBrowser.MediaEncoding.csproj1
-rw-r--r--MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs77
-rw-r--r--MediaBrowser.MediaEncoding/Properties/AssemblyInfo.cs4
-rw-r--r--MediaBrowser.MediaEncoding/Subtitles/ConfigurationExtension.cs29
-rw-r--r--MediaBrowser.MediaEncoding/Subtitles/OpenSubtitleDownloader.cs347
-rw-r--r--MediaBrowser.Model/Entities/MediaStream.cs50
-rw-r--r--MediaBrowser.Model/Net/HttpResponse.cs64
-rw-r--r--MediaBrowser.Model/Net/IAcceptSocket.cs15
-rw-r--r--MediaBrowser.Model/Properties/AssemblyInfo.cs4
-rw-r--r--MediaBrowser.Model/Reflection/IAssemblyInfo.cs14
-rw-r--r--MediaBrowser.Model/System/IEnvironmentInfo.cs21
-rw-r--r--MediaBrowser.Model/System/OperatingSystemId.cs10
-rw-r--r--MediaBrowser.Model/System/SystemInfo.cs6
-rw-r--r--MediaBrowser.Model/Users/UserPolicy.cs3
-rw-r--r--MediaBrowser.Model/Xml/IXmlReaderSettingsFactory.cs9
-rw-r--r--MediaBrowser.Providers/Manager/ProviderManager.cs39
-rw-r--r--MediaBrowser.Providers/MediaBrowser.Providers.csproj1
-rw-r--r--MediaBrowser.Providers/Music/MusicBrainzAlbumProvider.cs317
-rw-r--r--MediaBrowser.Providers/Music/MusicBrainzArtistProvider.cs43
-rw-r--r--MediaBrowser.Providers/Properties/AssemblyInfo.cs4
-rw-r--r--MediaBrowser.Providers/TV/MissingEpisodeProvider.cs3
-rw-r--r--MediaBrowser.Providers/TV/SeriesMetadataService.cs4
-rw-r--r--MediaBrowser.Providers/TV/TheTVDB/TvdbEpisodeProvider.cs2
-rw-r--r--MediaBrowser.Providers/TV/TheTVDB/TvdbSeriesProvider.cs3
-rw-r--r--MediaBrowser.Tests/Properties/AssemblyInfo.cs2
-rw-r--r--MediaBrowser.WebDashboard/Api/DashboardService.cs17
-rw-r--r--MediaBrowser.WebDashboard/Properties/AssemblyInfo.cs4
-rw-r--r--MediaBrowser.XbmcMetadata/Parsers/BaseNfoParser.cs181
-rw-r--r--MediaBrowser.XbmcMetadata/Parsers/EpisodeNfoParser.cs68
-rw-r--r--MediaBrowser.XbmcMetadata/Parsers/MovieNfoParser.cs14
-rw-r--r--MediaBrowser.XbmcMetadata/Parsers/SeasonNfoParser.cs5
-rw-r--r--MediaBrowser.XbmcMetadata/Parsers/SeriesNfoParser.cs5
-rw-r--r--MediaBrowser.XbmcMetadata/Properties/AssemblyInfo.cs4
-rw-r--r--MediaBrowser.XbmcMetadata/Providers/AlbumNfoProvider.cs7
-rw-r--r--MediaBrowser.XbmcMetadata/Providers/ArtistNfoProvider.cs7
-rw-r--r--MediaBrowser.XbmcMetadata/Providers/BaseVideoNfoProvider.cs7
-rw-r--r--MediaBrowser.XbmcMetadata/Providers/EpisodeNfoProvider.cs7
-rw-r--r--MediaBrowser.XbmcMetadata/Providers/MovieNfoProvider.cs10
-rw-r--r--MediaBrowser.XbmcMetadata/Providers/SeasonNfoProvider.cs11
-rw-r--r--MediaBrowser.XbmcMetadata/Providers/SeriesNfoProvider.cs13
-rw-r--r--MediaBrowser.XbmcMetadata/Savers/AlbumNfoSaver.cs4
-rw-r--r--MediaBrowser.XbmcMetadata/Savers/ArtistNfoSaver.cs4
-rw-r--r--MediaBrowser.XbmcMetadata/Savers/BaseNfoSaver.cs80
-rw-r--r--MediaBrowser.XbmcMetadata/Savers/EpisodeNfoSaver.cs4
-rw-r--r--MediaBrowser.XbmcMetadata/Savers/MovieNfoSaver.cs4
-rw-r--r--MediaBrowser.XbmcMetadata/Savers/SeasonNfoSaver.cs6
-rw-r--r--MediaBrowser.XbmcMetadata/Savers/SeriesNfoSaver.cs4
-rw-r--r--MediaBrowser.sln4
-rw-r--r--Mono.Nat/Properties/AssemblyInfo.cs4
-rw-r--r--OpenSubtitlesHandler/Console/OSHConsole.cs92
-rw-r--r--OpenSubtitlesHandler/Interfaces/IMethodResponse.cs71
-rw-r--r--OpenSubtitlesHandler/Interfaces/MethodResponseAttr.cs40
-rw-r--r--OpenSubtitlesHandler/Languages/DetectLanguageResult.cs31
-rw-r--r--OpenSubtitlesHandler/MethodResponses/MethodResponseAddComment.cs32
-rw-r--r--OpenSubtitlesHandler/MethodResponses/MethodResponseAddRequest.cs35
-rw-r--r--OpenSubtitlesHandler/MethodResponses/MethodResponseAutoUpdate.cs59
-rw-r--r--OpenSubtitlesHandler/MethodResponses/MethodResponseCheckMovieHash.cs37
-rw-r--r--OpenSubtitlesHandler/MethodResponses/MethodResponseCheckMovieHash2.cs37
-rw-r--r--OpenSubtitlesHandler/MethodResponses/MethodResponseCheckSubHash.cs38
-rw-r--r--OpenSubtitlesHandler/MethodResponses/MethodResponseDetectLanguage.cs37
-rw-r--r--OpenSubtitlesHandler/MethodResponses/MethodResponseError.cs36
-rw-r--r--OpenSubtitlesHandler/MethodResponses/MethodResponseGetAvailableTranslations.cs37
-rw-r--r--OpenSubtitlesHandler/MethodResponses/MethodResponseGetComments.cs39
-rw-r--r--OpenSubtitlesHandler/MethodResponses/MethodResponseGetSubLanguages.cs39
-rw-r--r--OpenSubtitlesHandler/MethodResponses/MethodResponseGetTranslation.cs36
-rw-r--r--OpenSubtitlesHandler/MethodResponses/MethodResponseInsertMovie.cs36
-rw-r--r--OpenSubtitlesHandler/MethodResponses/MethodResponseInsertMovieHash.cs38
-rw-r--r--OpenSubtitlesHandler/MethodResponses/MethodResponseLogIn.cs39
-rw-r--r--OpenSubtitlesHandler/MethodResponses/MethodResponseMovieDetails.cs73
-rw-r--r--OpenSubtitlesHandler/MethodResponses/MethodResponseMovieSearch.cs43
-rw-r--r--OpenSubtitlesHandler/MethodResponses/MethodResponseNoOperation.cs52
-rw-r--r--OpenSubtitlesHandler/MethodResponses/MethodResponseReportWrongImdbMovie.cs33
-rw-r--r--OpenSubtitlesHandler/MethodResponses/MethodResponseReportWrongMovieHash.cs33
-rw-r--r--OpenSubtitlesHandler/MethodResponses/MethodResponseSearchToMail.cs32
-rw-r--r--OpenSubtitlesHandler/MethodResponses/MethodResponseServerInfo.cs131
-rw-r--r--OpenSubtitlesHandler/MethodResponses/MethodResponseSubtitleDownload.cs44
-rw-r--r--OpenSubtitlesHandler/MethodResponses/MethodResponseSubtitleSearch.cs46
-rw-r--r--OpenSubtitlesHandler/MethodResponses/MethodResponseSubtitlesVote.cs43
-rw-r--r--OpenSubtitlesHandler/MethodResponses/MethodResponseTryUploadSubtitles.cs40
-rw-r--r--OpenSubtitlesHandler/MethodResponses/MethodResponseUploadSubtitles.cs38
-rw-r--r--OpenSubtitlesHandler/Methods Implemeted.txt39
-rw-r--r--OpenSubtitlesHandler/MovieHasher.cs48
-rw-r--r--OpenSubtitlesHandler/Movies/CheckMovieHash2Data.cs42
-rw-r--r--OpenSubtitlesHandler/Movies/CheckMovieHash2Result.cs37
-rw-r--r--OpenSubtitlesHandler/Movies/CheckMovieHashResult.cs41
-rw-r--r--OpenSubtitlesHandler/Movies/InsertMovieHashParameters.cs38
-rw-r--r--OpenSubtitlesHandler/Movies/MovieSearchResult.cs40
-rw-r--r--OpenSubtitlesHandler/Movies/SearchToMailMovieParameter.cs30
-rw-r--r--OpenSubtitlesHandler/OpenSubtitles.cs2744
-rw-r--r--OpenSubtitlesHandler/OpenSubtitlesHandler.csproj13
-rw-r--r--OpenSubtitlesHandler/OtherTypes/GetAvailableTranslationsResult.cs39
-rw-r--r--OpenSubtitlesHandler/OtherTypes/GetCommentsResult.cs36
-rw-r--r--OpenSubtitlesHandler/Properties/AssemblyInfo.cs24
-rw-r--r--OpenSubtitlesHandler/Readme.txt20
-rw-r--r--OpenSubtitlesHandler/SubtitleTypes/CheckSubHashResult.cs30
-rw-r--r--OpenSubtitlesHandler/SubtitleTypes/SubtitleDownloadResult.cs43
-rw-r--r--OpenSubtitlesHandler/SubtitleTypes/SubtitleLanguage.cs39
-rw-r--r--OpenSubtitlesHandler/SubtitleTypes/SubtitleSearchParameters.cs82
-rw-r--r--OpenSubtitlesHandler/SubtitleTypes/SubtitleSearchResult.cs136
-rw-r--r--OpenSubtitlesHandler/SubtitleTypes/TryUploadSubtitlesParameters.cs47
-rw-r--r--OpenSubtitlesHandler/SubtitleTypes/UploadSubtitleInfoParameter.cs46
-rw-r--r--OpenSubtitlesHandler/SubtitleTypes/UploadSubtitleParameters.cs52
-rw-r--r--OpenSubtitlesHandler/Utilities.cs174
-rw-r--r--OpenSubtitlesHandler/XML-RPC/Docs/XML-RPC.txt225
-rw-r--r--OpenSubtitlesHandler/XML-RPC/Enums/XmlRpcValueType.cs25
-rw-r--r--OpenSubtitlesHandler/XML-RPC/Types/XmlRpcMethodCall.cs63
-rw-r--r--OpenSubtitlesHandler/XML-RPC/Values/IXmlRpcValue.cs36
-rw-r--r--OpenSubtitlesHandler/XML-RPC/Values/XmlRpcStructMember.cs43
-rw-r--r--OpenSubtitlesHandler/XML-RPC/Values/XmlRpcValueArray.cs121
-rw-r--r--OpenSubtitlesHandler/XML-RPC/Values/XmlRpcValueBasic.cs99
-rw-r--r--OpenSubtitlesHandler/XML-RPC/Values/XmlRpcValueStruct.cs43
-rw-r--r--OpenSubtitlesHandler/XML-RPC/XmlRpcGenerator.cs350
-rw-r--r--RSSDP/Properties/AssemblyInfo.cs4
-rw-r--r--deployment/debian-package-x64/pkg-src/conf/jellyfin11
-rw-r--r--deployment/debian-package-x64/pkg-src/jellyfin.init62
-rw-r--r--deployment/debian-package-x64/pkg-src/jellyfin.service2
-rw-r--r--deployment/fedora-package-x64/pkg-src/jellyfin.env9
-rw-r--r--deployment/fedora-package-x64/pkg-src/jellyfin.service2
-rw-r--r--jellyfin.ruleset8
-rw-r--r--new-file-header.txt22
236 files changed, 4769 insertions, 9281 deletions
diff --git a/.ci/azure-pipelines.yml b/.ci/azure-pipelines.yml
index 4cd19dc83..7a92d4088 100644
--- a/.ci/azure-pipelines.yml
+++ b/.ci/azure-pipelines.yml
@@ -11,9 +11,6 @@ pr:
trigger:
batch: true
- branches:
- include:
- - master
jobs:
- job: main_build
@@ -71,28 +68,28 @@ jobs:
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact Naming'
- condition: eq(variables['BuildConfiguration'], 'Release')
+ condition: and(eq(variables['BuildConfiguration'], 'Release'), succeeded())
inputs:
PathtoPublish: '$(build.artifactstagingdirectory)/Jellyfin.Server/Emby.Naming.dll'
artifactName: 'Jellyfin.Naming'
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact Controller'
- condition: eq(variables['BuildConfiguration'], 'Release')
+ condition: and(eq(variables['BuildConfiguration'], 'Release'), succeeded())
inputs:
PathtoPublish: '$(build.artifactstagingdirectory)/Jellyfin.Server/MediaBrowser.Controller.dll'
artifactName: 'Jellyfin.Controller'
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact Model'
- condition: eq(variables['BuildConfiguration'], 'Release')
+ condition: and(eq(variables['BuildConfiguration'], 'Release'), succeeded())
inputs:
PathtoPublish: '$(build.artifactstagingdirectory)/Jellyfin.Server/MediaBrowser.Model.dll'
artifactName: 'Jellyfin.Model'
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact Common'
- condition: eq(variables['BuildConfiguration'], 'Release')
+ condition: and(eq(variables['BuildConfiguration'], 'Release'), succeeded())
inputs:
PathtoPublish: '$(build.artifactstagingdirectory)/Jellyfin.Server/MediaBrowser.Common.dll'
artifactName: 'Jellyfin.Common'
@@ -102,7 +99,7 @@ jobs:
pool:
vmImage: ubuntu-16.04
dependsOn: main_build
- condition: succeeded()
+ condition: and(succeeded(), variables['System.PullRequest.PullRequestNumber']) # Only execute if the pullrequest numer is defined. (So not for normal CI builds)
strategy:
matrix:
Naming:
@@ -121,16 +118,28 @@ jobs:
steps:
- checkout: none
- - task: NuGetCommand@2
- displayName: 'Download $(NugetPackageName)'
+ - task: DownloadBuildArtifacts@0
+ displayName: Download the Reference Assembly Build Artifact
inputs:
- command: custom
- arguments: 'install $(NugetPackageName) -OutputDirectory $(System.ArtifactsDirectory)/packages -ExcludeVersion -DirectDownload'
+ buildType: 'specific' # Options: current, specific
+ project: $(System.TeamProjectId) # Required when buildType == Specific
+ pipeline: $(System.DefinitionId) # Required when buildType == Specific, not sure if this will take a name too
+ #specificBuildWithTriggering: false # Optional
+ buildVersionToDownload: 'latestFromBranch' # Required when buildType == Specific# Options: latest, latestFromBranch, specific
+ allowPartiallySucceededBuilds: false # Optional
+ branchName: '$(System.PullRequest.TargetBranch)' # Required when buildType == Specific && BuildVersionToDownload == LatestFromBranch
+ #buildId: # Required when buildType == Specific && BuildVersionToDownload == Specific
+ #tags: # Optional
+ downloadType: 'single' # Options: single, specific
+ artifactName: '$(NugetPackageName)'# Required when downloadType == Single
+ #itemPattern: '**' # Optional
+ downloadPath: '$(System.ArtifactsDirectory)/current-artifacts'
+ #parallelizationLimit: '8' # Optional
- task: CopyFiles@2
displayName: Copy Nuget Assembly to current-release folder
inputs:
- sourceFolder: $(System.ArtifactsDirectory)/packages/$(NugetPackageName) # Optional
+ sourceFolder: $(System.ArtifactsDirectory)/current-artifacts # Optional
contents: '**/*.dll'
targetFolder: $(System.ArtifactsDirectory)/current-release
cleanTargetFolder: true # Optional
@@ -138,7 +147,7 @@ jobs:
flattenFolders: true # Optional
- task: DownloadBuildArtifacts@0
- displayName: Download the Assembly Build Artifact
+ displayName: Download the New Assembly Build Artifact
inputs:
buildType: 'current' # Options: current, specific
allowPartiallySucceededBuilds: false # Optional
diff --git a/.drone.yml b/.drone.yml
index 7705f4f93..87c8e414e 100644
--- a/.drone.yml
+++ b/.drone.yml
@@ -28,84 +28,3 @@ steps:
commands:
- dotnet publish "Jellyfin.Server" --configuration Release --output "../ci/ci-release"
----
-
-kind: pipeline
-name: check-abi
-
-steps:
-- name: submodules
- image: docker:git
- commands:
- - git submodule update --init --recursive
-
-- name: build
- image: microsoft/dotnet:2-sdk
- commands:
- - dotnet publish "Jellyfin.Server" --configuration Release --output "../ci/ci-release"
-
-- name: clone-dotnet-compat
- image: docker:git
- commands:
- - git clone --depth 1 https://github.com/EraYaN/dotnet-compatibility ci/dotnet-compatibility
-
-- name: build-dotnet-compat
- image: microsoft/dotnet:2-sdk
- commands:
- - dotnet publish "ci/dotnet-compatibility/CompatibilityCheckerCoreCLI" --configuration Release --output "../../ci-tools"
-
-- name: download-last-nuget-release-common
- image: plugins/download
- settings:
- source: https://www.nuget.org/api/v2/package/Jellyfin.Common
- destination: ci/Jellyfin.Common.nupkg
-
-- name: download-last-nuget-release-model
- image: plugins/download
- settings:
- source: https://www.nuget.org/api/v2/package/Jellyfin.Model
- destination: ci/Jellyfin.Model.nupkg
-
-- name: download-last-nuget-release-controller
- image: plugins/download
- settings:
- source: https://www.nuget.org/api/v2/package/Jellyfin.Controller
- destination: ci/Jellyfin.Controller.nupkg
-
-- name: download-last-nuget-release-naming
- image: plugins/download
- settings:
- source: https://www.nuget.org/api/v2/package/Jellyfin.Naming
- destination: ci/Jellyfin.Naming.nupkg
-
-- name: extract-downloaded-nuget-packages
- image: garthk/unzip
- commands:
- - unzip -j ci/Jellyfin.Common.nupkg "*.dll" -d ci/nuget-packages
- - unzip -j ci/Jellyfin.Model.nupkg "*.dll" -d ci/nuget-packages
- - unzip -j ci/Jellyfin.Controller.nupkg "*.dll" -d ci/nuget-packages
- - unzip -j ci/Jellyfin.Naming.nupkg "*.dll" -d ci/nuget-packages
-
-- name: run-dotnet-compat-common
- image: microsoft/dotnet:2-runtime
- err_ignore: true
- commands:
- - dotnet ci/ci-tools/CompatibilityCheckerCoreCLI.dll ci/nuget-packages/MediaBrowser.Common.dll ci/ci-release/MediaBrowser.Common.dll
-
-- name: run-dotnet-compat-model
- image: microsoft/dotnet:2-runtime
- err_ignore: true
- commands:
- - dotnet ci/ci-tools/CompatibilityCheckerCoreCLI.dll ci/nuget-packages/MediaBrowser.Model.dll ci/ci-release/MediaBrowser.Model.dll
-
-- name: run-dotnet-compat-controller
- image: microsoft/dotnet:2-runtime
- err_ignore: true
- commands:
- - dotnet ci/ci-tools/CompatibilityCheckerCoreCLI.dll ci/nuget-packages/MediaBrowser.Controller.dll ci/ci-release/MediaBrowser.Controller.dll
-
-- name: run-dotnet-compat-naming
- image: microsoft/dotnet:2-runtime
- err_ignore: true
- commands:
- - dotnet ci/ci-tools/CompatibilityCheckerCoreCLI.dll ci/nuget-packages/Emby.Naming.dll ci/ci-release/Emby.Naming.dll
diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md
index 137a689e8..ca89c1cb9 100644
--- a/.github/ISSUE_TEMPLATE/bug_report.md
+++ b/.github/ISSUE_TEMPLATE/bug_report.md
@@ -30,6 +30,7 @@ assignees: ''
- OS: [e.g. Docker, Debian, Windows]
- Browser: [e.g. Firefox, Chrome, Safari]
- Jellyfin Version: [e.g. 10.0.1]
+ - Reverse proxy: [e.g. no, nginx, apache, etc.]
**Additional context**
<!-- Add any other context about the problem here. -->
diff --git a/.gitignore b/.gitignore
index 65e47747e..a1b7ac59c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -266,3 +266,6 @@ deployment/collect-dist/
jellyfin_version.ini
ci/
+
+# Doxygen
+doc/ \ No newline at end of file
diff --git a/BDInfo/Properties/AssemblyInfo.cs b/BDInfo/Properties/AssemblyInfo.cs
index 788cf7366..f65c7036a 100644
--- a/BDInfo/Properties/AssemblyInfo.cs
+++ b/BDInfo/Properties/AssemblyInfo.cs
@@ -9,8 +9,8 @@ using System.Runtime.InteropServices;
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Jellyfin Project")]
-[assembly: AssemblyProduct("Jellyfin: The Free Software Media System")]
-[assembly: AssemblyCopyright("Copyright © 2016 CinemaSquid. Copyright © 2019 Jellyfin Contributors. Code released under the GNU General Public License Version 2")]
+[assembly: AssemblyProduct("Jellyfin Server")]
+[assembly: AssemblyCopyright("Copyright © 2016 CinemaSquid. Copyright © 2019 Jellyfin Contributors. Code released under the GNU General Public License")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: NeutralResourcesLanguage("en")]
diff --git a/Dockerfile b/Dockerfile
index 91a4f5a2d..5794bdde1 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -15,7 +15,7 @@ RUN apt-get update \
libfontconfig1 \
&& apt-get clean autoclean \
&& apt-get autoremove \
- && rm -rf /var/lib/{apt,dpkg,cache,log} \
+ && rm -rf /var/lib/apt/lists/* \
&& mkdir -p /cache /config /media \
&& chmod 777 /cache /config /media
COPY --from=ffmpeg / /
@@ -31,5 +31,4 @@ VOLUME /cache /config /media
ENTRYPOINT dotnet /jellyfin/jellyfin.dll \
--datadir /config \
--cachedir /cache \
- --ffmpeg /usr/local/bin/ffmpeg \
- --ffprobe /usr/local/bin/ffprobe
+ --ffmpeg /usr/local/bin/ffmpeg
diff --git a/Dockerfile.arm b/Dockerfile.arm
index 42f0354a3..1497da0ef 100644
--- a/Dockerfile.arm
+++ b/Dockerfile.arm
@@ -25,6 +25,7 @@ FROM microsoft/dotnet:${DOTNET_VERSION}-runtime-stretch-slim-arm32v7
COPY --from=qemu_extract qemu-arm-static /usr/bin
RUN apt-get update \
&& apt-get install --no-install-recommends --no-install-suggests -y ffmpeg \
+ && rm -rf /var/lib/apt/lists/* \
&& mkdir -p /cache /config /media \
&& chmod 777 /cache /config /media
COPY --from=builder /jellyfin /jellyfin
@@ -39,5 +40,4 @@ VOLUME /cache /config /media
ENTRYPOINT dotnet /jellyfin/jellyfin.dll \
--datadir /config \
--cachedir /cache \
- --ffmpeg /usr/bin/ffmpeg \
- --ffprobe /usr/bin/ffprobe
+ --ffmpeg /usr/bin/ffmpeg
diff --git a/Dockerfile.arm64 b/Dockerfile.arm64
index d3103d389..f4658a055 100644
--- a/Dockerfile.arm64
+++ b/Dockerfile.arm64
@@ -26,6 +26,7 @@ FROM microsoft/dotnet:${DOTNET_VERSION}-runtime-stretch-slim-arm64v8
COPY --from=qemu_extract qemu-aarch64-static /usr/bin
RUN apt-get update \
&& apt-get install --no-install-recommends --no-install-suggests -y ffmpeg \
+ && rm -rf /var/lib/apt/lists/* \
&& mkdir -p /cache /config /media \
&& chmod 777 /cache /config /media
COPY --from=builder /jellyfin /jellyfin
@@ -40,5 +41,4 @@ VOLUME /cache /config /media
ENTRYPOINT dotnet /jellyfin/jellyfin.dll \
--datadir /config \
--cachedir /cache \
- --ffmpeg /usr/bin/ffmpeg \
- --ffprobe /usr/bin/ffprobe
+ --ffmpeg /usr/bin/ffmpeg
diff --git a/Doxyfile b/Doxyfile
new file mode 100644
index 000000000..1628b4bde
--- /dev/null
+++ b/Doxyfile
@@ -0,0 +1,2565 @@
+# Doxyfile 1.8.15
+
+# This file describes the settings to be used by the documentation system
+# doxygen (www.doxygen.org) for a project.
+#
+# All text after a double hash (##) is considered a comment and is placed in
+# front of the TAG it is preceding.
+#
+# All text after a single hash (#) is considered a comment and will be ignored.
+# The format is:
+# TAG = value [value, ...]
+# For lists, items can also be appended using:
+# TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (\" \").
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+
+# This tag specifies the encoding used for all characters in the configuration
+# file that follow. The default is UTF-8 which is also the encoding used for all
+# text before the first occurrence of this tag. Doxygen uses libiconv (or the
+# iconv built into libc) for the transcoding. See
+# https://www.gnu.org/software/libiconv/ for the list of possible encodings.
+# The default value is: UTF-8.
+
+DOXYFILE_ENCODING = UTF-8
+
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by
+# double-quotes, unless you are using Doxywizard) that should identify the
+# project for which the documentation is generated. This name is used in the
+# title of most generated pages and in a few other places.
+# The default value is: My Project.
+
+PROJECT_NAME = Jellyfin
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number. This
+# could be handy for archiving the generated documentation or if some version
+# control system is used.
+
+PROJECT_NUMBER =
+
+# Using the PROJECT_BRIEF tag one can provide an optional one line description
+# for a project that appears at the top of each page and should give viewer a
+# quick idea about the purpose of the project. Keep the description short.
+
+PROJECT_BRIEF = "The Free Software Media System"
+
+# With the PROJECT_LOGO tag one can specify a logo or an icon that is included
+# in the documentation. The maximum height of the logo should not exceed 55
+# pixels and the maximum width should not exceed 200 pixels. Doxygen will copy
+# the logo to the output directory.
+
+PROJECT_LOGO =
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path
+# into which the generated documentation will be written. If a relative path is
+# entered, it will be relative to the location where doxygen was started. If
+# left blank the current directory will be used.
+
+OUTPUT_DIRECTORY = doc
+
+# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub-
+# directories (in 2 levels) under the output directory of each output format and
+# will distribute the generated files over these directories. Enabling this
+# option can be useful when feeding doxygen a huge amount of source files, where
+# putting all generated files in the same directory would otherwise causes
+# performance problems for the file system.
+# The default value is: NO.
+
+CREATE_SUBDIRS = NO
+
+# If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII
+# characters to appear in the names of generated files. If set to NO, non-ASCII
+# characters will be escaped, for example _xE3_x81_x84 will be used for Unicode
+# U+3044.
+# The default value is: NO.
+
+ALLOW_UNICODE_NAMES = NO
+
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all
+# documentation generated by doxygen is written. Doxygen will use this
+# information to generate all constant output in the proper language.
+# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese,
+# Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States),
+# Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian,
+# Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages),
+# Korean, Korean-en (Korean with English messages), Latvian, Lithuanian,
+# Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian,
+# Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish,
+# Ukrainian and Vietnamese.
+# The default value is: English.
+
+OUTPUT_LANGUAGE = English
+
+# The OUTPUT_TEXT_DIRECTION tag is used to specify the direction in which all
+# documentation generated by doxygen is written. Doxygen will use this
+# information to generate all generated output in the proper direction.
+# Possible values are: None, LTR, RTL and Context.
+# The default value is: None.
+
+OUTPUT_TEXT_DIRECTION = None
+
+# If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member
+# descriptions after the members that are listed in the file and class
+# documentation (similar to Javadoc). Set to NO to disable this.
+# The default value is: YES.
+
+BRIEF_MEMBER_DESC = YES
+
+# If the REPEAT_BRIEF tag is set to YES, doxygen will prepend the brief
+# description of a member or function before the detailed description
+#
+# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
+# brief descriptions will be completely suppressed.
+# The default value is: YES.
+
+REPEAT_BRIEF = YES
+
+# This tag implements a quasi-intelligent brief description abbreviator that is
+# used to form the text in various listings. Each string in this list, if found
+# as the leading text of the brief description, will be stripped from the text
+# and the result, after processing the whole list, is used as the annotated
+# text. Otherwise, the brief description is used as-is. If left blank, the
+# following values are used ($name is automatically replaced with the name of
+# the entity):The $name class, The $name widget, The $name file, is, provides,
+# specifies, contains, represents, a, an and the.
+
+ABBREVIATE_BRIEF = "The $name class" \
+ "The $name widget" \
+ "The $name file" \
+ is \
+ provides \
+ specifies \
+ contains \
+ represents \
+ a \
+ an \
+ the
+
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
+# doxygen will generate a detailed section even if there is only a brief
+# description.
+# The default value is: NO.
+
+ALWAYS_DETAILED_SEC = NO
+
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
+# inherited members of a class in the documentation of that class as if those
+# members were ordinary class members. Constructors, destructors and assignment
+# operators of the base classes will not be shown.
+# The default value is: NO.
+
+INLINE_INHERITED_MEMB = NO
+
+# If the FULL_PATH_NAMES tag is set to YES, doxygen will prepend the full path
+# before files name in the file list and in the header files. If set to NO the
+# shortest path that makes the file name unique will be used
+# The default value is: YES.
+
+FULL_PATH_NAMES = YES
+
+# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path.
+# Stripping is only done if one of the specified strings matches the left-hand
+# part of the path. The tag can be used to show relative paths in the file list.
+# If left blank the directory from which doxygen is run is used as the path to
+# strip.
+#
+# Note that you can specify absolute paths here, but also relative paths, which
+# will be relative from the directory where doxygen is started.
+# This tag requires that the tag FULL_PATH_NAMES is set to YES.
+
+STRIP_FROM_PATH =
+
+# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the
+# path mentioned in the documentation of a class, which tells the reader which
+# header file to include in order to use a class. If left blank only the name of
+# the header file containing the class definition is used. Otherwise one should
+# specify the list of include paths that are normally passed to the compiler
+# using the -I flag.
+
+STRIP_FROM_INC_PATH =
+
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but
+# less readable) file names. This can be useful is your file systems doesn't
+# support long names like on DOS, Mac, or CD-ROM.
+# The default value is: NO.
+
+SHORT_NAMES = NO
+
+# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the
+# first line (until the first dot) of a Javadoc-style comment as the brief
+# description. If set to NO, the Javadoc-style will behave just like regular Qt-
+# style comments (thus requiring an explicit @brief command for a brief
+# description.)
+# The default value is: NO.
+
+JAVADOC_AUTOBRIEF = NO
+
+# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first
+# line (until the first dot) of a Qt-style comment as the brief description. If
+# set to NO, the Qt-style will behave just like regular Qt-style comments (thus
+# requiring an explicit \brief command for a brief description.)
+# The default value is: NO.
+
+QT_AUTOBRIEF = NO
+
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a
+# multi-line C++ special comment block (i.e. a block of //! or /// comments) as
+# a brief description. This used to be the default behavior. The new default is
+# to treat a multi-line C++ comment block as a detailed description. Set this
+# tag to YES if you prefer the old behavior instead.
+#
+# Note that setting this tag to YES also means that rational rose comments are
+# not recognized any more.
+# The default value is: NO.
+
+MULTILINE_CPP_IS_BRIEF = NO
+
+# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the
+# documentation from any documented member that it re-implements.
+# The default value is: YES.
+
+INHERIT_DOCS = YES
+
+# If the SEPARATE_MEMBER_PAGES tag is set to YES then doxygen will produce a new
+# page for each member. If set to NO, the documentation of a member will be part
+# of the file/class/namespace that contains it.
+# The default value is: NO.
+
+SEPARATE_MEMBER_PAGES = NO
+
+# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen
+# uses this value to replace tabs by spaces in code fragments.
+# Minimum value: 1, maximum value: 16, default value: 4.
+
+TAB_SIZE = 4
+
+# This tag can be used to specify a number of aliases that act as commands in
+# the documentation. An alias has the form:
+# name=value
+# For example adding
+# "sideeffect=@par Side Effects:\n"
+# will allow you to put the command \sideeffect (or @sideeffect) in the
+# documentation, which will result in a user-defined paragraph with heading
+# "Side Effects:". You can put \n's in the value part of an alias to insert
+# newlines (in the resulting output). You can put ^^ in the value part of an
+# alias to insert a newline as if a physical newline was in the original file.
+# When you need a literal { or } or , in the value part of an alias you have to
+# escape them by means of a backslash (\), this can lead to conflicts with the
+# commands \{ and \} for these it is advised to use the version @{ and @} or use
+# a double escape (\\{ and \\})
+
+ALIASES =
+
+# This tag can be used to specify a number of word-keyword mappings (TCL only).
+# A mapping has the form "name=value". For example adding "class=itcl::class"
+# will allow you to use the command class in the itcl::class meaning.
+
+TCL_SUBST =
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources
+# only. Doxygen will then generate output that is more tailored for C. For
+# instance, some of the names that are used will be different. The list of all
+# members will be omitted, etc.
+# The default value is: NO.
+
+OPTIMIZE_OUTPUT_FOR_C = NO
+
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or
+# Python sources only. Doxygen will then generate output that is more tailored
+# for that language. For instance, namespaces will be presented as packages,
+# qualified scopes will look different, etc.
+# The default value is: NO.
+
+OPTIMIZE_OUTPUT_JAVA = YES
+
+# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
+# sources. Doxygen will then generate output that is tailored for Fortran.
+# The default value is: NO.
+
+OPTIMIZE_FOR_FORTRAN = NO
+
+# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
+# sources. Doxygen will then generate output that is tailored for VHDL.
+# The default value is: NO.
+
+OPTIMIZE_OUTPUT_VHDL = NO
+
+# Set the OPTIMIZE_OUTPUT_SLICE tag to YES if your project consists of Slice
+# sources only. Doxygen will then generate output that is more tailored for that
+# language. For instance, namespaces will be presented as modules, types will be
+# separated into more groups, etc.
+# The default value is: NO.
+
+OPTIMIZE_OUTPUT_SLICE = NO
+
+# Doxygen selects the parser to use depending on the extension of the files it
+# parses. With this tag you can assign which parser to use for a given
+# extension. Doxygen has a built-in mapping, but you can override or extend it
+# using this tag. The format is ext=language, where ext is a file extension, and
+# language is one of the parsers supported by doxygen: IDL, Java, Javascript,
+# Csharp (C#), C, C++, D, PHP, md (Markdown), Objective-C, Python, Slice,
+# Fortran (fixed format Fortran: FortranFixed, free formatted Fortran:
+# FortranFree, unknown formatted Fortran: Fortran. In the later case the parser
+# tries to guess whether the code is fixed or free formatted code, this is the
+# default for Fortran type files), VHDL, tcl. For instance to make doxygen treat
+# .inc files as Fortran files (default is PHP), and .f files as C (default is
+# Fortran), use: inc=Fortran f=C.
+#
+# Note: For files without extension you can use no_extension as a placeholder.
+#
+# Note that for custom extensions you also need to set FILE_PATTERNS otherwise
+# the files are not read by doxygen.
+
+EXTENSION_MAPPING =
+
+# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments
+# according to the Markdown format, which allows for more readable
+# documentation. See https://daringfireball.net/projects/markdown/ for details.
+# The output of markdown processing is further processed by doxygen, so you can
+# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in
+# case of backward compatibilities issues.
+# The default value is: YES.
+
+MARKDOWN_SUPPORT = YES
+
+# When the TOC_INCLUDE_HEADINGS tag is set to a non-zero value, all headings up
+# to that level are automatically included in the table of contents, even if
+# they do not have an id attribute.
+# Note: This feature currently applies only to Markdown headings.
+# Minimum value: 0, maximum value: 99, default value: 0.
+# This tag requires that the tag MARKDOWN_SUPPORT is set to YES.
+
+TOC_INCLUDE_HEADINGS = 0
+
+# When enabled doxygen tries to link words that correspond to documented
+# classes, or namespaces to their corresponding documentation. Such a link can
+# be prevented in individual cases by putting a % sign in front of the word or
+# globally by setting AUTOLINK_SUPPORT to NO.
+# The default value is: YES.
+
+AUTOLINK_SUPPORT = YES
+
+# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
+# to include (a tag file for) the STL sources as input, then you should set this
+# tag to YES in order to let doxygen match functions declarations and
+# definitions whose arguments contain STL classes (e.g. func(std::string);
+# versus func(std::string) {}). This also make the inheritance and collaboration
+# diagrams that involve STL classes more complete and accurate.
+# The default value is: NO.
+
+BUILTIN_STL_SUPPORT = NO
+
+# If you use Microsoft's C++/CLI language, you should set this option to YES to
+# enable parsing support.
+# The default value is: NO.
+
+CPP_CLI_SUPPORT = NO
+
+# Set the SIP_SUPPORT tag to YES if your project consists of sip (see:
+# https://www.riverbankcomputing.com/software/sip/intro) sources only. Doxygen
+# will parse them like normal C++ but will assume all classes use public instead
+# of private inheritance when no explicit protection keyword is present.
+# The default value is: NO.
+
+SIP_SUPPORT = NO
+
+# For Microsoft's IDL there are propget and propput attributes to indicate
+# getter and setter methods for a property. Setting this option to YES will make
+# doxygen to replace the get and set methods by a property in the documentation.
+# This will only work if the methods are indeed getting or setting a simple
+# type. If this is not the case, or you want to show the methods anyway, you
+# should set this option to NO.
+# The default value is: YES.
+
+IDL_PROPERTY_SUPPORT = YES
+
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
+# tag is set to YES then doxygen will reuse the documentation of the first
+# member in the group (if any) for the other members of the group. By default
+# all members of a group must be documented explicitly.
+# The default value is: NO.
+
+DISTRIBUTE_GROUP_DOC = NO
+
+# If one adds a struct or class to a group and this option is enabled, then also
+# any nested class or struct is added to the same group. By default this option
+# is disabled and one has to add nested compounds explicitly via \ingroup.
+# The default value is: NO.
+
+GROUP_NESTED_COMPOUNDS = NO
+
+# Set the SUBGROUPING tag to YES to allow class member groups of the same type
+# (for instance a group of public functions) to be put as a subgroup of that
+# type (e.g. under the Public Functions section). Set it to NO to prevent
+# subgrouping. Alternatively, this can be done per class using the
+# \nosubgrouping command.
+# The default value is: YES.
+
+SUBGROUPING = YES
+
+# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions
+# are shown inside the group in which they are included (e.g. using \ingroup)
+# instead of on a separate page (for HTML and Man pages) or section (for LaTeX
+# and RTF).
+#
+# Note that this feature does not work in combination with
+# SEPARATE_MEMBER_PAGES.
+# The default value is: NO.
+
+INLINE_GROUPED_CLASSES = NO
+
+# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions
+# with only public data fields or simple typedef fields will be shown inline in
+# the documentation of the scope in which they are defined (i.e. file,
+# namespace, or group documentation), provided this scope is documented. If set
+# to NO, structs, classes, and unions are shown on a separate page (for HTML and
+# Man pages) or section (for LaTeX and RTF).
+# The default value is: NO.
+
+INLINE_SIMPLE_STRUCTS = NO
+
+# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or
+# enum is documented as struct, union, or enum with the name of the typedef. So
+# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
+# with name TypeT. When disabled the typedef will appear as a member of a file,
+# namespace, or class. And the struct will be named TypeS. This can typically be
+# useful for C code in case the coding convention dictates that all compound
+# types are typedef'ed and only the typedef is referenced, never the tag name.
+# The default value is: NO.
+
+TYPEDEF_HIDES_STRUCT = NO
+
+# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This
+# cache is used to resolve symbols given their name and scope. Since this can be
+# an expensive process and often the same symbol appears multiple times in the
+# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small
+# doxygen will become slower. If the cache is too large, memory is wasted. The
+# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range
+# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536
+# symbols. At the end of a run doxygen will report the cache usage and suggest
+# the optimal cache size from a speed point of view.
+# Minimum value: 0, maximum value: 9, default value: 0.
+
+LOOKUP_CACHE_SIZE = 0
+
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+
+# If the EXTRACT_ALL tag is set to YES, doxygen will assume all entities in
+# documentation are documented, even if no documentation was available. Private
+# class members and static file members will be hidden unless the
+# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES.
+# Note: This will also disable the warnings about undocumented members that are
+# normally produced when WARNINGS is set to YES.
+# The default value is: NO.
+
+EXTRACT_ALL = YES
+
+# If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will
+# be included in the documentation.
+# The default value is: NO.
+
+EXTRACT_PRIVATE = NO
+
+# If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal
+# scope will be included in the documentation.
+# The default value is: NO.
+
+EXTRACT_PACKAGE = NO
+
+# If the EXTRACT_STATIC tag is set to YES, all static members of a file will be
+# included in the documentation.
+# The default value is: NO.
+
+EXTRACT_STATIC = NO
+
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined
+# locally in source files will be included in the documentation. If set to NO,
+# only classes defined in header files are included. Does not have any effect
+# for Java sources.
+# The default value is: YES.
+
+EXTRACT_LOCAL_CLASSES = YES
+
+# This flag is only useful for Objective-C code. If set to YES, local methods,
+# which are defined in the implementation section but not in the interface are
+# included in the documentation. If set to NO, only methods in the interface are
+# included.
+# The default value is: NO.
+
+EXTRACT_LOCAL_METHODS = NO
+
+# If this flag is set to YES, the members of anonymous namespaces will be
+# extracted and appear in the documentation as a namespace called
+# 'anonymous_namespace{file}', where file will be replaced with the base name of
+# the file that contains the anonymous namespace. By default anonymous namespace
+# are hidden.
+# The default value is: NO.
+
+EXTRACT_ANON_NSPACES = NO
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all
+# undocumented members inside documented classes or files. If set to NO these
+# members will be included in the various overviews, but no documentation
+# section is generated. This option has no effect if EXTRACT_ALL is enabled.
+# The default value is: NO.
+
+HIDE_UNDOC_MEMBERS = NO
+
+# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all
+# undocumented classes that are normally visible in the class hierarchy. If set
+# to NO, these classes will be included in the various overviews. This option
+# has no effect if EXTRACT_ALL is enabled.
+# The default value is: NO.
+
+HIDE_UNDOC_CLASSES = NO
+
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend
+# (class|struct|union) declarations. If set to NO, these declarations will be
+# included in the documentation.
+# The default value is: NO.
+
+HIDE_FRIEND_COMPOUNDS = NO
+
+# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any
+# documentation blocks found inside the body of a function. If set to NO, these
+# blocks will be appended to the function's detailed documentation block.
+# The default value is: NO.
+
+HIDE_IN_BODY_DOCS = NO
+
+# The INTERNAL_DOCS tag determines if documentation that is typed after a
+# \internal command is included. If the tag is set to NO then the documentation
+# will be excluded. Set it to YES to include the internal documentation.
+# The default value is: NO.
+
+INTERNAL_DOCS = NO
+
+# If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file
+# names in lower-case letters. If set to YES, upper-case letters are also
+# allowed. This is useful if you have classes or files whose names only differ
+# in case and if your file system supports case sensitive file names. Windows
+# and Mac users are advised to set this option to NO.
+# The default value is: system dependent.
+
+CASE_SENSE_NAMES = NO
+
+# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with
+# their full class and namespace scopes in the documentation. If set to YES, the
+# scope will be hidden.
+# The default value is: NO.
+
+HIDE_SCOPE_NAMES = NO
+
+# If the HIDE_COMPOUND_REFERENCE tag is set to NO (default) then doxygen will
+# append additional text to a page's title, such as Class Reference. If set to
+# YES the compound reference will be hidden.
+# The default value is: NO.
+
+HIDE_COMPOUND_REFERENCE= NO
+
+# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of
+# the files that are included by a file in the documentation of that file.
+# The default value is: YES.
+
+SHOW_INCLUDE_FILES = YES
+
+# If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each
+# grouped member an include statement to the documentation, telling the reader
+# which file to include in order to use the member.
+# The default value is: NO.
+
+SHOW_GROUPED_MEMB_INC = NO
+
+# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include
+# files with double quotes in the documentation rather than with sharp brackets.
+# The default value is: NO.
+
+FORCE_LOCAL_INCLUDES = NO
+
+# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the
+# documentation for inline members.
+# The default value is: YES.
+
+INLINE_INFO = YES
+
+# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the
+# (detailed) documentation of file and class members alphabetically by member
+# name. If set to NO, the members will appear in declaration order.
+# The default value is: YES.
+
+SORT_MEMBER_DOCS = YES
+
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief
+# descriptions of file, namespace and class members alphabetically by member
+# name. If set to NO, the members will appear in declaration order. Note that
+# this will also influence the order of the classes in the class list.
+# The default value is: NO.
+
+SORT_BRIEF_DOCS = NO
+
+# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the
+# (brief and detailed) documentation of class members so that constructors and
+# destructors are listed first. If set to NO the constructors will appear in the
+# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS.
+# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief
+# member documentation.
+# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting
+# detailed member documentation.
+# The default value is: NO.
+
+SORT_MEMBERS_CTORS_1ST = NO
+
+# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy
+# of group names into alphabetical order. If set to NO the group names will
+# appear in their defined order.
+# The default value is: NO.
+
+SORT_GROUP_NAMES = NO
+
+# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by
+# fully-qualified names, including namespaces. If set to NO, the class list will
+# be sorted only by class name, not including the namespace part.
+# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
+# Note: This option applies only to the class list, not to the alphabetical
+# list.
+# The default value is: NO.
+
+SORT_BY_SCOPE_NAME = NO
+
+# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper
+# type resolution of all parameters of a function it will reject a match between
+# the prototype and the implementation of a member function even if there is
+# only one candidate or it is obvious which candidate to choose by doing a
+# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still
+# accept a match between prototype and implementation in such cases.
+# The default value is: NO.
+
+STRICT_PROTO_MATCHING = NO
+
+# The GENERATE_TODOLIST tag can be used to enable (YES) or disable (NO) the todo
+# list. This list is created by putting \todo commands in the documentation.
+# The default value is: YES.
+
+GENERATE_TODOLIST = YES
+
+# The GENERATE_TESTLIST tag can be used to enable (YES) or disable (NO) the test
+# list. This list is created by putting \test commands in the documentation.
+# The default value is: YES.
+
+GENERATE_TESTLIST = YES
+
+# The GENERATE_BUGLIST tag can be used to enable (YES) or disable (NO) the bug
+# list. This list is created by putting \bug commands in the documentation.
+# The default value is: YES.
+
+GENERATE_BUGLIST = YES
+
+# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or disable (NO)
+# the deprecated list. This list is created by putting \deprecated commands in
+# the documentation.
+# The default value is: YES.
+
+GENERATE_DEPRECATEDLIST= YES
+
+# The ENABLED_SECTIONS tag can be used to enable conditional documentation
+# sections, marked by \if <section_label> ... \endif and \cond <section_label>
+# ... \endcond blocks.
+
+ENABLED_SECTIONS =
+
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the
+# initial value of a variable or macro / define can have for it to appear in the
+# documentation. If the initializer consists of more lines than specified here
+# it will be hidden. Use a value of 0 to hide initializers completely. The
+# appearance of the value of individual variables and macros / defines can be
+# controlled using \showinitializer or \hideinitializer command in the
+# documentation regardless of this setting.
+# Minimum value: 0, maximum value: 10000, default value: 30.
+
+MAX_INITIALIZER_LINES = 30
+
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at
+# the bottom of the documentation of classes and structs. If set to YES, the
+# list will mention the files that were used to generate the documentation.
+# The default value is: YES.
+
+SHOW_USED_FILES = YES
+
+# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This
+# will remove the Files entry from the Quick Index and from the Folder Tree View
+# (if specified).
+# The default value is: YES.
+
+SHOW_FILES = YES
+
+# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces
+# page. This will remove the Namespaces entry from the Quick Index and from the
+# Folder Tree View (if specified).
+# The default value is: YES.
+
+SHOW_NAMESPACES = YES
+
+# The FILE_VERSION_FILTER tag can be used to specify a program or script that
+# doxygen should invoke to get the current version for each file (typically from
+# the version control system). Doxygen will invoke the program by executing (via
+# popen()) the command command input-file, where command is the value of the
+# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided
+# by doxygen. Whatever the program writes to standard output is used as the file
+# version. For an example see the documentation.
+
+FILE_VERSION_FILTER =
+
+# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed
+# by doxygen. The layout file controls the global structure of the generated
+# output files in an output format independent way. To create the layout file
+# that represents doxygen's defaults, run doxygen with the -l option. You can
+# optionally specify a file name after the option, if omitted DoxygenLayout.xml
+# will be used as the name of the layout file.
+#
+# Note that if you run doxygen from a directory containing a file called
+# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE
+# tag is left empty.
+
+LAYOUT_FILE =
+
+# The CITE_BIB_FILES tag can be used to specify one or more bib files containing
+# the reference definitions. This must be a list of .bib files. The .bib
+# extension is automatically appended if omitted. This requires the bibtex tool
+# to be installed. See also https://en.wikipedia.org/wiki/BibTeX for more info.
+# For LaTeX the style of the bibliography can be controlled using
+# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the
+# search path. See also \cite for info how to create references.
+
+CITE_BIB_FILES =
+
+#---------------------------------------------------------------------------
+# Configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+
+# The QUIET tag can be used to turn on/off the messages that are generated to
+# standard output by doxygen. If QUIET is set to YES this implies that the
+# messages are off.
+# The default value is: NO.
+
+QUIET = NO
+
+# The WARNINGS tag can be used to turn on/off the warning messages that are
+# generated to standard error (stderr) by doxygen. If WARNINGS is set to YES
+# this implies that the warnings are on.
+#
+# Tip: Turn warnings on while writing the documentation.
+# The default value is: YES.
+
+WARNINGS = YES
+
+# If the WARN_IF_UNDOCUMENTED tag is set to YES then doxygen will generate
+# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag
+# will automatically be disabled.
+# The default value is: YES.
+
+WARN_IF_UNDOCUMENTED = YES
+
+# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for
+# potential errors in the documentation, such as not documenting some parameters
+# in a documented function, or documenting parameters that don't exist or using
+# markup commands wrongly.
+# The default value is: YES.
+
+WARN_IF_DOC_ERROR = YES
+
+# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that
+# are documented, but have no documentation for their parameters or return
+# value. If set to NO, doxygen will only warn about wrong or incomplete
+# parameter documentation, but not about the absence of documentation. If
+# EXTRACT_ALL is set to YES then this flag will automatically be disabled.
+# The default value is: NO.
+
+WARN_NO_PARAMDOC = NO
+
+# If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when
+# a warning is encountered.
+# The default value is: NO.
+
+WARN_AS_ERROR = NO
+
+# The WARN_FORMAT tag determines the format of the warning messages that doxygen
+# can produce. The string should contain the $file, $line, and $text tags, which
+# will be replaced by the file and line number from which the warning originated
+# and the warning text. Optionally the format may contain $version, which will
+# be replaced by the version of the file (if it could be obtained via
+# FILE_VERSION_FILTER)
+# The default value is: $file:$line: $text.
+
+WARN_FORMAT = "$file:$line: $text"
+
+# The WARN_LOGFILE tag can be used to specify a file to which warning and error
+# messages should be written. If left blank the output is written to standard
+# error (stderr).
+
+WARN_LOGFILE =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the input files
+#---------------------------------------------------------------------------
+
+# The INPUT tag is used to specify the files and/or directories that contain
+# documented source files. You may enter file names like myfile.cpp or
+# directories like /usr/src/myproject. Separate the files or directories with
+# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING
+# Note: If this tag is empty the current directory is searched.
+
+INPUT =
+
+# This tag can be used to specify the character encoding of the source files
+# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
+# libiconv (or the iconv built into libc) for the transcoding. See the libiconv
+# documentation (see: https://www.gnu.org/software/libiconv/) for the list of
+# possible encodings.
+# The default value is: UTF-8.
+
+INPUT_ENCODING = UTF-8
+
+# If the value of the INPUT tag contains directories, you can use the
+# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and
+# *.h) to filter out the source-files in the directories.
+#
+# Note that for custom extensions or not directly supported extensions you also
+# need to set EXTENSION_MAPPING for the extension otherwise the files are not
+# read by doxygen.
+#
+# If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp,
+# *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h,
+# *.hh, *.hxx, *.hpp, *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc,
+# *.m, *.markdown, *.md, *.mm, *.dox, *.py, *.pyw, *.f90, *.f95, *.f03, *.f08,
+# *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf, *.qsf and *.ice.
+
+FILE_PATTERNS = *.c \
+ *.cc \
+ *.cxx \
+ *.cpp \
+ *.c++ \
+ *.java \
+ *.ii \
+ *.ixx \
+ *.ipp \
+ *.i++ \
+ *.inl \
+ *.idl \
+ *.ddl \
+ *.odl \
+ *.h \
+ *.hh \
+ *.hxx \
+ *.hpp \
+ *.h++ \
+ *.cs \
+ *.d \
+ *.php \
+ *.php4 \
+ *.php5 \
+ *.phtml \
+ *.inc \
+ *.m \
+ *.markdown \
+ *.md \
+ *.mm \
+ *.dox \
+ *.py \
+ *.pyw \
+ *.f90 \
+ *.f95 \
+ *.f03 \
+ *.f08 \
+ *.f \
+ *.for \
+ *.tcl \
+ *.vhd \
+ *.vhdl \
+ *.ucf \
+ *.qsf \
+ *.ice
+
+# The RECURSIVE tag can be used to specify whether or not subdirectories should
+# be searched for input files as well.
+# The default value is: NO.
+
+RECURSIVE = YES
+
+# The EXCLUDE tag can be used to specify files and/or directories that should be
+# excluded from the INPUT source files. This way you can easily exclude a
+# subdirectory from a directory tree whose root is specified with the INPUT tag.
+#
+# Note that relative paths are relative to the directory from which doxygen is
+# run.
+
+EXCLUDE =
+
+# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
+# directories that are symbolic links (a Unix file system feature) are excluded
+# from the input.
+# The default value is: NO.
+
+EXCLUDE_SYMLINKS = NO
+
+# If the value of the INPUT tag contains directories, you can use the
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
+# certain files from those directories.
+#
+# Note that the wildcards are matched against the file with absolute path, so to
+# exclude all test directories for example use the pattern */test/*
+
+EXCLUDE_PATTERNS =
+
+# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
+# (namespaces, classes, functions, etc.) that should be excluded from the
+# output. The symbol name can be a fully qualified name, a word, or if the
+# wildcard * is used, a substring. Examples: ANamespace, AClass,
+# AClass::ANamespace, ANamespace::*Test
+#
+# Note that the wildcards are matched against the file with absolute path, so to
+# exclude all test directories use the pattern */test/*
+
+EXCLUDE_SYMBOLS =
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or directories
+# that contain example code fragments that are included (see the \include
+# command).
+
+EXAMPLE_PATH =
+
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and
+# *.h) to filter out the source-files in the directories. If left blank all
+# files are included.
+
+EXAMPLE_PATTERNS = *
+
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
+# searched for input files to be used with the \include or \dontinclude commands
+# irrespective of the value of the RECURSIVE tag.
+# The default value is: NO.
+
+EXAMPLE_RECURSIVE = NO
+
+# The IMAGE_PATH tag can be used to specify one or more files or directories
+# that contain images that are to be included in the documentation (see the
+# \image command).
+
+IMAGE_PATH =
+
+# The INPUT_FILTER tag can be used to specify a program that doxygen should
+# invoke to filter for each input file. Doxygen will invoke the filter program
+# by executing (via popen()) the command:
+#
+# <filter> <input-file>
+#
+# where <filter> is the value of the INPUT_FILTER tag, and <input-file> is the
+# name of an input file. Doxygen will then use the output that the filter
+# program writes to standard output. If FILTER_PATTERNS is specified, this tag
+# will be ignored.
+#
+# Note that the filter must not add or remove lines; it is applied before the
+# code is scanned, but not when the output code is generated. If lines are added
+# or removed, the anchors will not be placed correctly.
+#
+# Note that for custom extensions or not directly supported extensions you also
+# need to set EXTENSION_MAPPING for the extension otherwise the files are not
+# properly processed by doxygen.
+
+INPUT_FILTER =
+
+# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
+# basis. Doxygen will compare the file name with each pattern and apply the
+# filter if there is a match. The filters are a list of the form: pattern=filter
+# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how
+# filters are used. If the FILTER_PATTERNS tag is empty or if none of the
+# patterns match the file name, INPUT_FILTER is applied.
+#
+# Note that for custom extensions or not directly supported extensions you also
+# need to set EXTENSION_MAPPING for the extension otherwise the files are not
+# properly processed by doxygen.
+
+FILTER_PATTERNS =
+
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
+# INPUT_FILTER) will also be used to filter the input files that are used for
+# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES).
+# The default value is: NO.
+
+FILTER_SOURCE_FILES = NO
+
+# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file
+# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and
+# it is also possible to disable source filtering for a specific pattern using
+# *.ext= (so without naming a filter).
+# This tag requires that the tag FILTER_SOURCE_FILES is set to YES.
+
+FILTER_SOURCE_PATTERNS =
+
+# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that
+# is part of the input, its contents will be placed on the main page
+# (index.html). This can be useful if you have a project on for instance GitHub
+# and want to reuse the introduction page also for the doxygen output.
+
+USE_MDFILE_AS_MAINPAGE = ./README.md
+
+#---------------------------------------------------------------------------
+# Configuration options related to source browsing
+#---------------------------------------------------------------------------
+
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will be
+# generated. Documented entities will be cross-referenced with these sources.
+#
+# Note: To get rid of all source code in the generated output, make sure that
+# also VERBATIM_HEADERS is set to NO.
+# The default value is: NO.
+
+SOURCE_BROWSER = YES
+
+# Setting the INLINE_SOURCES tag to YES will include the body of functions,
+# classes and enums directly into the documentation.
+# The default value is: NO.
+
+INLINE_SOURCES = NO
+
+# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any
+# special comment blocks from generated source code fragments. Normal C, C++ and
+# Fortran comments will always remain visible.
+# The default value is: YES.
+
+STRIP_CODE_COMMENTS = YES
+
+# If the REFERENCED_BY_RELATION tag is set to YES then for each documented
+# entity all documented functions referencing it will be listed.
+# The default value is: NO.
+
+REFERENCED_BY_RELATION = NO
+
+# If the REFERENCES_RELATION tag is set to YES then for each documented function
+# all documented entities called/used by that function will be listed.
+# The default value is: NO.
+
+REFERENCES_RELATION = NO
+
+# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set
+# to YES then the hyperlinks from functions in REFERENCES_RELATION and
+# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will
+# link to the documentation.
+# The default value is: YES.
+
+REFERENCES_LINK_SOURCE = YES
+
+# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the
+# source code will show a tooltip with additional information such as prototype,
+# brief description and links to the definition and documentation. Since this
+# will make the HTML file larger and loading of large files a bit slower, you
+# can opt to disable this feature.
+# The default value is: YES.
+# This tag requires that the tag SOURCE_BROWSER is set to YES.
+
+SOURCE_TOOLTIPS = YES
+
+# If the USE_HTAGS tag is set to YES then the references to source code will
+# point to the HTML generated by the htags(1) tool instead of doxygen built-in
+# source browser. The htags tool is part of GNU's global source tagging system
+# (see https://www.gnu.org/software/global/global.html). You will need version
+# 4.8.6 or higher.
+#
+# To use it do the following:
+# - Install the latest version of global
+# - Enable SOURCE_BROWSER and USE_HTAGS in the configuration file
+# - Make sure the INPUT points to the root of the source tree
+# - Run doxygen as normal
+#
+# Doxygen will invoke htags (and that will in turn invoke gtags), so these
+# tools must be available from the command line (i.e. in the search path).
+#
+# The result: instead of the source browser generated by doxygen, the links to
+# source code will now point to the output of htags.
+# The default value is: NO.
+# This tag requires that the tag SOURCE_BROWSER is set to YES.
+
+USE_HTAGS = NO
+
+# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a
+# verbatim copy of the header file for each class for which an include is
+# specified. Set to NO to disable this.
+# See also: Section \class.
+# The default value is: YES.
+
+VERBATIM_HEADERS = YES
+
+# If the CLANG_ASSISTED_PARSING tag is set to YES then doxygen will use the
+# clang parser (see: http://clang.llvm.org/) for more accurate parsing at the
+# cost of reduced performance. This can be particularly helpful with template
+# rich C++ code for which doxygen's built-in parser lacks the necessary type
+# information.
+# Note: The availability of this option depends on whether or not doxygen was
+# generated with the -Duse_libclang=ON option for CMake.
+# The default value is: NO.
+
+CLANG_ASSISTED_PARSING = NO
+
+# If clang assisted parsing is enabled you can provide the compiler with command
+# line options that you would normally use when invoking the compiler. Note that
+# the include paths will already be set by doxygen for the files and directories
+# specified with INPUT and INCLUDE_PATH.
+# This tag requires that the tag CLANG_ASSISTED_PARSING is set to YES.
+
+CLANG_OPTIONS =
+
+# If clang assisted parsing is enabled you can provide the clang parser with the
+# path to the compilation database (see:
+# http://clang.llvm.org/docs/HowToSetupToolingForLLVM.html) used when the files
+# were built. This is equivalent to specifying the "-p" option to a clang tool,
+# such as clang-check. These options will then be passed to the parser.
+# Note: The availability of this option depends on whether or not doxygen was
+# generated with the -Duse_libclang=ON option for CMake.
+
+CLANG_DATABASE_PATH =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all
+# compounds will be generated. Enable this if the project contains a lot of
+# classes, structs, unions or interfaces.
+# The default value is: YES.
+
+ALPHABETICAL_INDEX = YES
+
+# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in
+# which the alphabetical index list will be split.
+# Minimum value: 1, maximum value: 20, default value: 5.
+# This tag requires that the tag ALPHABETICAL_INDEX is set to YES.
+
+COLS_IN_ALPHA_INDEX = 5
+
+# In case all classes in a project start with a common prefix, all classes will
+# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag
+# can be used to specify a prefix (or a list of prefixes) that should be ignored
+# while generating the index headers.
+# This tag requires that the tag ALPHABETICAL_INDEX is set to YES.
+
+IGNORE_PREFIX =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the HTML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_HTML tag is set to YES, doxygen will generate HTML output
+# The default value is: YES.
+
+GENERATE_HTML = YES
+
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a
+# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
+# it.
+# The default directory is: html.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_OUTPUT = html
+
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each
+# generated HTML page (for example: .htm, .php, .asp).
+# The default value is: .html.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_FILE_EXTENSION = .html
+
+# The HTML_HEADER tag can be used to specify a user-defined HTML header file for
+# each generated HTML page. If the tag is left blank doxygen will generate a
+# standard header.
+#
+# To get valid HTML the header file that includes any scripts and style sheets
+# that doxygen needs, which is dependent on the configuration options used (e.g.
+# the setting GENERATE_TREEVIEW). It is highly recommended to start with a
+# default header using
+# doxygen -w html new_header.html new_footer.html new_stylesheet.css
+# YourConfigFile
+# and then modify the file new_header.html. See also section "Doxygen usage"
+# for information on how to generate the default header that doxygen normally
+# uses.
+# Note: The header is subject to change so you typically have to regenerate the
+# default header when upgrading to a newer version of doxygen. For a description
+# of the possible markers and block names see the documentation.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_HEADER =
+
+# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each
+# generated HTML page. If the tag is left blank doxygen will generate a standard
+# footer. See HTML_HEADER for more information on how to generate a default
+# footer and what special commands can be used inside the footer. See also
+# section "Doxygen usage" for information on how to generate the default footer
+# that doxygen normally uses.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_FOOTER =
+
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style
+# sheet that is used by each HTML page. It can be used to fine-tune the look of
+# the HTML output. If left blank doxygen will generate a default style sheet.
+# See also section "Doxygen usage" for information on how to generate the style
+# sheet that doxygen normally uses.
+# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as
+# it is more robust and this tag (HTML_STYLESHEET) will in the future become
+# obsolete.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_STYLESHEET =
+
+# The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined
+# cascading style sheets that are included after the standard style sheets
+# created by doxygen. Using this option one can overrule certain style aspects.
+# This is preferred over using HTML_STYLESHEET since it does not replace the
+# standard style sheet and is therefore more robust against future updates.
+# Doxygen will copy the style sheet files to the output directory.
+# Note: The order of the extra style sheet files is of importance (e.g. the last
+# style sheet in the list overrules the setting of the previous ones in the
+# list). For an example see the documentation.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_EXTRA_STYLESHEET =
+
+# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or
+# other source files which should be copied to the HTML output directory. Note
+# that these files will be copied to the base HTML output directory. Use the
+# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these
+# files. In the HTML_STYLESHEET file, use the file name only. Also note that the
+# files will be copied as-is; there are no commands or markers available.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_EXTRA_FILES =
+
+# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen
+# will adjust the colors in the style sheet and background images according to
+# this color. Hue is specified as an angle on a colorwheel, see
+# https://en.wikipedia.org/wiki/Hue for more information. For instance the value
+# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300
+# purple, and 360 is red again.
+# Minimum value: 0, maximum value: 359, default value: 220.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_COLORSTYLE_HUE = 195
+
+# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors
+# in the HTML output. For a value of 0 the output will use grayscales only. A
+# value of 255 will produce the most vivid colors.
+# Minimum value: 0, maximum value: 255, default value: 100.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_COLORSTYLE_SAT = 100
+
+# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the
+# luminance component of the colors in the HTML output. Values below 100
+# gradually make the output lighter, whereas values above 100 make the output
+# darker. The value divided by 100 is the actual gamma applied, so 80 represents
+# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not
+# change the gamma.
+# Minimum value: 40, maximum value: 240, default value: 80.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_COLORSTYLE_GAMMA = 86
+
+# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML
+# page will contain the date and time when the page was generated. Setting this
+# to YES can help to show when doxygen was last run and thus if the
+# documentation is up to date.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_TIMESTAMP = NO
+
+# If the HTML_DYNAMIC_MENUS tag is set to YES then the generated HTML
+# documentation will contain a main index with vertical navigation menus that
+# are dynamically created via Javascript. If disabled, the navigation index will
+# consists of multiple levels of tabs that are statically embedded in every HTML
+# page. Disable this option to support browsers that do not have Javascript,
+# like the Qt help browser.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_DYNAMIC_MENUS = YES
+
+# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
+# documentation will contain sections that can be hidden and shown after the
+# page has loaded.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_DYNAMIC_SECTIONS = NO
+
+# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries
+# shown in the various tree structured indices initially; the user can expand
+# and collapse entries dynamically later on. Doxygen will expand the tree to
+# such a level that at most the specified number of entries are visible (unless
+# a fully collapsed tree already exceeds this amount). So setting the number of
+# entries 1 will produce a full collapsed tree by default. 0 is a special value
+# representing an infinite number of entries and will result in a full expanded
+# tree by default.
+# Minimum value: 0, maximum value: 9999, default value: 100.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_INDEX_NUM_ENTRIES = 100
+
+# If the GENERATE_DOCSET tag is set to YES, additional index files will be
+# generated that can be used as input for Apple's Xcode 3 integrated development
+# environment (see: https://developer.apple.com/xcode/), introduced with OSX
+# 10.5 (Leopard). To create a documentation set, doxygen will generate a
+# Makefile in the HTML output directory. Running make will produce the docset in
+# that directory and running make install will install the docset in
+# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at
+# startup. See https://developer.apple.com/library/archive/featuredarticles/Doxy
+# genXcode/_index.html for more information.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+GENERATE_DOCSET = NO
+
+# This tag determines the name of the docset feed. A documentation feed provides
+# an umbrella under which multiple documentation sets from a single provider
+# (such as a company or product suite) can be grouped.
+# The default value is: Doxygen generated docs.
+# This tag requires that the tag GENERATE_DOCSET is set to YES.
+
+DOCSET_FEEDNAME = "Doxygen generated docs"
+
+# This tag specifies a string that should uniquely identify the documentation
+# set bundle. This should be a reverse domain-name style string, e.g.
+# com.mycompany.MyDocSet. Doxygen will append .docset to the name.
+# The default value is: org.doxygen.Project.
+# This tag requires that the tag GENERATE_DOCSET is set to YES.
+
+DOCSET_BUNDLE_ID = org.doxygen.Project
+
+# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify
+# the documentation publisher. This should be a reverse domain-name style
+# string, e.g. com.mycompany.MyDocSet.documentation.
+# The default value is: org.doxygen.Publisher.
+# This tag requires that the tag GENERATE_DOCSET is set to YES.
+
+DOCSET_PUBLISHER_ID = org.doxygen.Publisher
+
+# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher.
+# The default value is: Publisher.
+# This tag requires that the tag GENERATE_DOCSET is set to YES.
+
+DOCSET_PUBLISHER_NAME = Publisher
+
+# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three
+# additional HTML index files: index.hhp, index.hhc, and index.hhk. The
+# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop
+# (see: https://www.microsoft.com/en-us/download/details.aspx?id=21138) on
+# Windows.
+#
+# The HTML Help Workshop contains a compiler that can convert all HTML output
+# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML
+# files are now used as the Windows 98 help format, and will replace the old
+# Windows help format (.hlp) on all Windows platforms in the future. Compressed
+# HTML files also contain an index, a table of contents, and you can search for
+# words in the documentation. The HTML workshop also contains a viewer for
+# compressed HTML files.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+GENERATE_HTMLHELP = NO
+
+# The CHM_FILE tag can be used to specify the file name of the resulting .chm
+# file. You can add a path in front of the file if the result should not be
+# written to the html output directory.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
+
+CHM_FILE =
+
+# The HHC_LOCATION tag can be used to specify the location (absolute path
+# including file name) of the HTML help compiler (hhc.exe). If non-empty,
+# doxygen will try to run the HTML help compiler on the generated index.hhp.
+# The file has to be specified with full path.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
+
+HHC_LOCATION =
+
+# The GENERATE_CHI flag controls if a separate .chi index file is generated
+# (YES) or that it should be included in the master .chm file (NO).
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
+
+GENERATE_CHI = NO
+
+# The CHM_INDEX_ENCODING is used to encode HtmlHelp index (hhk), content (hhc)
+# and project file content.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
+
+CHM_INDEX_ENCODING =
+
+# The BINARY_TOC flag controls whether a binary table of contents is generated
+# (YES) or a normal table of contents (NO) in the .chm file. Furthermore it
+# enables the Previous and Next buttons.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
+
+BINARY_TOC = NO
+
+# The TOC_EXPAND flag can be set to YES to add extra items for group members to
+# the table of contents of the HTML help documentation and to the tree view.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
+
+TOC_EXPAND = NO
+
+# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and
+# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that
+# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help
+# (.qch) of the generated HTML documentation.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+GENERATE_QHP = NO
+
+# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify
+# the file name of the resulting .qch file. The path specified is relative to
+# the HTML output folder.
+# This tag requires that the tag GENERATE_QHP is set to YES.
+
+QCH_FILE =
+
+# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help
+# Project output. For more information please see Qt Help Project / Namespace
+# (see: http://doc.qt.io/archives/qt-4.8/qthelpproject.html#namespace).
+# The default value is: org.doxygen.Project.
+# This tag requires that the tag GENERATE_QHP is set to YES.
+
+QHP_NAMESPACE = org.doxygen.Project
+
+# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt
+# Help Project output. For more information please see Qt Help Project / Virtual
+# Folders (see: http://doc.qt.io/archives/qt-4.8/qthelpproject.html#virtual-
+# folders).
+# The default value is: doc.
+# This tag requires that the tag GENERATE_QHP is set to YES.
+
+QHP_VIRTUAL_FOLDER = doc
+
+# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom
+# filter to add. For more information please see Qt Help Project / Custom
+# Filters (see: http://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-
+# filters).
+# This tag requires that the tag GENERATE_QHP is set to YES.
+
+QHP_CUST_FILTER_NAME =
+
+# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the
+# custom filter to add. For more information please see Qt Help Project / Custom
+# Filters (see: http://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-
+# filters).
+# This tag requires that the tag GENERATE_QHP is set to YES.
+
+QHP_CUST_FILTER_ATTRS =
+
+# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this
+# project's filter section matches. Qt Help Project / Filter Attributes (see:
+# http://doc.qt.io/archives/qt-4.8/qthelpproject.html#filter-attributes).
+# This tag requires that the tag GENERATE_QHP is set to YES.
+
+QHP_SECT_FILTER_ATTRS =
+
+# The QHG_LOCATION tag can be used to specify the location of Qt's
+# qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the
+# generated .qhp file.
+# This tag requires that the tag GENERATE_QHP is set to YES.
+
+QHG_LOCATION =
+
+# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be
+# generated, together with the HTML files, they form an Eclipse help plugin. To
+# install this plugin and make it available under the help contents menu in
+# Eclipse, the contents of the directory containing the HTML and XML files needs
+# to be copied into the plugins directory of eclipse. The name of the directory
+# within the plugins directory should be the same as the ECLIPSE_DOC_ID value.
+# After copying Eclipse needs to be restarted before the help appears.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+GENERATE_ECLIPSEHELP = NO
+
+# A unique identifier for the Eclipse help plugin. When installing the plugin
+# the directory name containing the HTML and XML files should also have this
+# name. Each documentation set should have its own identifier.
+# The default value is: org.doxygen.Project.
+# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES.
+
+ECLIPSE_DOC_ID = org.doxygen.Project
+
+# If you want full control over the layout of the generated HTML pages it might
+# be necessary to disable the index and replace it with your own. The
+# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top
+# of each HTML page. A value of NO enables the index and the value YES disables
+# it. Since the tabs in the index contain the same information as the navigation
+# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+DISABLE_INDEX = NO
+
+# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
+# structure should be generated to display hierarchical information. If the tag
+# value is set to YES, a side panel will be generated containing a tree-like
+# index structure (just like the one that is generated for HTML Help). For this
+# to work a browser that supports JavaScript, DHTML, CSS and frames is required
+# (i.e. any modern browser). Windows users are probably better off using the
+# HTML help feature. Via custom style sheets (see HTML_EXTRA_STYLESHEET) one can
+# further fine-tune the look of the index. As an example, the default style
+# sheet generated by doxygen has an example that shows how to put an image at
+# the root of the tree instead of the PROJECT_NAME. Since the tree basically has
+# the same information as the tab index, you could consider setting
+# DISABLE_INDEX to YES when enabling this option.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+GENERATE_TREEVIEW = YES
+
+# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that
+# doxygen will group on one line in the generated HTML documentation.
+#
+# Note that a value of 0 will completely suppress the enum values from appearing
+# in the overview section.
+# Minimum value: 0, maximum value: 20, default value: 4.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+ENUM_VALUES_PER_LINE = 4
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used
+# to set the initial width (in pixels) of the frame in which the tree is shown.
+# Minimum value: 0, maximum value: 1500, default value: 250.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+TREEVIEW_WIDTH = 250
+
+# If the EXT_LINKS_IN_WINDOW option is set to YES, doxygen will open links to
+# external symbols imported via tag files in a separate window.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+EXT_LINKS_IN_WINDOW = NO
+
+# Use this tag to change the font size of LaTeX formulas included as images in
+# the HTML documentation. When you change the font size after a successful
+# doxygen run you need to manually remove any form_*.png images from the HTML
+# output directory to force them to be regenerated.
+# Minimum value: 8, maximum value: 50, default value: 10.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+FORMULA_FONTSIZE = 10
+
+# Use the FORMULA_TRANSPARENT tag to determine whether or not the images
+# generated for formulas are transparent PNGs. Transparent PNGs are not
+# supported properly for IE 6.0, but are supported on all modern browsers.
+#
+# Note that when changing this option you need to delete any form_*.png files in
+# the HTML output directory before the changes have effect.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+FORMULA_TRANSPARENT = YES
+
+# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see
+# https://www.mathjax.org) which uses client side Javascript for the rendering
+# instead of using pre-rendered bitmaps. Use this if you do not have LaTeX
+# installed or if you want to formulas look prettier in the HTML output. When
+# enabled you may also need to install MathJax separately and configure the path
+# to it using the MATHJAX_RELPATH option.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+USE_MATHJAX = NO
+
+# When MathJax is enabled you can set the default output format to be used for
+# the MathJax output. See the MathJax site (see:
+# http://docs.mathjax.org/en/latest/output.html) for more details.
+# Possible values are: HTML-CSS (which is slower, but has the best
+# compatibility), NativeMML (i.e. MathML) and SVG.
+# The default value is: HTML-CSS.
+# This tag requires that the tag USE_MATHJAX is set to YES.
+
+MATHJAX_FORMAT = HTML-CSS
+
+# When MathJax is enabled you need to specify the location relative to the HTML
+# output directory using the MATHJAX_RELPATH option. The destination directory
+# should contain the MathJax.js script. For instance, if the mathjax directory
+# is located at the same level as the HTML output directory, then
+# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax
+# Content Delivery Network so you can quickly see the result without installing
+# MathJax. However, it is strongly recommended to install a local copy of
+# MathJax from https://www.mathjax.org before deployment.
+# The default value is: https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/.
+# This tag requires that the tag USE_MATHJAX is set to YES.
+
+MATHJAX_RELPATH = https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/
+
+# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax
+# extension names that should be enabled during MathJax rendering. For example
+# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols
+# This tag requires that the tag USE_MATHJAX is set to YES.
+
+MATHJAX_EXTENSIONS =
+
+# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces
+# of code that will be used on startup of the MathJax code. See the MathJax site
+# (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an
+# example see the documentation.
+# This tag requires that the tag USE_MATHJAX is set to YES.
+
+MATHJAX_CODEFILE =
+
+# When the SEARCHENGINE tag is enabled doxygen will generate a search box for
+# the HTML output. The underlying search engine uses javascript and DHTML and
+# should work on any modern browser. Note that when using HTML help
+# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET)
+# there is already a search function so this one should typically be disabled.
+# For large projects the javascript based search engine can be slow, then
+# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to
+# search using the keyboard; to jump to the search box use <access key> + S
+# (what the <access key> is depends on the OS and browser, but it is typically
+# <CTRL>, <ALT>/<option>, or both). Inside the search box use the <cursor down
+# key> to jump into the search results window, the results can be navigated
+# using the <cursor keys>. Press <Enter> to select an item or <escape> to cancel
+# the search. The filter options can be selected when the cursor is inside the
+# search box by pressing <Shift>+<cursor down>. Also here use the <cursor keys>
+# to select a filter and <Enter> or <escape> to activate or cancel the filter
+# option.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+SEARCHENGINE = YES
+
+# When the SERVER_BASED_SEARCH tag is enabled the search engine will be
+# implemented using a web server instead of a web client using Javascript. There
+# are two flavors of web server based searching depending on the EXTERNAL_SEARCH
+# setting. When disabled, doxygen will generate a PHP script for searching and
+# an index file used by the script. When EXTERNAL_SEARCH is enabled the indexing
+# and searching needs to be provided by external tools. See the section
+# "External Indexing and Searching" for details.
+# The default value is: NO.
+# This tag requires that the tag SEARCHENGINE is set to YES.
+
+SERVER_BASED_SEARCH = NO
+
+# When EXTERNAL_SEARCH tag is enabled doxygen will no longer generate the PHP
+# script for searching. Instead the search results are written to an XML file
+# which needs to be processed by an external indexer. Doxygen will invoke an
+# external search engine pointed to by the SEARCHENGINE_URL option to obtain the
+# search results.
+#
+# Doxygen ships with an example indexer (doxyindexer) and search engine
+# (doxysearch.cgi) which are based on the open source search engine library
+# Xapian (see: https://xapian.org/).
+#
+# See the section "External Indexing and Searching" for details.
+# The default value is: NO.
+# This tag requires that the tag SEARCHENGINE is set to YES.
+
+EXTERNAL_SEARCH = NO
+
+# The SEARCHENGINE_URL should point to a search engine hosted by a web server
+# which will return the search results when EXTERNAL_SEARCH is enabled.
+#
+# Doxygen ships with an example indexer (doxyindexer) and search engine
+# (doxysearch.cgi) which are based on the open source search engine library
+# Xapian (see: https://xapian.org/). See the section "External Indexing and
+# Searching" for details.
+# This tag requires that the tag SEARCHENGINE is set to YES.
+
+SEARCHENGINE_URL =
+
+# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the unindexed
+# search data is written to a file for indexing by an external tool. With the
+# SEARCHDATA_FILE tag the name of this file can be specified.
+# The default file is: searchdata.xml.
+# This tag requires that the tag SEARCHENGINE is set to YES.
+
+SEARCHDATA_FILE = searchdata.xml
+
+# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the
+# EXTERNAL_SEARCH_ID tag can be used as an identifier for the project. This is
+# useful in combination with EXTRA_SEARCH_MAPPINGS to search through multiple
+# projects and redirect the results back to the right project.
+# This tag requires that the tag SEARCHENGINE is set to YES.
+
+EXTERNAL_SEARCH_ID =
+
+# The EXTRA_SEARCH_MAPPINGS tag can be used to enable searching through doxygen
+# projects other than the one defined by this configuration file, but that are
+# all added to the same external search index. Each project needs to have a
+# unique id set via EXTERNAL_SEARCH_ID. The search mapping then maps the id of
+# to a relative location where the documentation can be found. The format is:
+# EXTRA_SEARCH_MAPPINGS = tagname1=loc1 tagname2=loc2 ...
+# This tag requires that the tag SEARCHENGINE is set to YES.
+
+EXTRA_SEARCH_MAPPINGS =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_LATEX tag is set to YES, doxygen will generate LaTeX output.
+# The default value is: YES.
+
+GENERATE_LATEX = NO
+
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. If a
+# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
+# it.
+# The default directory is: latex.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_OUTPUT = latex
+
+# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
+# invoked.
+#
+# Note that when not enabling USE_PDFLATEX the default is latex when enabling
+# USE_PDFLATEX the default is pdflatex and when in the later case latex is
+# chosen this is overwritten by pdflatex. For specific output languages the
+# default can have been set differently, this depends on the implementation of
+# the output language.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_CMD_NAME =
+
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to generate
+# index for LaTeX.
+# Note: This tag is used in the Makefile / make.bat.
+# See also: LATEX_MAKEINDEX_CMD for the part in the generated output file
+# (.tex).
+# The default file is: makeindex.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+MAKEINDEX_CMD_NAME = makeindex
+
+# The LATEX_MAKEINDEX_CMD tag can be used to specify the command name to
+# generate index for LaTeX.
+# Note: This tag is used in the generated output file (.tex).
+# See also: MAKEINDEX_CMD_NAME for the part in the Makefile / make.bat.
+# The default value is: \makeindex.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_MAKEINDEX_CMD = \makeindex
+
+# If the COMPACT_LATEX tag is set to YES, doxygen generates more compact LaTeX
+# documents. This may be useful for small projects and may help to save some
+# trees in general.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+COMPACT_LATEX = NO
+
+# The PAPER_TYPE tag can be used to set the paper type that is used by the
+# printer.
+# Possible values are: a4 (210 x 297 mm), letter (8.5 x 11 inches), legal (8.5 x
+# 14 inches) and executive (7.25 x 10.5 inches).
+# The default value is: a4.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+PAPER_TYPE = a4
+
+# The EXTRA_PACKAGES tag can be used to specify one or more LaTeX package names
+# that should be included in the LaTeX output. The package can be specified just
+# by its name or with the correct syntax as to be used with the LaTeX
+# \usepackage command. To get the times font for instance you can specify :
+# EXTRA_PACKAGES=times or EXTRA_PACKAGES={times}
+# To use the option intlimits with the amsmath package you can specify:
+# EXTRA_PACKAGES=[intlimits]{amsmath}
+# If left blank no extra packages will be included.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+EXTRA_PACKAGES =
+
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for the
+# generated LaTeX document. The header should contain everything until the first
+# chapter. If it is left blank doxygen will generate a standard header. See
+# section "Doxygen usage" for information on how to let doxygen write the
+# default header to a separate file.
+#
+# Note: Only use a user-defined header if you know what you are doing! The
+# following commands have a special meaning inside the header: $title,
+# $datetime, $date, $doxygenversion, $projectname, $projectnumber,
+# $projectbrief, $projectlogo. Doxygen will replace $title with the empty
+# string, for the replacement values of the other commands the user is referred
+# to HTML_HEADER.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_HEADER =
+
+# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for the
+# generated LaTeX document. The footer should contain everything after the last
+# chapter. If it is left blank doxygen will generate a standard footer. See
+# LATEX_HEADER for more information on how to generate a default footer and what
+# special commands can be used inside the footer.
+#
+# Note: Only use a user-defined footer if you know what you are doing!
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_FOOTER =
+
+# The LATEX_EXTRA_STYLESHEET tag can be used to specify additional user-defined
+# LaTeX style sheets that are included after the standard style sheets created
+# by doxygen. Using this option one can overrule certain style aspects. Doxygen
+# will copy the style sheet files to the output directory.
+# Note: The order of the extra style sheet files is of importance (e.g. the last
+# style sheet in the list overrules the setting of the previous ones in the
+# list).
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_EXTRA_STYLESHEET =
+
+# The LATEX_EXTRA_FILES tag can be used to specify one or more extra images or
+# other source files which should be copied to the LATEX_OUTPUT output
+# directory. Note that the files will be copied as-is; there are no commands or
+# markers available.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_EXTRA_FILES =
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated is
+# prepared for conversion to PDF (using ps2pdf or pdflatex). The PDF file will
+# contain links (just like the HTML output) instead of page references. This
+# makes the output suitable for online browsing using a PDF viewer.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+PDF_HYPERLINKS = YES
+
+# If the USE_PDFLATEX tag is set to YES, doxygen will use pdflatex to generate
+# the PDF file directly from the LaTeX files. Set this option to YES, to get a
+# higher quality PDF documentation.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+USE_PDFLATEX = YES
+
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \batchmode
+# command to the generated LaTeX files. This will instruct LaTeX to keep running
+# if errors occur, instead of asking the user for help. This option is also used
+# when generating formulas in HTML.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_BATCHMODE = NO
+
+# If the LATEX_HIDE_INDICES tag is set to YES then doxygen will not include the
+# index chapters (such as File Index, Compound Index, etc.) in the output.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_HIDE_INDICES = NO
+
+# If the LATEX_SOURCE_CODE tag is set to YES then doxygen will include source
+# code with syntax highlighting in the LaTeX output.
+#
+# Note that which sources are shown also depends on other settings such as
+# SOURCE_BROWSER.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_SOURCE_CODE = NO
+
+# The LATEX_BIB_STYLE tag can be used to specify the style to use for the
+# bibliography, e.g. plainnat, or ieeetr. See
+# https://en.wikipedia.org/wiki/BibTeX and \cite for more info.
+# The default value is: plain.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_BIB_STYLE = plain
+
+# If the LATEX_TIMESTAMP tag is set to YES then the footer of each generated
+# page will contain the date and time when the page was generated. Setting this
+# to NO can help when comparing the output of multiple runs.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_TIMESTAMP = NO
+
+# The LATEX_EMOJI_DIRECTORY tag is used to specify the (relative or absolute)
+# path from which the emoji images will be read. If a relative path is entered,
+# it will be relative to the LATEX_OUTPUT directory. If left blank the
+# LATEX_OUTPUT directory will be used.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_EMOJI_DIRECTORY =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the RTF output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_RTF tag is set to YES, doxygen will generate RTF output. The
+# RTF output is optimized for Word 97 and may not look too pretty with other RTF
+# readers/editors.
+# The default value is: NO.
+
+GENERATE_RTF = NO
+
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. If a
+# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
+# it.
+# The default directory is: rtf.
+# This tag requires that the tag GENERATE_RTF is set to YES.
+
+RTF_OUTPUT = rtf
+
+# If the COMPACT_RTF tag is set to YES, doxygen generates more compact RTF
+# documents. This may be useful for small projects and may help to save some
+# trees in general.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_RTF is set to YES.
+
+COMPACT_RTF = NO
+
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated will
+# contain hyperlink fields. The RTF file will contain links (just like the HTML
+# output) instead of page references. This makes the output suitable for online
+# browsing using Word or some other Word compatible readers that support those
+# fields.
+#
+# Note: WordPad (write) and others do not support links.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_RTF is set to YES.
+
+RTF_HYPERLINKS = NO
+
+# Load stylesheet definitions from file. Syntax is similar to doxygen's
+# configuration file, i.e. a series of assignments. You only have to provide
+# replacements, missing definitions are set to their default value.
+#
+# See also section "Doxygen usage" for information on how to generate the
+# default style sheet that doxygen normally uses.
+# This tag requires that the tag GENERATE_RTF is set to YES.
+
+RTF_STYLESHEET_FILE =
+
+# Set optional variables used in the generation of an RTF document. Syntax is
+# similar to doxygen's configuration file. A template extensions file can be
+# generated using doxygen -e rtf extensionFile.
+# This tag requires that the tag GENERATE_RTF is set to YES.
+
+RTF_EXTENSIONS_FILE =
+
+# If the RTF_SOURCE_CODE tag is set to YES then doxygen will include source code
+# with syntax highlighting in the RTF output.
+#
+# Note that which sources are shown also depends on other settings such as
+# SOURCE_BROWSER.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_RTF is set to YES.
+
+RTF_SOURCE_CODE = NO
+
+#---------------------------------------------------------------------------
+# Configuration options related to the man page output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_MAN tag is set to YES, doxygen will generate man pages for
+# classes and files.
+# The default value is: NO.
+
+GENERATE_MAN = NO
+
+# The MAN_OUTPUT tag is used to specify where the man pages will be put. If a
+# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
+# it. A directory man3 will be created inside the directory specified by
+# MAN_OUTPUT.
+# The default directory is: man.
+# This tag requires that the tag GENERATE_MAN is set to YES.
+
+MAN_OUTPUT = man
+
+# The MAN_EXTENSION tag determines the extension that is added to the generated
+# man pages. In case the manual section does not start with a number, the number
+# 3 is prepended. The dot (.) at the beginning of the MAN_EXTENSION tag is
+# optional.
+# The default value is: .3.
+# This tag requires that the tag GENERATE_MAN is set to YES.
+
+MAN_EXTENSION = .3
+
+# The MAN_SUBDIR tag determines the name of the directory created within
+# MAN_OUTPUT in which the man pages are placed. If defaults to man followed by
+# MAN_EXTENSION with the initial . removed.
+# This tag requires that the tag GENERATE_MAN is set to YES.
+
+MAN_SUBDIR =
+
+# If the MAN_LINKS tag is set to YES and doxygen generates man output, then it
+# will generate one additional man file for each entity documented in the real
+# man page(s). These additional files only source the real man page, but without
+# them the man command would be unable to find the correct page.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_MAN is set to YES.
+
+MAN_LINKS = NO
+
+#---------------------------------------------------------------------------
+# Configuration options related to the XML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_XML tag is set to YES, doxygen will generate an XML file that
+# captures the structure of the code including all documentation.
+# The default value is: NO.
+
+GENERATE_XML = NO
+
+# The XML_OUTPUT tag is used to specify where the XML pages will be put. If a
+# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
+# it.
+# The default directory is: xml.
+# This tag requires that the tag GENERATE_XML is set to YES.
+
+XML_OUTPUT = xml
+
+# If the XML_PROGRAMLISTING tag is set to YES, doxygen will dump the program
+# listings (including syntax highlighting and cross-referencing information) to
+# the XML output. Note that enabling this will significantly increase the size
+# of the XML output.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_XML is set to YES.
+
+XML_PROGRAMLISTING = YES
+
+# If the XML_NS_MEMB_FILE_SCOPE tag is set to YES, doxygen will include
+# namespace members in file scope as well, matching the HTML output.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_XML is set to YES.
+
+XML_NS_MEMB_FILE_SCOPE = NO
+
+#---------------------------------------------------------------------------
+# Configuration options related to the DOCBOOK output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_DOCBOOK tag is set to YES, doxygen will generate Docbook files
+# that can be used to generate PDF.
+# The default value is: NO.
+
+GENERATE_DOCBOOK = NO
+
+# The DOCBOOK_OUTPUT tag is used to specify where the Docbook pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be put in
+# front of it.
+# The default directory is: docbook.
+# This tag requires that the tag GENERATE_DOCBOOK is set to YES.
+
+DOCBOOK_OUTPUT = docbook
+
+# If the DOCBOOK_PROGRAMLISTING tag is set to YES, doxygen will include the
+# program listings (including syntax highlighting and cross-referencing
+# information) to the DOCBOOK output. Note that enabling this will significantly
+# increase the size of the DOCBOOK output.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_DOCBOOK is set to YES.
+
+DOCBOOK_PROGRAMLISTING = NO
+
+#---------------------------------------------------------------------------
+# Configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_AUTOGEN_DEF tag is set to YES, doxygen will generate an
+# AutoGen Definitions (see http://autogen.sourceforge.net/) file that captures
+# the structure of the code including all documentation. Note that this feature
+# is still experimental and incomplete at the moment.
+# The default value is: NO.
+
+GENERATE_AUTOGEN_DEF = NO
+
+#---------------------------------------------------------------------------
+# Configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_PERLMOD tag is set to YES, doxygen will generate a Perl module
+# file that captures the structure of the code including all documentation.
+#
+# Note that this feature is still experimental and incomplete at the moment.
+# The default value is: NO.
+
+GENERATE_PERLMOD = NO
+
+# If the PERLMOD_LATEX tag is set to YES, doxygen will generate the necessary
+# Makefile rules, Perl scripts and LaTeX code to be able to generate PDF and DVI
+# output from the Perl module output.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_PERLMOD is set to YES.
+
+PERLMOD_LATEX = NO
+
+# If the PERLMOD_PRETTY tag is set to YES, the Perl module output will be nicely
+# formatted so it can be parsed by a human reader. This is useful if you want to
+# understand what is going on. On the other hand, if this tag is set to NO, the
+# size of the Perl module output will be much smaller and Perl will parse it
+# just the same.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_PERLMOD is set to YES.
+
+PERLMOD_PRETTY = YES
+
+# The names of the make variables in the generated doxyrules.make file are
+# prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. This is useful
+# so different doxyrules.make files included by the same Makefile don't
+# overwrite each other's variables.
+# This tag requires that the tag GENERATE_PERLMOD is set to YES.
+
+PERLMOD_MAKEVAR_PREFIX =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+
+# If the ENABLE_PREPROCESSING tag is set to YES, doxygen will evaluate all
+# C-preprocessor directives found in the sources and include files.
+# The default value is: YES.
+
+ENABLE_PREPROCESSING = YES
+
+# If the MACRO_EXPANSION tag is set to YES, doxygen will expand all macro names
+# in the source code. If set to NO, only conditional compilation will be
+# performed. Macro expansion can be done in a controlled way by setting
+# EXPAND_ONLY_PREDEF to YES.
+# The default value is: NO.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
+
+MACRO_EXPANSION = NO
+
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES then
+# the macro expansion is limited to the macros specified with the PREDEFINED and
+# EXPAND_AS_DEFINED tags.
+# The default value is: NO.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
+
+EXPAND_ONLY_PREDEF = NO
+
+# If the SEARCH_INCLUDES tag is set to YES, the include files in the
+# INCLUDE_PATH will be searched if a #include is found.
+# The default value is: YES.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
+
+SEARCH_INCLUDES = YES
+
+# The INCLUDE_PATH tag can be used to specify one or more directories that
+# contain include files that are not input files but should be processed by the
+# preprocessor.
+# This tag requires that the tag SEARCH_INCLUDES is set to YES.
+
+INCLUDE_PATH =
+
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
+# patterns (like *.h and *.hpp) to filter out the header-files in the
+# directories. If left blank, the patterns specified with FILE_PATTERNS will be
+# used.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
+
+INCLUDE_FILE_PATTERNS =
+
+# The PREDEFINED tag can be used to specify one or more macro names that are
+# defined before the preprocessor is started (similar to the -D option of e.g.
+# gcc). The argument of the tag is a list of macros of the form: name or
+# name=definition (no spaces). If the definition and the "=" are omitted, "=1"
+# is assumed. To prevent a macro definition from being undefined via #undef or
+# recursively expanded use the := operator instead of the = operator.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
+
+PREDEFINED =
+
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
+# tag can be used to specify a list of macro names that should be expanded. The
+# macro definition that is found in the sources will be used. Use the PREDEFINED
+# tag if you want to use a different macro definition that overrules the
+# definition found in the source code.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
+
+EXPAND_AS_DEFINED =
+
+# If the SKIP_FUNCTION_MACROS tag is set to YES then doxygen's preprocessor will
+# remove all references to function-like macros that are alone on a line, have
+# an all uppercase name, and do not end with a semicolon. Such function macros
+# are typically used for boiler-plate code, and will confuse the parser if not
+# removed.
+# The default value is: YES.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
+
+SKIP_FUNCTION_MACROS = YES
+
+#---------------------------------------------------------------------------
+# Configuration options related to external references
+#---------------------------------------------------------------------------
+
+# The TAGFILES tag can be used to specify one or more tag files. For each tag
+# file the location of the external documentation should be added. The format of
+# a tag file without this location is as follows:
+# TAGFILES = file1 file2 ...
+# Adding location for the tag files is done as follows:
+# TAGFILES = file1=loc1 "file2 = loc2" ...
+# where loc1 and loc2 can be relative or absolute paths or URLs. See the
+# section "Linking to external documentation" for more information about the use
+# of tag files.
+# Note: Each tag file must have a unique name (where the name does NOT include
+# the path). If a tag file is not located in the directory in which doxygen is
+# run, you must also specify the path to the tagfile here.
+
+TAGFILES =
+
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create a
+# tag file that is based on the input files it reads. See section "Linking to
+# external documentation" for more information about the usage of tag files.
+
+GENERATE_TAGFILE =
+
+# If the ALLEXTERNALS tag is set to YES, all external class will be listed in
+# the class index. If set to NO, only the inherited external classes will be
+# listed.
+# The default value is: NO.
+
+ALLEXTERNALS = NO
+
+# If the EXTERNAL_GROUPS tag is set to YES, all external groups will be listed
+# in the modules index. If set to NO, only the current project's groups will be
+# listed.
+# The default value is: YES.
+
+EXTERNAL_GROUPS = YES
+
+# If the EXTERNAL_PAGES tag is set to YES, all external pages will be listed in
+# the related pages index. If set to NO, only the current project's pages will
+# be listed.
+# The default value is: YES.
+
+EXTERNAL_PAGES = YES
+
+# The PERL_PATH should be the absolute path and name of the perl script
+# interpreter (i.e. the result of 'which perl').
+# The default file (with absolute path) is: /usr/bin/perl.
+
+PERL_PATH = /usr/bin/perl
+
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool
+#---------------------------------------------------------------------------
+
+# If the CLASS_DIAGRAMS tag is set to YES, doxygen will generate a class diagram
+# (in HTML and LaTeX) for classes with base or super classes. Setting the tag to
+# NO turns the diagrams off. Note that this option also works with HAVE_DOT
+# disabled, but it is recommended to install and use dot, since it yields more
+# powerful graphs.
+# The default value is: YES.
+
+CLASS_DIAGRAMS = YES
+
+# You can define message sequence charts within doxygen comments using the \msc
+# command. Doxygen will then run the mscgen tool (see:
+# http://www.mcternan.me.uk/mscgen/)) to produce the chart and insert it in the
+# documentation. The MSCGEN_PATH tag allows you to specify the directory where
+# the mscgen tool resides. If left empty the tool is assumed to be found in the
+# default search path.
+
+MSCGEN_PATH =
+
+# You can include diagrams made with dia in doxygen documentation. Doxygen will
+# then run dia to produce the diagram and insert it in the documentation. The
+# DIA_PATH tag allows you to specify the directory where the dia binary resides.
+# If left empty dia is assumed to be found in the default search path.
+
+DIA_PATH =
+
+# If set to YES the inheritance and collaboration graphs will hide inheritance
+# and usage relations if the target is undocumented or is not a class.
+# The default value is: YES.
+
+HIDE_UNDOC_RELATIONS = YES
+
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
+# available from the path. This tool is part of Graphviz (see:
+# http://www.graphviz.org/), a graph visualization toolkit from AT&T and Lucent
+# Bell Labs. The other options in this section have no effect if this option is
+# set to NO
+# The default value is: NO.
+
+HAVE_DOT = NO
+
+# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is allowed
+# to run in parallel. When set to 0 doxygen will base this on the number of
+# processors available in the system. You can set it explicitly to a value
+# larger than 0 to get control over the balance between CPU load and processing
+# speed.
+# Minimum value: 0, maximum value: 32, default value: 0.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_NUM_THREADS = 0
+
+# When you want a differently looking font in the dot files that doxygen
+# generates you can specify the font name using DOT_FONTNAME. You need to make
+# sure dot is able to find the font, which can be done by putting it in a
+# standard location or by setting the DOTFONTPATH environment variable or by
+# setting DOT_FONTPATH to the directory containing the font.
+# The default value is: Helvetica.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_FONTNAME = Helvetica
+
+# The DOT_FONTSIZE tag can be used to set the size (in points) of the font of
+# dot graphs.
+# Minimum value: 4, maximum value: 24, default value: 10.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_FONTSIZE = 10
+
+# By default doxygen will tell dot to use the default font as specified with
+# DOT_FONTNAME. If you specify a different font using DOT_FONTNAME you can set
+# the path where dot can find it using this tag.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_FONTPATH =
+
+# If the CLASS_GRAPH tag is set to YES then doxygen will generate a graph for
+# each documented class showing the direct and indirect inheritance relations.
+# Setting this tag to YES will force the CLASS_DIAGRAMS tag to NO.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+CLASS_GRAPH = YES
+
+# If the COLLABORATION_GRAPH tag is set to YES then doxygen will generate a
+# graph for each documented class showing the direct and indirect implementation
+# dependencies (inheritance, containment, and class references variables) of the
+# class with other documented classes.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+COLLABORATION_GRAPH = YES
+
+# If the GROUP_GRAPHS tag is set to YES then doxygen will generate a graph for
+# groups, showing the direct groups dependencies.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+GROUP_GRAPHS = YES
+
+# If the UML_LOOK tag is set to YES, doxygen will generate inheritance and
+# collaboration diagrams in a style similar to the OMG's Unified Modeling
+# Language.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+UML_LOOK = NO
+
+# If the UML_LOOK tag is enabled, the fields and methods are shown inside the
+# class node. If there are many fields or methods and many nodes the graph may
+# become too big to be useful. The UML_LIMIT_NUM_FIELDS threshold limits the
+# number of items for each type to make the size more manageable. Set this to 0
+# for no limit. Note that the threshold may be exceeded by 50% before the limit
+# is enforced. So when you set the threshold to 10, up to 15 fields may appear,
+# but if the number exceeds 15, the total amount of fields shown is limited to
+# 10.
+# Minimum value: 0, maximum value: 100, default value: 10.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+UML_LIMIT_NUM_FIELDS = 10
+
+# If the TEMPLATE_RELATIONS tag is set to YES then the inheritance and
+# collaboration graphs will show the relations between templates and their
+# instances.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+TEMPLATE_RELATIONS = NO
+
+# If the INCLUDE_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are set to
+# YES then doxygen will generate a graph for each documented file showing the
+# direct and indirect include dependencies of the file with other documented
+# files.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+INCLUDE_GRAPH = YES
+
+# If the INCLUDED_BY_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are
+# set to YES then doxygen will generate a graph for each documented file showing
+# the direct and indirect include dependencies of the file with other documented
+# files.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+INCLUDED_BY_GRAPH = YES
+
+# If the CALL_GRAPH tag is set to YES then doxygen will generate a call
+# dependency graph for every global function or class method.
+#
+# Note that enabling this option will significantly increase the time of a run.
+# So in most cases it will be better to enable call graphs for selected
+# functions only using the \callgraph command. Disabling a call graph can be
+# accomplished by means of the command \hidecallgraph.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+CALL_GRAPH = NO
+
+# If the CALLER_GRAPH tag is set to YES then doxygen will generate a caller
+# dependency graph for every global function or class method.
+#
+# Note that enabling this option will significantly increase the time of a run.
+# So in most cases it will be better to enable caller graphs for selected
+# functions only using the \callergraph command. Disabling a caller graph can be
+# accomplished by means of the command \hidecallergraph.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+CALLER_GRAPH = NO
+
+# If the GRAPHICAL_HIERARCHY tag is set to YES then doxygen will graphical
+# hierarchy of all classes instead of a textual one.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+GRAPHICAL_HIERARCHY = YES
+
+# If the DIRECTORY_GRAPH tag is set to YES then doxygen will show the
+# dependencies a directory has on other directories in a graphical way. The
+# dependency relations are determined by the #include relations between the
+# files in the directories.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DIRECTORY_GRAPH = YES
+
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
+# generated by dot. For an explanation of the image formats see the section
+# output formats in the documentation of the dot tool (Graphviz (see:
+# http://www.graphviz.org/)).
+# Note: If you choose svg you need to set HTML_FILE_EXTENSION to xhtml in order
+# to make the SVG files visible in IE 9+ (other browsers do not have this
+# requirement).
+# Possible values are: png, jpg, gif, svg, png:gd, png:gd:gd, png:cairo,
+# png:cairo:gd, png:cairo:cairo, png:cairo:gdiplus, png:gdiplus and
+# png:gdiplus:gdiplus.
+# The default value is: png.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_IMAGE_FORMAT = png
+
+# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to
+# enable generation of interactive SVG images that allow zooming and panning.
+#
+# Note that this requires a modern browser other than Internet Explorer. Tested
+# and working are Firefox, Chrome, Safari, and Opera.
+# Note: For IE 9+ you need to set HTML_FILE_EXTENSION to xhtml in order to make
+# the SVG files visible. Older versions of IE do not have SVG support.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+INTERACTIVE_SVG = NO
+
+# The DOT_PATH tag can be used to specify the path where the dot tool can be
+# found. If left blank, it is assumed the dot tool can be found in the path.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_PATH =
+
+# The DOTFILE_DIRS tag can be used to specify one or more directories that
+# contain dot files that are included in the documentation (see the \dotfile
+# command).
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOTFILE_DIRS =
+
+# The MSCFILE_DIRS tag can be used to specify one or more directories that
+# contain msc files that are included in the documentation (see the \mscfile
+# command).
+
+MSCFILE_DIRS =
+
+# The DIAFILE_DIRS tag can be used to specify one or more directories that
+# contain dia files that are included in the documentation (see the \diafile
+# command).
+
+DIAFILE_DIRS =
+
+# When using plantuml, the PLANTUML_JAR_PATH tag should be used to specify the
+# path where java can find the plantuml.jar file. If left blank, it is assumed
+# PlantUML is not used or called during a preprocessing step. Doxygen will
+# generate a warning when it encounters a \startuml command in this case and
+# will not generate output for the diagram.
+
+PLANTUML_JAR_PATH =
+
+# When using plantuml, the PLANTUML_CFG_FILE tag can be used to specify a
+# configuration file for plantuml.
+
+PLANTUML_CFG_FILE =
+
+# When using plantuml, the specified paths are searched for files specified by
+# the !include statement in a plantuml block.
+
+PLANTUML_INCLUDE_PATH =
+
+# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of nodes
+# that will be shown in the graph. If the number of nodes in a graph becomes
+# larger than this value, doxygen will truncate the graph, which is visualized
+# by representing a node as a red box. Note that doxygen if the number of direct
+# children of the root node in a graph is already larger than
+# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note that
+# the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
+# Minimum value: 0, maximum value: 10000, default value: 50.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_GRAPH_MAX_NODES = 50
+
+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the graphs
+# generated by dot. A depth value of 3 means that only nodes reachable from the
+# root by following a path via at most 3 edges will be shown. Nodes that lay
+# further from the root node will be omitted. Note that setting this option to 1
+# or 2 may greatly reduce the computation time needed for large code bases. Also
+# note that the size of a graph can be further restricted by
+# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
+# Minimum value: 0, maximum value: 1000, default value: 0.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+MAX_DOT_GRAPH_DEPTH = 0
+
+# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
+# background. This is disabled by default, because dot on Windows does not seem
+# to support this out of the box.
+#
+# Warning: Depending on the platform used, enabling this option may lead to
+# badly anti-aliased labels on the edges of a graph (i.e. they become hard to
+# read).
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_TRANSPARENT = NO
+
+# Set the DOT_MULTI_TARGETS tag to YES to allow dot to generate multiple output
+# files in one run (i.e. multiple -o and -T options on the command line). This
+# makes dot run faster, but since only newer versions of dot (>1.8.10) support
+# this, this feature is disabled by default.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_MULTI_TARGETS = NO
+
+# If the GENERATE_LEGEND tag is set to YES doxygen will generate a legend page
+# explaining the meaning of the various boxes and arrows in the dot generated
+# graphs.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+GENERATE_LEGEND = YES
+
+# If the DOT_CLEANUP tag is set to YES, doxygen will remove the intermediate dot
+# files that are used to generate the various graphs.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_CLEANUP = YES
diff --git a/DvdLib/Properties/AssemblyInfo.cs b/DvdLib/Properties/AssemblyInfo.cs
index 5fc055d1f..6acd571d6 100644
--- a/DvdLib/Properties/AssemblyInfo.cs
+++ b/DvdLib/Properties/AssemblyInfo.cs
@@ -9,8 +9,8 @@ using System.Runtime.InteropServices;
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Jellyfin Project")]
-[assembly: AssemblyProduct("Jellyfin: The Free Software Media System")]
-[assembly: AssemblyCopyright("Copyright © 2019 Jellyfin Contributors. Code released under the GNU General Public License Version 2")]
+[assembly: AssemblyProduct("Jellyfin Server")]
+[assembly: AssemblyCopyright("Copyright © 2019 Jellyfin Contributors. Code released under the GNU General Public License")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: NeutralResourcesLanguage("en")]
diff --git a/Emby.Dlna/ConnectionManager/ConnectionManager.cs b/Emby.Dlna/ConnectionManager/ConnectionManager.cs
index e138b91d6..83011fbab 100644
--- a/Emby.Dlna/ConnectionManager/ConnectionManager.cs
+++ b/Emby.Dlna/ConnectionManager/ConnectionManager.cs
@@ -2,7 +2,6 @@ using Emby.Dlna.Service;
using MediaBrowser.Common.Net;
using MediaBrowser.Controller.Configuration;
using MediaBrowser.Controller.Dlna;
-using MediaBrowser.Model.Xml;
using Microsoft.Extensions.Logging;
namespace Emby.Dlna.ConnectionManager
@@ -12,15 +11,13 @@ namespace Emby.Dlna.ConnectionManager
private readonly IDlnaManager _dlna;
private readonly ILogger _logger;
private readonly IServerConfigurationManager _config;
- protected readonly IXmlReaderSettingsFactory XmlReaderSettingsFactory;
- public ConnectionManager(IDlnaManager dlna, IServerConfigurationManager config, ILogger logger, IHttpClient httpClient, IXmlReaderSettingsFactory xmlReaderSettingsFactory)
+ public ConnectionManager(IDlnaManager dlna, IServerConfigurationManager config, ILogger logger, IHttpClient httpClient)
: base(logger, httpClient)
{
_dlna = dlna;
_config = config;
_logger = logger;
- XmlReaderSettingsFactory = xmlReaderSettingsFactory;
}
public string GetServiceXml()
@@ -33,7 +30,7 @@ namespace Emby.Dlna.ConnectionManager
var profile = _dlna.GetProfile(request.Headers) ??
_dlna.GetDefaultProfile();
- return new ControlHandler(_config, _logger, XmlReaderSettingsFactory, profile).ProcessControlRequest(request);
+ return new ControlHandler(_config, _logger, profile).ProcessControlRequest(request);
}
}
}
diff --git a/Emby.Dlna/ConnectionManager/ControlHandler.cs b/Emby.Dlna/ConnectionManager/ControlHandler.cs
index 16211c61f..2e1104748 100644
--- a/Emby.Dlna/ConnectionManager/ControlHandler.cs
+++ b/Emby.Dlna/ConnectionManager/ControlHandler.cs
@@ -4,7 +4,6 @@ using Emby.Dlna.Service;
using MediaBrowser.Common.Extensions;
using MediaBrowser.Controller.Configuration;
using MediaBrowser.Model.Dlna;
-using MediaBrowser.Model.Xml;
using Microsoft.Extensions.Logging;
namespace Emby.Dlna.ConnectionManager
@@ -32,7 +31,8 @@ namespace Emby.Dlna.ConnectionManager
};
}
- public ControlHandler(IServerConfigurationManager config, ILogger logger, IXmlReaderSettingsFactory xmlReaderSettingsFactory, DeviceProfile profile) : base(config, logger, xmlReaderSettingsFactory)
+ public ControlHandler(IServerConfigurationManager config, ILogger logger, DeviceProfile profile)
+ : base(config, logger)
{
_profile = profile;
}
diff --git a/Emby.Dlna/ContentDirectory/ContentDirectory.cs b/Emby.Dlna/ContentDirectory/ContentDirectory.cs
index 867e6112f..5175898ab 100644
--- a/Emby.Dlna/ContentDirectory/ContentDirectory.cs
+++ b/Emby.Dlna/ContentDirectory/ContentDirectory.cs
@@ -11,7 +11,6 @@ using MediaBrowser.Controller.MediaEncoding;
using MediaBrowser.Controller.TV;
using MediaBrowser.Model.Dlna;
using MediaBrowser.Model.Globalization;
-using MediaBrowser.Model.Xml;
using Microsoft.Extensions.Logging;
namespace Emby.Dlna.ContentDirectory
@@ -28,7 +27,6 @@ namespace Emby.Dlna.ContentDirectory
private readonly IMediaSourceManager _mediaSourceManager;
private readonly IUserViewManager _userViewManager;
private readonly IMediaEncoder _mediaEncoder;
- protected readonly IXmlReaderSettingsFactory XmlReaderSettingsFactory;
private readonly ITVSeriesManager _tvSeriesManager;
public ContentDirectory(IDlnaManager dlna,
@@ -38,7 +36,12 @@ namespace Emby.Dlna.ContentDirectory
IServerConfigurationManager config,
IUserManager userManager,
ILogger logger,
- IHttpClient httpClient, ILocalizationManager localization, IMediaSourceManager mediaSourceManager, IUserViewManager userViewManager, IMediaEncoder mediaEncoder, IXmlReaderSettingsFactory xmlReaderSettingsFactory, ITVSeriesManager tvSeriesManager)
+ IHttpClient httpClient,
+ ILocalizationManager localization,
+ IMediaSourceManager mediaSourceManager,
+ IUserViewManager userViewManager,
+ IMediaEncoder mediaEncoder,
+ ITVSeriesManager tvSeriesManager)
: base(logger, httpClient)
{
_dlna = dlna;
@@ -51,7 +54,6 @@ namespace Emby.Dlna.ContentDirectory
_mediaSourceManager = mediaSourceManager;
_userViewManager = userViewManager;
_mediaEncoder = mediaEncoder;
- XmlReaderSettingsFactory = xmlReaderSettingsFactory;
_tvSeriesManager = tvSeriesManager;
}
@@ -94,7 +96,6 @@ namespace Emby.Dlna.ContentDirectory
_mediaSourceManager,
_userViewManager,
_mediaEncoder,
- XmlReaderSettingsFactory,
_tvSeriesManager)
.ProcessControlRequest(request);
}
diff --git a/Emby.Dlna/ContentDirectory/ControlHandler.cs b/Emby.Dlna/ContentDirectory/ControlHandler.cs
index 84f38ff76..4f8c89e48 100644
--- a/Emby.Dlna/ContentDirectory/ControlHandler.cs
+++ b/Emby.Dlna/ContentDirectory/ControlHandler.cs
@@ -25,7 +25,6 @@ using MediaBrowser.Model.Dlna;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Globalization;
using MediaBrowser.Model.Querying;
-using MediaBrowser.Model.Xml;
using Microsoft.Extensions.Logging;
namespace Emby.Dlna.ContentDirectory
@@ -51,8 +50,22 @@ namespace Emby.Dlna.ContentDirectory
private readonly DeviceProfile _profile;
- public ControlHandler(ILogger logger, ILibraryManager libraryManager, DeviceProfile profile, string serverAddress, string accessToken, IImageProcessor imageProcessor, IUserDataManager userDataManager, User user, int systemUpdateId, IServerConfigurationManager config, ILocalizationManager localization, IMediaSourceManager mediaSourceManager, IUserViewManager userViewManager, IMediaEncoder mediaEncoder, IXmlReaderSettingsFactory xmlReaderSettingsFactory, ITVSeriesManager tvSeriesManager)
- : base(config, logger, xmlReaderSettingsFactory)
+ public ControlHandler(
+ ILogger logger,
+ ILibraryManager libraryManager,
+ DeviceProfile profile,
+ string serverAddress,
+ string accessToken,
+ IImageProcessor imageProcessor,
+ IUserDataManager userDataManager,
+ User user, int systemUpdateId,
+ IServerConfigurationManager config,
+ ILocalizationManager localization,
+ IMediaSourceManager mediaSourceManager,
+ IUserViewManager userViewManager,
+ IMediaEncoder mediaEncoder,
+ ITVSeriesManager tvSeriesManager)
+ : base(config, logger)
{
_libraryManager = libraryManager;
_userDataManager = userDataManager;
diff --git a/Emby.Dlna/Main/DlnaEntryPoint.cs b/Emby.Dlna/Main/DlnaEntryPoint.cs
index 57ed0097a..5fbe70ded 100644
--- a/Emby.Dlna/Main/DlnaEntryPoint.cs
+++ b/Emby.Dlna/Main/DlnaEntryPoint.cs
@@ -1,5 +1,4 @@
using System;
-using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Emby.Dlna.PlayTo;
@@ -20,10 +19,10 @@ using MediaBrowser.Model.Dlna;
using MediaBrowser.Model.Globalization;
using MediaBrowser.Model.Net;
using MediaBrowser.Model.System;
-using MediaBrowser.Model.Xml;
using Microsoft.Extensions.Logging;
using Rssdp;
using Rssdp.Infrastructure;
+using OperatingSystem = MediaBrowser.Common.System.OperatingSystem;
namespace Emby.Dlna.Main
{
@@ -48,9 +47,8 @@ namespace Emby.Dlna.Main
private readonly IDeviceDiscovery _deviceDiscovery;
private SsdpDevicePublisher _Publisher;
-
+
private readonly ISocketFactory _socketFactory;
- private readonly IEnvironmentInfo _environmentInfo;
private readonly INetworkManager _networkManager;
private ISsdpCommunicationsServer _communicationsServer;
@@ -76,10 +74,8 @@ namespace Emby.Dlna.Main
IDeviceDiscovery deviceDiscovery,
IMediaEncoder mediaEncoder,
ISocketFactory socketFactory,
- IEnvironmentInfo environmentInfo,
INetworkManager networkManager,
IUserViewManager userViewManager,
- IXmlReaderSettingsFactory xmlReaderSettingsFactory,
ITVSeriesManager tvSeriesManager)
{
_config = config;
@@ -96,11 +92,11 @@ namespace Emby.Dlna.Main
_deviceDiscovery = deviceDiscovery;
_mediaEncoder = mediaEncoder;
_socketFactory = socketFactory;
- _environmentInfo = environmentInfo;
_networkManager = networkManager;
_logger = loggerFactory.CreateLogger("Dlna");
- ContentDirectory = new ContentDirectory.ContentDirectory(dlnaManager,
+ ContentDirectory = new ContentDirectory.ContentDirectory(
+ dlnaManager,
userDataManager,
imageProcessor,
libraryManager,
@@ -112,12 +108,11 @@ namespace Emby.Dlna.Main
mediaSourceManager,
userViewManager,
mediaEncoder,
- xmlReaderSettingsFactory,
tvSeriesManager);
- ConnectionManager = new ConnectionManager.ConnectionManager(dlnaManager, config, _logger, httpClient, xmlReaderSettingsFactory);
+ ConnectionManager = new ConnectionManager.ConnectionManager(dlnaManager, config, _logger, httpClient);
- MediaReceiverRegistrar = new MediaReceiverRegistrar.MediaReceiverRegistrar(_logger, httpClient, config, xmlReaderSettingsFactory);
+ MediaReceiverRegistrar = new MediaReceiverRegistrar.MediaReceiverRegistrar(_logger, httpClient, config);
Current = this;
}
@@ -169,8 +164,8 @@ namespace Emby.Dlna.Main
{
if (_communicationsServer == null)
{
- var enableMultiSocketBinding = _environmentInfo.OperatingSystem == MediaBrowser.Model.System.OperatingSystem.Windows ||
- _environmentInfo.OperatingSystem == MediaBrowser.Model.System.OperatingSystem.Linux;
+ var enableMultiSocketBinding = OperatingSystem.Id == OperatingSystemId.Windows ||
+ OperatingSystem.Id == OperatingSystemId.Linux;
_communicationsServer = new SsdpCommunicationsServer(_config, _socketFactory, _networkManager, _logger, enableMultiSocketBinding)
{
@@ -230,7 +225,7 @@ namespace Emby.Dlna.Main
try
{
- _Publisher = new SsdpDevicePublisher(_communicationsServer, _networkManager, _environmentInfo.OperatingSystemName, _environmentInfo.OperatingSystemVersion, _config.GetDlnaConfiguration().SendOnlyMatchedHost);
+ _Publisher = new SsdpDevicePublisher(_communicationsServer, _networkManager, OperatingSystem.Name, Environment.OSVersion.VersionString, _config.GetDlnaConfiguration().SendOnlyMatchedHost);
_Publisher.LogFunction = LogMessage;
_Publisher.SupportPnpRootDevice = false;
diff --git a/Emby.Dlna/MediaReceiverRegistrar/ControlHandler.cs b/Emby.Dlna/MediaReceiverRegistrar/ControlHandler.cs
index ae8175f4a..7381e5258 100644
--- a/Emby.Dlna/MediaReceiverRegistrar/ControlHandler.cs
+++ b/Emby.Dlna/MediaReceiverRegistrar/ControlHandler.cs
@@ -3,7 +3,6 @@ using System.Collections.Generic;
using Emby.Dlna.Service;
using MediaBrowser.Common.Extensions;
using MediaBrowser.Controller.Configuration;
-using MediaBrowser.Model.Xml;
using Microsoft.Extensions.Logging;
namespace Emby.Dlna.MediaReceiverRegistrar
@@ -36,8 +35,8 @@ namespace Emby.Dlna.MediaReceiverRegistrar
};
}
- public ControlHandler(IServerConfigurationManager config, ILogger logger, IXmlReaderSettingsFactory xmlReaderSettingsFactory)
- : base(config, logger, xmlReaderSettingsFactory)
+ public ControlHandler(IServerConfigurationManager config, ILogger logger)
+ : base(config, logger)
{
}
}
diff --git a/Emby.Dlna/MediaReceiverRegistrar/MediaReceiverRegistrar.cs b/Emby.Dlna/MediaReceiverRegistrar/MediaReceiverRegistrar.cs
index e47143c16..b565cb631 100644
--- a/Emby.Dlna/MediaReceiverRegistrar/MediaReceiverRegistrar.cs
+++ b/Emby.Dlna/MediaReceiverRegistrar/MediaReceiverRegistrar.cs
@@ -1,7 +1,6 @@
using Emby.Dlna.Service;
using MediaBrowser.Common.Net;
using MediaBrowser.Controller.Configuration;
-using MediaBrowser.Model.Xml;
using Microsoft.Extensions.Logging;
namespace Emby.Dlna.MediaReceiverRegistrar
@@ -9,13 +8,11 @@ namespace Emby.Dlna.MediaReceiverRegistrar
public class MediaReceiverRegistrar : BaseService, IMediaReceiverRegistrar
{
private readonly IServerConfigurationManager _config;
- protected readonly IXmlReaderSettingsFactory XmlReaderSettingsFactory;
- public MediaReceiverRegistrar(ILogger logger, IHttpClient httpClient, IServerConfigurationManager config, IXmlReaderSettingsFactory xmlReaderSettingsFactory)
+ public MediaReceiverRegistrar(ILogger logger, IHttpClient httpClient, IServerConfigurationManager config)
: base(logger, httpClient)
{
_config = config;
- XmlReaderSettingsFactory = xmlReaderSettingsFactory;
}
public string GetServiceXml()
@@ -27,7 +24,7 @@ namespace Emby.Dlna.MediaReceiverRegistrar
{
return new ControlHandler(
_config,
- Logger, XmlReaderSettingsFactory)
+ Logger)
.ProcessControlRequest(request);
}
}
diff --git a/Emby.Dlna/PlayTo/PlayToController.cs b/Emby.Dlna/PlayTo/PlayToController.cs
index 67d5cfef4..c58f16438 100644
--- a/Emby.Dlna/PlayTo/PlayToController.cs
+++ b/Emby.Dlna/PlayTo/PlayToController.cs
@@ -102,9 +102,10 @@ namespace Emby.Dlna.PlayTo
{
_sessionManager.ReportSessionEnded(_session.Id);
}
- catch
+ catch (Exception ex)
{
// Could throw if the session is already gone
+ _logger.LogError(ex, "Error reporting the end of session {Id}", _session.Id);
}
}
@@ -112,20 +113,14 @@ namespace Emby.Dlna.PlayTo
{
var info = e.Argument;
- info.Headers.TryGetValue("NTS", out string nts);
-
- if (!info.Headers.TryGetValue("USN", out string usn)) usn = string.Empty;
-
- if (!info.Headers.TryGetValue("NT", out string nt)) nt = string.Empty;
-
- if (usn.IndexOf(_device.Properties.UUID, StringComparison.OrdinalIgnoreCase) != -1 &&
- !_disposed)
+ if (!_disposed
+ && info.Headers.TryGetValue("USN", out string usn)
+ && usn.IndexOf(_device.Properties.UUID, StringComparison.OrdinalIgnoreCase) != -1
+ && (usn.IndexOf("MediaRenderer:", StringComparison.OrdinalIgnoreCase) != -1
+ || (info.Headers.TryGetValue("NT", out string nt)
+ && nt.IndexOf("MediaRenderer:", StringComparison.OrdinalIgnoreCase) != -1)))
{
- if (usn.IndexOf("MediaRenderer:", StringComparison.OrdinalIgnoreCase) != -1 ||
- nt.IndexOf("MediaRenderer:", StringComparison.OrdinalIgnoreCase) != -1)
- {
- OnDeviceUnavailable();
- }
+ OnDeviceUnavailable();
}
}
@@ -612,22 +607,34 @@ namespace Emby.Dlna.PlayTo
public void Dispose()
{
- if (!_disposed)
- {
- _disposed = true;
+ Dispose(true);
+ GC.SuppressFinalize(this);
+ }
- _device.PlaybackStart -= _device_PlaybackStart;
- _device.PlaybackProgress -= _device_PlaybackProgress;
- _device.PlaybackStopped -= _device_PlaybackStopped;
- _device.MediaChanged -= _device_MediaChanged;
- //_deviceDiscovery.DeviceLeft -= _deviceDiscovery_DeviceLeft;
- _device.OnDeviceUnavailable = null;
+ protected virtual void Dispose(bool disposing)
+ {
+ if (_disposed)
+ {
+ return;
+ }
+ if (disposing)
+ {
_device.Dispose();
}
+
+ _device.PlaybackStart -= _device_PlaybackStart;
+ _device.PlaybackProgress -= _device_PlaybackProgress;
+ _device.PlaybackStopped -= _device_PlaybackStopped;
+ _device.MediaChanged -= _device_MediaChanged;
+ _deviceDiscovery.DeviceLeft -= _deviceDiscovery_DeviceLeft;
+ _device.OnDeviceUnavailable = null;
+ _device = null;
+
+ _disposed = true;
}
- private readonly CultureInfo _usCulture = new CultureInfo("en-US");
+ private static readonly CultureInfo _usCulture = CultureInfo.ReadOnly(new CultureInfo("en-US"));
private Task SendGeneralCommand(GeneralCommand command, CancellationToken cancellationToken)
{
diff --git a/Emby.Dlna/Properties/AssemblyInfo.cs b/Emby.Dlna/Properties/AssemblyInfo.cs
index 9d3a22c97..a2c1e0db8 100644
--- a/Emby.Dlna/Properties/AssemblyInfo.cs
+++ b/Emby.Dlna/Properties/AssemblyInfo.cs
@@ -8,8 +8,8 @@ using System.Resources;
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Jellyfin Project")]
-[assembly: AssemblyProduct("Jellyfin: The Free Software Media System")]
-[assembly: AssemblyCopyright("Copyright © 2019 Jellyfin Contributors. Code released under the GNU General Public License Version 2")]
+[assembly: AssemblyProduct("Jellyfin Server")]
+[assembly: AssemblyCopyright("Copyright © 2019 Jellyfin Contributors. Code released under the GNU General Public License")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: NeutralResourcesLanguage("en")]
diff --git a/Emby.Dlna/Service/BaseControlHandler.cs b/Emby.Dlna/Service/BaseControlHandler.cs
index 5f78674b8..067d5fa43 100644
--- a/Emby.Dlna/Service/BaseControlHandler.cs
+++ b/Emby.Dlna/Service/BaseControlHandler.cs
@@ -7,7 +7,6 @@ using System.Xml;
using Emby.Dlna.Didl;
using MediaBrowser.Controller.Configuration;
using MediaBrowser.Controller.Extensions;
-using MediaBrowser.Model.Xml;
using Microsoft.Extensions.Logging;
namespace Emby.Dlna.Service
@@ -18,13 +17,11 @@ namespace Emby.Dlna.Service
protected readonly IServerConfigurationManager Config;
protected readonly ILogger _logger;
- protected readonly IXmlReaderSettingsFactory XmlReaderSettingsFactory;
- protected BaseControlHandler(IServerConfigurationManager config, ILogger logger, IXmlReaderSettingsFactory xmlReaderSettingsFactory)
+ protected BaseControlHandler(IServerConfigurationManager config, ILogger logger)
{
Config = config;
_logger = logger;
- XmlReaderSettingsFactory = xmlReaderSettingsFactory;
}
public ControlResponse ProcessControlRequest(ControlRequest request)
@@ -61,11 +58,13 @@ namespace Emby.Dlna.Service
using (var streamReader = new StreamReader(request.InputXml))
{
- var readerSettings = XmlReaderSettingsFactory.Create(false);
-
- readerSettings.CheckCharacters = false;
- readerSettings.IgnoreProcessingInstructions = true;
- readerSettings.IgnoreComments = true;
+ var readerSettings = new XmlReaderSettings()
+ {
+ ValidationType = ValidationType.None,
+ CheckCharacters = false,
+ IgnoreProcessingInstructions = true,
+ IgnoreComments = true
+ };
using (var reader = XmlReader.Create(streamReader, readerSettings))
{
diff --git a/Emby.Drawing/ImageProcessor.cs b/Emby.Drawing/ImageProcessor.cs
index faaeb5af8..6d209d8d0 100644
--- a/Emby.Drawing/ImageProcessor.cs
+++ b/Emby.Drawing/ImageProcessor.cs
@@ -180,6 +180,12 @@ namespace Emby.Drawing
var supportedImageInfo = await GetSupportedImage(originalImagePath, dateModified).ConfigureAwait(false);
originalImagePath = supportedImageInfo.path;
+
+ if (!File.Exists(originalImagePath))
+ {
+ return (originalImagePath, MimeTypes.GetMimeType(originalImagePath), dateModified);
+ }
+
dateModified = supportedImageInfo.dateModified;
bool requiresTransparency = TransparentImageTypes.Contains(Path.GetExtension(originalImagePath));
@@ -265,8 +271,6 @@ namespace Emby.Drawing
{
// If it fails for whatever reason, return the original image
_logger.LogError(ex, "Error encoding image");
-
- // Just spit out the original file if all the options are default
return (originalImagePath, MimeTypes.GetMimeType(originalImagePath), dateModified);
}
finally
diff --git a/Emby.Drawing/Properties/AssemblyInfo.cs b/Emby.Drawing/Properties/AssemblyInfo.cs
index 8dfefe0af..281008e37 100644
--- a/Emby.Drawing/Properties/AssemblyInfo.cs
+++ b/Emby.Drawing/Properties/AssemblyInfo.cs
@@ -8,8 +8,8 @@ using System.Runtime.InteropServices;
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Jellyfin Project")]
-[assembly: AssemblyProduct("Jellyfin: The Free Software Media System")]
-[assembly: AssemblyCopyright("Copyright © 2019 Jellyfin Contributors. Code released under the GNU General Public License Version 2")]
+[assembly: AssemblyProduct("Jellyfin Server")]
+[assembly: AssemblyCopyright("Copyright © 2019 Jellyfin Contributors. Code released under the GNU General Public License")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
diff --git a/Emby.IsoMounting/IsoMounter/LinuxIsoManager.cs b/Emby.IsoMounting/IsoMounter/LinuxIsoManager.cs
index 943caa3e6..2f0003be8 100644
--- a/Emby.IsoMounting/IsoMounter/LinuxIsoManager.cs
+++ b/Emby.IsoMounting/IsoMounter/LinuxIsoManager.cs
@@ -7,6 +7,7 @@ using MediaBrowser.Model.Diagnostics;
using MediaBrowser.Model.IO;
using MediaBrowser.Model.System;
using Microsoft.Extensions.Logging;
+using OperatingSystem = MediaBrowser.Common.System.OperatingSystem;
namespace IsoMounter
{
@@ -17,7 +18,6 @@ namespace IsoMounter
#region Private Fields
- private readonly IEnvironmentInfo EnvironmentInfo;
private readonly bool ExecutablesAvailable;
private readonly ILogger _logger;
private readonly string MountCommand;
@@ -30,10 +30,8 @@ namespace IsoMounter
#region Constructor(s)
- public LinuxIsoManager(ILogger logger, IEnvironmentInfo environment, IProcessFactory processFactory)
+ public LinuxIsoManager(ILogger logger, IProcessFactory processFactory)
{
-
- EnvironmentInfo = environment;
_logger = logger;
ProcessFactory = processFactory;
@@ -109,7 +107,7 @@ namespace IsoMounter
public bool CanMount(string path)
{
- if (EnvironmentInfo.OperatingSystem != MediaBrowser.Model.System.OperatingSystem.Linux)
+ if (OperatingSystem.Id != OperatingSystemId.Linux)
{
return false;
}
@@ -118,7 +116,7 @@ namespace IsoMounter
Name,
path,
Path.GetExtension(path),
- EnvironmentInfo.OperatingSystem,
+ OperatingSystem.Name,
ExecutablesAvailable
);
diff --git a/Emby.IsoMounting/IsoMounter/Properties/AssemblyInfo.cs b/Emby.IsoMounting/IsoMounter/Properties/AssemblyInfo.cs
index d60eccc2e..5956fc3b3 100644
--- a/Emby.IsoMounting/IsoMounter/Properties/AssemblyInfo.cs
+++ b/Emby.IsoMounting/IsoMounter/Properties/AssemblyInfo.cs
@@ -9,8 +9,8 @@ using System.Runtime.InteropServices;
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Jellyfin Project")]
-[assembly: AssemblyProduct("Jellyfin: The Free Software Media System")]
-[assembly: AssemblyCopyright("Copyright © 2019 Jellyfin Contributors. Code released under the GNU General Public License Version 2")]
+[assembly: AssemblyProduct("Jellyfin Server")]
+[assembly: AssemblyCopyright("Copyright © 2019 Jellyfin Contributors. Code released under the GNU General Public License")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: NeutralResourcesLanguage("en")]
diff --git a/Emby.Naming/Properties/AssemblyInfo.cs b/Emby.Naming/Properties/AssemblyInfo.cs
index 15311570b..f26e0ba79 100644
--- a/Emby.Naming/Properties/AssemblyInfo.cs
+++ b/Emby.Naming/Properties/AssemblyInfo.cs
@@ -9,8 +9,8 @@ using System.Runtime.InteropServices;
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Jellyfin Project")]
-[assembly: AssemblyProduct("Jellyfin: The Free Software Media System")]
-[assembly: AssemblyCopyright("Copyright © 2019 Jellyfin Contributors. Code released under the GNU General Public License Version 2")]
+[assembly: AssemblyProduct("Jellyfin Server")]
+[assembly: AssemblyCopyright("Copyright © 2019 Jellyfin Contributors. Code released under the GNU General Public License")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: NeutralResourcesLanguage("en")]
diff --git a/Emby.Notifications/Properties/AssemblyInfo.cs b/Emby.Notifications/Properties/AssemblyInfo.cs
index fd7037551..5c82c90c4 100644
--- a/Emby.Notifications/Properties/AssemblyInfo.cs
+++ b/Emby.Notifications/Properties/AssemblyInfo.cs
@@ -9,8 +9,8 @@ using System.Runtime.InteropServices;
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Jellyfin Project")]
-[assembly: AssemblyProduct("Jellyfin: The Free Software Media System")]
-[assembly: AssemblyCopyright("Copyright © 2019 Jellyfin Contributors. Code released under the GNU General Public License Version 2")]
+[assembly: AssemblyProduct("Jellyfin Server")]
+[assembly: AssemblyCopyright("Copyright © 2019 Jellyfin Contributors. Code released under the GNU General Public License")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: NeutralResourcesLanguage("en")]
diff --git a/Emby.Photos/Properties/AssemblyInfo.cs b/Emby.Photos/Properties/AssemblyInfo.cs
index 262125d38..a3bb4362a 100644
--- a/Emby.Photos/Properties/AssemblyInfo.cs
+++ b/Emby.Photos/Properties/AssemblyInfo.cs
@@ -9,8 +9,8 @@ using System.Runtime.InteropServices;
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Jellyfin Project")]
-[assembly: AssemblyProduct("Jellyfin: The Free Software Media System")]
-[assembly: AssemblyCopyright("Copyright © 2019 Jellyfin Contributors. Code released under the GNU General Public License Version 2")]
+[assembly: AssemblyProduct("Jellyfin Server")]
+[assembly: AssemblyCopyright("Copyright © 2019 Jellyfin Contributors. Code released under the GNU General Public License")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: NeutralResourcesLanguage("en")]
diff --git a/Emby.Server.Implementations/Activity/ActivityLogEntryPoint.cs b/Emby.Server.Implementations/Activity/ActivityLogEntryPoint.cs
index 739f68767..98cd97c31 100644
--- a/Emby.Server.Implementations/Activity/ActivityLogEntryPoint.cs
+++ b/Emby.Server.Implementations/Activity/ActivityLogEntryPoint.cs
@@ -30,13 +30,10 @@ namespace Emby.Server.Implementations.Activity
public class ActivityLogEntryPoint : IServerEntryPoint
{
private readonly IInstallationManager _installationManager;
-
- //private readonly ILogger _logger;
private readonly ISessionManager _sessionManager;
private readonly ITaskManager _taskManager;
private readonly IActivityManager _activityManager;
private readonly ILocalizationManager _localization;
-
private readonly ILibraryManager _libraryManager;
private readonly ISubtitleManager _subManager;
private readonly IUserManager _userManager;
@@ -61,41 +58,37 @@ namespace Emby.Server.Implementations.Activity
public Task RunAsync()
{
- _taskManager.TaskCompleted += _taskManager_TaskCompleted;
-
- _installationManager.PluginInstalled += _installationManager_PluginInstalled;
- _installationManager.PluginUninstalled += _installationManager_PluginUninstalled;
- _installationManager.PluginUpdated += _installationManager_PluginUpdated;
- _installationManager.PackageInstallationFailed += _installationManager_PackageInstallationFailed;
+ _taskManager.TaskCompleted += OnTaskCompleted;
- _sessionManager.SessionStarted += _sessionManager_SessionStarted;
- _sessionManager.AuthenticationFailed += _sessionManager_AuthenticationFailed;
- _sessionManager.AuthenticationSucceeded += _sessionManager_AuthenticationSucceeded;
- _sessionManager.SessionEnded += _sessionManager_SessionEnded;
+ _installationManager.PluginInstalled += OnPluginInstalled;
+ _installationManager.PluginUninstalled += OnPluginUninstalled;
+ _installationManager.PluginUpdated += OnPluginUpdated;
+ _installationManager.PackageInstallationFailed += OnPackageInstallationFailed;
- _sessionManager.PlaybackStart += _sessionManager_PlaybackStart;
- _sessionManager.PlaybackStopped += _sessionManager_PlaybackStopped;
+ _sessionManager.SessionStarted += OnSessionStarted;
+ _sessionManager.AuthenticationFailed += OnAuthenticationFailed;
+ _sessionManager.AuthenticationSucceeded += OnAuthenticationSucceeded;
+ _sessionManager.SessionEnded += OnSessionEnded;
- //_subManager.SubtitlesDownloaded += _subManager_SubtitlesDownloaded;
- _subManager.SubtitleDownloadFailure += _subManager_SubtitleDownloadFailure;
+ _sessionManager.PlaybackStart += OnPlaybackStart;
+ _sessionManager.PlaybackStopped += OnPlaybackStopped;
- _userManager.UserCreated += _userManager_UserCreated;
- _userManager.UserPasswordChanged += _userManager_UserPasswordChanged;
- _userManager.UserDeleted += _userManager_UserDeleted;
- _userManager.UserPolicyUpdated += _userManager_UserPolicyUpdated;
- _userManager.UserLockedOut += _userManager_UserLockedOut;
+ _subManager.SubtitleDownloadFailure += OnSubtitleDownloadFailure;
- //_config.ConfigurationUpdated += _config_ConfigurationUpdated;
- //_config.NamedConfigurationUpdated += _config_NamedConfigurationUpdated;
+ _userManager.UserCreated += OnUserCreated;
+ _userManager.UserPasswordChanged += OnUserPasswordChanged;
+ _userManager.UserDeleted += OnUserDeleted;
+ _userManager.UserPolicyUpdated += OnUserPolicyUpdated;
+ _userManager.UserLockedOut += OnUserLockedOut;
- _deviceManager.CameraImageUploaded += _deviceManager_CameraImageUploaded;
+ _deviceManager.CameraImageUploaded += OnCameraImageUploaded;
- _appHost.ApplicationUpdated += _appHost_ApplicationUpdated;
+ _appHost.ApplicationUpdated += OnApplicationUpdated;
return Task.CompletedTask;
}
- void _deviceManager_CameraImageUploaded(object sender, GenericEventArgs<CameraImageUploadInfo> e)
+ private void OnCameraImageUploaded(object sender, GenericEventArgs<CameraImageUploadInfo> e)
{
CreateLogEntry(new ActivityLogEntry
{
@@ -104,7 +97,7 @@ namespace Emby.Server.Implementations.Activity
});
}
- void _userManager_UserLockedOut(object sender, GenericEventArgs<User> e)
+ private void OnUserLockedOut(object sender, GenericEventArgs<User> e)
{
CreateLogEntry(new ActivityLogEntry
{
@@ -114,7 +107,7 @@ namespace Emby.Server.Implementations.Activity
});
}
- void _subManager_SubtitleDownloadFailure(object sender, SubtitleDownloadFailureEventArgs e)
+ private void OnSubtitleDownloadFailure(object sender, SubtitleDownloadFailureEventArgs e)
{
CreateLogEntry(new ActivityLogEntry
{
@@ -125,7 +118,7 @@ namespace Emby.Server.Implementations.Activity
});
}
- void _sessionManager_PlaybackStopped(object sender, PlaybackStopEventArgs e)
+ private void OnPlaybackStopped(object sender, PlaybackStopEventArgs e)
{
var item = e.MediaInfo;
@@ -146,7 +139,7 @@ namespace Emby.Server.Implementations.Activity
return;
}
- var user = e.Users.First();
+ var user = e.Users[0];
CreateLogEntry(new ActivityLogEntry
{
@@ -156,7 +149,7 @@ namespace Emby.Server.Implementations.Activity
});
}
- void _sessionManager_PlaybackStart(object sender, PlaybackProgressEventArgs e)
+ private void OnPlaybackStart(object sender, PlaybackProgressEventArgs e)
{
var item = e.MediaInfo;
@@ -232,7 +225,7 @@ namespace Emby.Server.Implementations.Activity
return null;
}
- void _sessionManager_SessionEnded(object sender, SessionEventArgs e)
+ private void OnSessionEnded(object sender, SessionEventArgs e)
{
string name;
var session = e.SessionInfo;
@@ -258,7 +251,7 @@ namespace Emby.Server.Implementations.Activity
});
}
- void _sessionManager_AuthenticationSucceeded(object sender, GenericEventArgs<AuthenticationResult> e)
+ private void OnAuthenticationSucceeded(object sender, GenericEventArgs<AuthenticationResult> e)
{
var user = e.Argument.User;
@@ -271,7 +264,7 @@ namespace Emby.Server.Implementations.Activity
});
}
- void _sessionManager_AuthenticationFailed(object sender, GenericEventArgs<AuthenticationRequest> e)
+ private void OnAuthenticationFailed(object sender, GenericEventArgs<AuthenticationRequest> e)
{
CreateLogEntry(new ActivityLogEntry
{
@@ -282,7 +275,7 @@ namespace Emby.Server.Implementations.Activity
});
}
- void _appHost_ApplicationUpdated(object sender, GenericEventArgs<PackageVersionInfo> e)
+ private void OnApplicationUpdated(object sender, GenericEventArgs<PackageVersionInfo> e)
{
CreateLogEntry(new ActivityLogEntry
{
@@ -292,25 +285,7 @@ namespace Emby.Server.Implementations.Activity
});
}
- void _config_NamedConfigurationUpdated(object sender, ConfigurationUpdateEventArgs e)
- {
- CreateLogEntry(new ActivityLogEntry
- {
- Name = string.Format(_localization.GetLocalizedString("MessageNamedServerConfigurationUpdatedWithValue"), e.Key),
- Type = "NamedConfigurationUpdated"
- });
- }
-
- void _config_ConfigurationUpdated(object sender, EventArgs e)
- {
- CreateLogEntry(new ActivityLogEntry
- {
- Name = _localization.GetLocalizedString("MessageServerConfigurationUpdated"),
- Type = "ServerConfigurationUpdated"
- });
- }
-
- void _userManager_UserPolicyUpdated(object sender, GenericEventArgs<User> e)
+ private void OnUserPolicyUpdated(object sender, GenericEventArgs<User> e)
{
CreateLogEntry(new ActivityLogEntry
{
@@ -320,7 +295,7 @@ namespace Emby.Server.Implementations.Activity
});
}
- void _userManager_UserDeleted(object sender, GenericEventArgs<User> e)
+ private void OnUserDeleted(object sender, GenericEventArgs<User> e)
{
CreateLogEntry(new ActivityLogEntry
{
@@ -329,7 +304,7 @@ namespace Emby.Server.Implementations.Activity
});
}
- void _userManager_UserPasswordChanged(object sender, GenericEventArgs<User> e)
+ private void OnUserPasswordChanged(object sender, GenericEventArgs<User> e)
{
CreateLogEntry(new ActivityLogEntry
{
@@ -339,7 +314,7 @@ namespace Emby.Server.Implementations.Activity
});
}
- void _userManager_UserCreated(object sender, GenericEventArgs<User> e)
+ private void OnUserCreated(object sender, GenericEventArgs<User> e)
{
CreateLogEntry(new ActivityLogEntry
{
@@ -349,18 +324,7 @@ namespace Emby.Server.Implementations.Activity
});
}
- void _subManager_SubtitlesDownloaded(object sender, SubtitleDownloadEventArgs e)
- {
- CreateLogEntry(new ActivityLogEntry
- {
- Name = string.Format(_localization.GetLocalizedString("SubtitlesDownloadedForItem"), Notifications.Notifications.GetItemName(e.Item)),
- Type = "SubtitlesDownloaded",
- ItemId = e.Item.Id.ToString("N"),
- ShortOverview = string.Format(_localization.GetLocalizedString("ProviderValue"), e.Provider)
- });
- }
-
- void _sessionManager_SessionStarted(object sender, SessionEventArgs e)
+ private void OnSessionStarted(object sender, SessionEventArgs e)
{
string name;
var session = e.SessionInfo;
@@ -386,7 +350,7 @@ namespace Emby.Server.Implementations.Activity
});
}
- void _installationManager_PluginUpdated(object sender, GenericEventArgs<Tuple<IPlugin, PackageVersionInfo>> e)
+ private void OnPluginUpdated(object sender, GenericEventArgs<Tuple<IPlugin, PackageVersionInfo>> e)
{
CreateLogEntry(new ActivityLogEntry
{
@@ -397,7 +361,7 @@ namespace Emby.Server.Implementations.Activity
});
}
- void _installationManager_PluginUninstalled(object sender, GenericEventArgs<IPlugin> e)
+ private void OnPluginUninstalled(object sender, GenericEventArgs<IPlugin> e)
{
CreateLogEntry(new ActivityLogEntry
{
@@ -406,7 +370,7 @@ namespace Emby.Server.Implementations.Activity
});
}
- void _installationManager_PluginInstalled(object sender, GenericEventArgs<PackageVersionInfo> e)
+ private void OnPluginInstalled(object sender, GenericEventArgs<PackageVersionInfo> e)
{
CreateLogEntry(new ActivityLogEntry
{
@@ -416,7 +380,7 @@ namespace Emby.Server.Implementations.Activity
});
}
- void _installationManager_PackageInstallationFailed(object sender, InstallationFailedEventArgs e)
+ private void OnPackageInstallationFailed(object sender, InstallationFailedEventArgs e)
{
var installationInfo = e.InstallationInfo;
@@ -429,7 +393,7 @@ namespace Emby.Server.Implementations.Activity
});
}
- void _taskManager_TaskCompleted(object sender, TaskCompletionEventArgs e)
+ private void OnTaskCompleted(object sender, TaskCompletionEventArgs e)
{
var result = e.Result;
var task = e.Task;
@@ -468,48 +432,36 @@ namespace Emby.Server.Implementations.Activity
}
private void CreateLogEntry(ActivityLogEntry entry)
- {
- try
- {
- _activityManager.Create(entry);
- }
- catch
- {
- // Logged at lower levels
- }
- }
+ => _activityManager.Create(entry);
public void Dispose()
{
- _taskManager.TaskCompleted -= _taskManager_TaskCompleted;
+ _taskManager.TaskCompleted -= OnTaskCompleted;
- _installationManager.PluginInstalled -= _installationManager_PluginInstalled;
- _installationManager.PluginUninstalled -= _installationManager_PluginUninstalled;
- _installationManager.PluginUpdated -= _installationManager_PluginUpdated;
- _installationManager.PackageInstallationFailed -= _installationManager_PackageInstallationFailed;
+ _installationManager.PluginInstalled -= OnPluginInstalled;
+ _installationManager.PluginUninstalled -= OnPluginUninstalled;
+ _installationManager.PluginUpdated -= OnPluginUpdated;
+ _installationManager.PackageInstallationFailed -= OnPackageInstallationFailed;
- _sessionManager.SessionStarted -= _sessionManager_SessionStarted;
- _sessionManager.AuthenticationFailed -= _sessionManager_AuthenticationFailed;
- _sessionManager.AuthenticationSucceeded -= _sessionManager_AuthenticationSucceeded;
- _sessionManager.SessionEnded -= _sessionManager_SessionEnded;
+ _sessionManager.SessionStarted -= OnSessionStarted;
+ _sessionManager.AuthenticationFailed -= OnAuthenticationFailed;
+ _sessionManager.AuthenticationSucceeded -= OnAuthenticationSucceeded;
+ _sessionManager.SessionEnded -= OnSessionEnded;
- _sessionManager.PlaybackStart -= _sessionManager_PlaybackStart;
- _sessionManager.PlaybackStopped -= _sessionManager_PlaybackStopped;
+ _sessionManager.PlaybackStart -= OnPlaybackStart;
+ _sessionManager.PlaybackStopped -= OnPlaybackStopped;
- _subManager.SubtitleDownloadFailure -= _subManager_SubtitleDownloadFailure;
+ _subManager.SubtitleDownloadFailure -= OnSubtitleDownloadFailure;
- _userManager.UserCreated -= _userManager_UserCreated;
- _userManager.UserPasswordChanged -= _userManager_UserPasswordChanged;
- _userManager.UserDeleted -= _userManager_UserDeleted;
- _userManager.UserPolicyUpdated -= _userManager_UserPolicyUpdated;
- _userManager.UserLockedOut -= _userManager_UserLockedOut;
+ _userManager.UserCreated -= OnUserCreated;
+ _userManager.UserPasswordChanged -= OnUserPasswordChanged;
+ _userManager.UserDeleted -= OnUserDeleted;
+ _userManager.UserPolicyUpdated -= OnUserPolicyUpdated;
+ _userManager.UserLockedOut -= OnUserLockedOut;
- _config.ConfigurationUpdated -= _config_ConfigurationUpdated;
- _config.NamedConfigurationUpdated -= _config_NamedConfigurationUpdated;
+ _deviceManager.CameraImageUploaded -= OnCameraImageUploaded;
- _deviceManager.CameraImageUploaded -= _deviceManager_CameraImageUploaded;
-
- _appHost.ApplicationUpdated -= _appHost_ApplicationUpdated;
+ _appHost.ApplicationUpdated -= OnApplicationUpdated;
}
/// <summary>
@@ -531,6 +483,7 @@ namespace Emby.Server.Implementations.Activity
values.Add(CreateValueString(years, "year"));
days = days % DaysInYear;
}
+
// Number of months
if (days >= DaysInMonth)
{
@@ -538,25 +491,39 @@ namespace Emby.Server.Implementations.Activity
values.Add(CreateValueString(months, "month"));
days = days % DaysInMonth;
}
+
// Number of days
if (days >= 1)
+ {
values.Add(CreateValueString(days, "day"));
+ }
+
// Number of hours
if (span.Hours >= 1)
+ {
values.Add(CreateValueString(span.Hours, "hour"));
+ }
// Number of minutes
if (span.Minutes >= 1)
+ {
values.Add(CreateValueString(span.Minutes, "minute"));
+ }
+
// Number of seconds (include when 0 if no other components included)
if (span.Seconds >= 1 || values.Count == 0)
+ {
values.Add(CreateValueString(span.Seconds, "second"));
+ }
// Combine values into string
var builder = new StringBuilder();
for (int i = 0; i < values.Count; i++)
{
if (builder.Length > 0)
+ {
builder.Append(i == values.Count - 1 ? " and " : ", ");
+ }
+
builder.Append(values[i]);
}
// Return result
diff --git a/Emby.Server.Implementations/AppBase/BaseApplicationPaths.cs b/Emby.Server.Implementations/AppBase/BaseApplicationPaths.cs
index 65cdccfa5..00cfa0c9a 100644
--- a/Emby.Server.Implementations/AppBase/BaseApplicationPaths.cs
+++ b/Emby.Server.Implementations/AppBase/BaseApplicationPaths.cs
@@ -17,12 +17,14 @@ namespace Emby.Server.Implementations.AppBase
string programDataPath,
string logDirectoryPath,
string configurationDirectoryPath,
- string cacheDirectoryPath)
+ string cacheDirectoryPath,
+ string webDirectoryPath)
{
ProgramDataPath = programDataPath;
LogDirectoryPath = logDirectoryPath;
ConfigurationDirectoryPath = configurationDirectoryPath;
CachePath = cacheDirectoryPath;
+ WebPath = webDirectoryPath;
DataPath = Path.Combine(ProgramDataPath, "data");
}
@@ -34,6 +36,12 @@ namespace Emby.Server.Implementations.AppBase
public string ProgramDataPath { get; private set; }
/// <summary>
+ /// Gets the path to the web UI resources folder
+ /// </summary>
+ /// <value>The web UI resources path.</value>
+ public string WebPath { get; set; }
+
+ /// <summary>
/// Gets the path to the system folder
/// </summary>
public string ProgramSystemPath { get; } = AppContext.BaseDirectory;
diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.cs
index 2f396f814..0b4c161fd 100644
--- a/Emby.Server.Implementations/ApplicationHost.cs
+++ b/Emby.Server.Implementations/ApplicationHost.cs
@@ -37,7 +37,6 @@ using Emby.Server.Implementations.LiveTv;
using Emby.Server.Implementations.Localization;
using Emby.Server.Implementations.Net;
using Emby.Server.Implementations.Playlists;
-using Emby.Server.Implementations.Reflection;
using Emby.Server.Implementations.ScheduledTasks;
using Emby.Server.Implementations.Security;
using Emby.Server.Implementations.Serialization;
@@ -45,7 +44,6 @@ using Emby.Server.Implementations.Session;
using Emby.Server.Implementations.SocketSharp;
using Emby.Server.Implementations.TV;
using Emby.Server.Implementations.Updates;
-using Emby.Server.Implementations.Xml;
using MediaBrowser.Api;
using MediaBrowser.Common;
using MediaBrowser.Common.Configuration;
@@ -93,13 +91,11 @@ using MediaBrowser.Model.Globalization;
using MediaBrowser.Model.IO;
using MediaBrowser.Model.MediaInfo;
using MediaBrowser.Model.Net;
-using MediaBrowser.Model.Reflection;
using MediaBrowser.Model.Serialization;
using MediaBrowser.Model.Services;
using MediaBrowser.Model.System;
using MediaBrowser.Model.Tasks;
using MediaBrowser.Model.Updates;
-using MediaBrowser.Model.Xml;
using MediaBrowser.Providers.Chapters;
using MediaBrowser.Providers.Manager;
using MediaBrowser.Providers.Subtitles;
@@ -115,6 +111,7 @@ using Microsoft.Extensions.Logging;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
using ServiceStack;
+using OperatingSystem = MediaBrowser.Common.System.OperatingSystem;
namespace Emby.Server.Implementations
{
@@ -143,12 +140,8 @@ namespace Emby.Server.Implementations
return false;
}
- if (EnvironmentInfo.OperatingSystem == MediaBrowser.Model.System.OperatingSystem.Windows)
- {
- return true;
- }
-
- if (EnvironmentInfo.OperatingSystem == MediaBrowser.Model.System.OperatingSystem.OSX)
+ if (OperatingSystem.Id == OperatingSystemId.Windows
+ || OperatingSystem.Id == OperatingSystemId.Darwin)
{
return true;
}
@@ -168,7 +161,7 @@ namespace Emby.Server.Implementations
public event EventHandler<GenericEventArgs<PackageVersionInfo>> ApplicationUpdated;
/// <summary>
- /// Gets or sets a value indicating whether this instance has changes that require the entire application to restart.
+ /// Gets a value indicating whether this instance has changes that require the entire application to restart.
/// </summary>
/// <value><c>true</c> if this instance has pending application restart; otherwise, <c>false</c>.</value>
public bool HasPendingRestart { get; private set; }
@@ -182,7 +175,7 @@ namespace Emby.Server.Implementations
protected ILogger Logger { get; set; }
/// <summary>
- /// Gets or sets the plugins.
+ /// Gets the plugins.
/// </summary>
/// <value>The plugins.</value>
public IPlugin[] Plugins { get; protected set; }
@@ -194,13 +187,13 @@ namespace Emby.Server.Implementations
public ILoggerFactory LoggerFactory { get; protected set; }
/// <summary>
- /// Gets the application paths.
+ /// Gets or sets the application paths.
/// </summary>
/// <value>The application paths.</value>
protected ServerApplicationPaths ApplicationPaths { get; set; }
/// <summary>
- /// Gets all concrete types.
+ /// Gets or sets all concrete types.
/// </summary>
/// <value>All concrete types.</value>
public Type[] AllConcreteTypes { get; protected set; }
@@ -208,7 +201,7 @@ namespace Emby.Server.Implementations
/// <summary>
/// The disposable parts
/// </summary>
- protected readonly List<IDisposable> DisposableParts = new List<IDisposable>();
+ private readonly List<IDisposable> _disposableParts = new List<IDisposable>();
/// <summary>
/// Gets the configuration manager.
@@ -218,16 +211,15 @@ namespace Emby.Server.Implementations
public IFileSystem FileSystemManager { get; set; }
- protected IEnvironmentInfo EnvironmentInfo { get; set; }
-
public PackageVersionClass SystemUpdateLevel
{
get
{
#if BETA
return PackageVersionClass.Beta;
-#endif
+#else
return PackageVersionClass.Release;
+#endif
}
}
@@ -239,15 +231,6 @@ namespace Emby.Server.Implementations
/// <value>The server configuration manager.</value>
public IServerConfigurationManager ServerConfigurationManager => (IServerConfigurationManager)ConfigurationManager;
- /// <summary>
- /// Gets the configuration manager.
- /// </summary>
- /// <returns>IConfigurationManager.</returns>
- protected IConfigurationManager GetConfigurationManager()
- {
- return new ServerConfigurationManager(ApplicationPaths, LoggerFactory, XmlSerializer, FileSystemManager);
- }
-
protected virtual IResourceFileManager CreateResourceFileManager()
{
return new ResourceFileManager(HttpResultFactory, LoggerFactory, FileSystemManager);
@@ -258,27 +241,33 @@ namespace Emby.Server.Implementations
/// </summary>
/// <value>The user manager.</value>
public IUserManager UserManager { get; set; }
+
/// <summary>
/// Gets or sets the library manager.
/// </summary>
/// <value>The library manager.</value>
internal ILibraryManager LibraryManager { get; set; }
+
/// <summary>
/// Gets or sets the directory watchers.
/// </summary>
/// <value>The directory watchers.</value>
private ILibraryMonitor LibraryMonitor { get; set; }
+
/// <summary>
/// Gets or sets the provider manager.
/// </summary>
/// <value>The provider manager.</value>
private IProviderManager ProviderManager { get; set; }
+
/// <summary>
/// Gets or sets the HTTP server.
/// </summary>
/// <value>The HTTP server.</value>
private IHttpServer HttpServer { get; set; }
+
private IDtoService DtoService { get; set; }
+
public IImageProcessor ImageProcessor { get; set; }
/// <summary>
@@ -286,6 +275,7 @@ namespace Emby.Server.Implementations
/// </summary>
/// <value>The media encoder.</value>
private IMediaEncoder MediaEncoder { get; set; }
+
private ISubtitleEncoder SubtitleEncoder { get; set; }
private ISessionManager SessionManager { get; set; }
@@ -295,6 +285,7 @@ namespace Emby.Server.Implementations
public LocalizationManager LocalizationManager { get; set; }
private IEncodingManager EncodingManager { get; set; }
+
private IChannelManager ChannelManager { get; set; }
/// <summary>
@@ -302,20 +293,29 @@ namespace Emby.Server.Implementations
/// </summary>
/// <value>The user data repository.</value>
private IUserDataManager UserDataManager { get; set; }
+
private IUserRepository UserRepository { get; set; }
+
internal SqliteItemRepository ItemRepository { get; set; }
private INotificationManager NotificationManager { get; set; }
+
private ISubtitleManager SubtitleManager { get; set; }
+
private IChapterManager ChapterManager { get; set; }
+
private IDeviceManager DeviceManager { get; set; }
internal IUserViewManager UserViewManager { get; set; }
private IAuthenticationRepository AuthenticationRepository { get; set; }
+
private ITVSeriesManager TVSeriesManager { get; set; }
+
private ICollectionManager CollectionManager { get; set; }
+
private IMediaSourceManager MediaSourceManager { get; set; }
+
private IPlaylistManager PlaylistManager { get; set; }
private readonly IConfiguration _configuration;
@@ -331,52 +331,55 @@ namespace Emby.Server.Implementations
/// </summary>
/// <value>The zip client.</value>
protected IZipClient ZipClient { get; private set; }
+
protected IHttpResultFactory HttpResultFactory { get; private set; }
+
protected IAuthService AuthService { get; private set; }
- public IStartupOptions StartupOptions { get; private set; }
+ public IStartupOptions StartupOptions { get; }
internal IImageEncoder ImageEncoder { get; private set; }
protected IProcessFactory ProcessFactory { get; private set; }
- protected ICryptoProvider CryptographyProvider = new CryptographyProvider();
+
protected readonly IXmlSerializer XmlSerializer;
protected ISocketFactory SocketFactory { get; private set; }
+
protected ITaskManager TaskManager { get; private set; }
+
public IHttpClient HttpClient { get; private set; }
+
protected INetworkManager NetworkManager { get; set; }
+
public IJsonSerializer JsonSerializer { get; private set; }
+
protected IIsoManager IsoManager { get; private set; }
/// <summary>
/// Initializes a new instance of the <see cref="ApplicationHost" /> class.
/// </summary>
- public ApplicationHost(ServerApplicationPaths applicationPaths,
+ public ApplicationHost(
+ ServerApplicationPaths applicationPaths,
ILoggerFactory loggerFactory,
IStartupOptions options,
IFileSystem fileSystem,
- IEnvironmentInfo environmentInfo,
IImageEncoder imageEncoder,
INetworkManager networkManager,
IConfiguration configuration)
{
_configuration = configuration;
- // hack alert, until common can target .net core
- BaseExtensions.CryptographyProvider = CryptographyProvider;
-
XmlSerializer = new MyXmlSerializer(fileSystem, loggerFactory);
NetworkManager = networkManager;
networkManager.LocalSubnetsFn = GetConfiguredLocalSubnets;
- EnvironmentInfo = environmentInfo;
ApplicationPaths = applicationPaths;
LoggerFactory = loggerFactory;
FileSystemManager = fileSystem;
- ConfigurationManager = GetConfigurationManager();
+ ConfigurationManager = new ServerConfigurationManager(ApplicationPaths, LoggerFactory, XmlSerializer, FileSystemManager);
Logger = LoggerFactory.CreateLogger("App");
@@ -415,7 +418,7 @@ namespace Emby.Server.Implementations
_validAddressResults.Clear();
}
- public string ApplicationVersion => typeof(ApplicationHost).Assembly.GetName().Version.ToString(3);
+ public string ApplicationVersion { get; } = typeof(ApplicationHost).Assembly.GetName().Version.ToString(3);
/// <summary>
/// Gets the current application user agent
@@ -423,14 +426,23 @@ namespace Emby.Server.Implementations
/// <value>The application user agent.</value>
public string ApplicationUserAgent => Name.Replace(' ','-') + "/" + ApplicationVersion;
+ /// <summary>
+ /// Gets the email address for use within a comment section of a user agent field.
+ /// Presently used to provide contact information to MusicBrainz service.
+ /// </summary>
+ public string ApplicationUserAgentAddress { get; } = "team@jellyfin.org";
+
private string _productName;
+
/// <summary>
/// Gets the current application name
/// </summary>
/// <value>The application name.</value>
- public string ApplicationProductName => _productName ?? (_productName = FileVersionInfo.GetVersionInfo(Assembly.GetEntryAssembly().Location).ProductName);
+ public string ApplicationProductName
+ => _productName ?? (_productName = FileVersionInfo.GetVersionInfo(Assembly.GetEntryAssembly().Location).ProductName);
private DeviceId _deviceId;
+
public string SystemId
{
get
@@ -461,15 +473,15 @@ namespace Emby.Server.Implementations
/// <summary>
/// Creates an instance of type and resolves all constructor dependencies
/// </summary>
- /// <param name="type">The type.</param>
- /// <returns>System.Object.</returns>
+ /// /// <typeparam name="T">The type</typeparam>
+ /// <returns>T</returns>
public T CreateInstance<T>()
=> ActivatorUtilities.CreateInstance<T>(_serviceProvider);
/// <summary>
/// Creates the instance safe.
/// </summary>
- /// <param name="typeInfo">The type information.</param>
+ /// <param name="type">The type.</param>
/// <returns>System.Object.</returns>
protected object CreateInstanceSafe(Type type)
{
@@ -488,14 +500,14 @@ namespace Emby.Server.Implementations
/// <summary>
/// Resolves this instance.
/// </summary>
- /// <typeparam name="T"></typeparam>
+ /// <typeparam name="T">The type</typeparam>
/// <returns>``0.</returns>
public T Resolve<T>() => _serviceProvider.GetService<T>();
/// <summary>
/// Gets the export types.
/// </summary>
- /// <typeparam name="T"></typeparam>
+ /// <typeparam name="T">The type</typeparam>
/// <returns>IEnumerable{Type}.</returns>
public IEnumerable<Type> GetExportTypes<T>()
{
@@ -507,22 +519,22 @@ namespace Emby.Server.Implementations
/// <summary>
/// Gets the exports.
/// </summary>
- /// <typeparam name="T"></typeparam>
+ /// <typeparam name="T">The type</typeparam>
/// <param name="manageLifetime">if set to <c>true</c> [manage lifetime].</param>
/// <returns>IEnumerable{``0}.</returns>
public IEnumerable<T> GetExports<T>(bool manageLifetime = true)
{
var parts = GetExportTypes<T>()
- .Select(x => CreateInstanceSafe(x))
+ .Select(CreateInstanceSafe)
.Where(i => i != null)
.Cast<T>()
.ToList(); // Convert to list so this isn't executed for each iteration
if (manageLifetime)
{
- lock (DisposableParts)
+ lock (_disposableParts)
{
- DisposableParts.AddRange(parts.OfType<IDisposable>());
+ _disposableParts.AddRange(parts.OfType<IDisposable>());
}
}
@@ -532,7 +544,7 @@ namespace Emby.Server.Implementations
/// <summary>
/// Runs the startup tasks.
/// </summary>
- public async Task RunStartupTasks()
+ public async Task RunStartupTasksAsync()
{
Logger.LogInformation("Running startup tasks");
@@ -542,29 +554,20 @@ namespace Emby.Server.Implementations
MediaEncoder.SetFFmpegPath();
- //if (string.IsNullOrWhiteSpace(MediaEncoder.EncoderPath))
- //{
- // if (ServerConfigurationManager.Configuration.IsStartupWizardCompleted)
- // {
- // ServerConfigurationManager.Configuration.IsStartupWizardCompleted = false;
- // ServerConfigurationManager.SaveConfiguration();
- // }
- //}
-
Logger.LogInformation("ServerId: {0}", SystemId);
- var entryPoints = GetExports<IServerEntryPoint>();
+ var entryPoints = GetExports<IServerEntryPoint>().ToList();
var stopWatch = new Stopwatch();
stopWatch.Start();
- await Task.WhenAll(StartEntryPoints(entryPoints, true));
+ await Task.WhenAll(StartEntryPoints(entryPoints, true)).ConfigureAwait(false);
Logger.LogInformation("Executed all pre-startup entry points in {Elapsed:g}", stopWatch.Elapsed);
Logger.LogInformation("Core startup complete");
HttpServer.GlobalResponse = null;
stopWatch.Restart();
- await Task.WhenAll(StartEntryPoints(entryPoints, false));
+ await Task.WhenAll(StartEntryPoints(entryPoints, false)).ConfigureAwait(false);
Logger.LogInformation("Executed all post-startup entry points in {Elapsed:g}", stopWatch.Elapsed);
stopWatch.Stop();
}
@@ -584,7 +587,7 @@ namespace Emby.Server.Implementations
}
}
- public async Task Init(IServiceCollection serviceCollection)
+ public async Task InitAsync(IServiceCollection serviceCollection)
{
HttpPort = ServerConfigurationManager.Configuration.HttpServerPortNumber;
HttpsPort = ServerConfigurationManager.Configuration.HttpsPortNumber;
@@ -614,14 +617,14 @@ namespace Emby.Server.Implementations
SetHttpLimit();
- await RegisterResources(serviceCollection);
+ await RegisterResources(serviceCollection).ConfigureAwait(false);
FindParts();
string contentRoot = ServerConfigurationManager.Configuration.DashboardSourcePath;
if (string.IsNullOrEmpty(contentRoot))
{
- contentRoot = Path.Combine(ServerConfigurationManager.ApplicationPaths.ApplicationResourcesPath, "jellyfin-web", "src");
+ contentRoot = ServerConfigurationManager.ApplicationPaths.WebPath;
}
var host = new WebHostBuilder()
@@ -629,7 +632,7 @@ namespace Emby.Server.Implementations
{
options.ListenAnyIP(HttpPort);
- if (EnableHttps)
+ if (EnableHttps && Certificate != null)
{
options.ListenAnyIP(HttpsPort, listenOptions => { listenOptions.UseHttps(Certificate); });
}
@@ -651,7 +654,7 @@ namespace Emby.Server.Implementations
})
.Build();
- await host.StartAsync();
+ await host.StartAsync().ConfigureAwait(false);
}
private async Task ExecuteWebsocketHandlerAsync(HttpContext context, Func<Task> next)
@@ -700,14 +703,14 @@ namespace Emby.Server.Implementations
serviceCollection.AddSingleton<IApplicationPaths>(ApplicationPaths);
+ serviceCollection.AddSingleton<IConfiguration>(_configuration);
+
serviceCollection.AddSingleton(JsonSerializer);
serviceCollection.AddSingleton(LoggerFactory);
serviceCollection.AddLogging();
serviceCollection.AddSingleton(Logger);
- serviceCollection.AddSingleton(EnvironmentInfo);
-
serviceCollection.AddSingleton(FileSystemManager);
serviceCollection.AddSingleton<TvDbClientManager>();
@@ -730,13 +733,12 @@ namespace Emby.Server.Implementations
ApplicationHost.StreamHelper = new StreamHelper();
serviceCollection.AddSingleton(StreamHelper);
- serviceCollection.AddSingleton(CryptographyProvider);
+ serviceCollection.AddSingleton(typeof(ICryptoProvider), typeof(CryptographyProvider));
SocketFactory = new SocketFactory();
serviceCollection.AddSingleton(SocketFactory);
- InstallationManager = new InstallationManager(LoggerFactory, this, ApplicationPaths, HttpClient, JsonSerializer, ServerConfigurationManager, FileSystemManager, CryptographyProvider, ZipClient, PackageRuntime);
- serviceCollection.AddSingleton(InstallationManager);
+ serviceCollection.AddSingleton(typeof(IInstallationManager), typeof(InstallationManager));
ZipClient = new ZipClient();
serviceCollection.AddSingleton(ZipClient);
@@ -749,17 +751,12 @@ namespace Emby.Server.Implementations
serviceCollection.AddSingleton(ServerConfigurationManager);
- var assemblyInfo = new AssemblyInfo();
- serviceCollection.AddSingleton<IAssemblyInfo>(assemblyInfo);
-
- LocalizationManager = new LocalizationManager(ServerConfigurationManager, FileSystemManager, JsonSerializer, LoggerFactory);
- await LocalizationManager.LoadAll();
+ LocalizationManager = new LocalizationManager(ServerConfigurationManager, JsonSerializer, LoggerFactory);
+ await LocalizationManager.LoadAll().ConfigureAwait(false);
serviceCollection.AddSingleton<ILocalizationManager>(LocalizationManager);
serviceCollection.AddSingleton<IBlurayExaminer>(new BdInfoExaminer(FileSystemManager));
- serviceCollection.AddSingleton<IXmlReaderSettingsFactory>(new XmlReaderSettingsFactory());
-
UserDataManager = new UserDataManager(LoggerFactory, ServerConfigurationManager, () => UserManager);
serviceCollection.AddSingleton(UserDataManager);
@@ -770,7 +767,7 @@ namespace Emby.Server.Implementations
var displayPreferencesRepo = new SqliteDisplayPreferencesRepository(LoggerFactory, JsonSerializer, ApplicationPaths, FileSystemManager);
serviceCollection.AddSingleton<IDisplayPreferencesRepository>(displayPreferencesRepo);
- ItemRepository = new SqliteItemRepository(ServerConfigurationManager, this, JsonSerializer, LoggerFactory, assemblyInfo);
+ ItemRepository = new SqliteItemRepository(ServerConfigurationManager, this, JsonSerializer, LoggerFactory, LocalizationManager);
serviceCollection.AddSingleton<IItemRepository>(ItemRepository);
AuthenticationRepository = GetAuthenticationRepository();
@@ -786,7 +783,7 @@ namespace Emby.Server.Implementations
var musicManager = new MusicManager(LibraryManager);
serviceCollection.AddSingleton<IMusicManager>(new MusicManager(LibraryManager));
- LibraryMonitor = new LibraryMonitor(LoggerFactory, LibraryManager, ServerConfigurationManager, FileSystemManager, EnvironmentInfo);
+ LibraryMonitor = new LibraryMonitor(LoggerFactory, LibraryManager, ServerConfigurationManager, FileSystemManager);
serviceCollection.AddSingleton(LibraryMonitor);
serviceCollection.AddSingleton<ISearchEngine>(new SearchEngine(LoggerFactory, LibraryManager, UserManager));
@@ -794,16 +791,19 @@ namespace Emby.Server.Implementations
CertificateInfo = GetCertificateInfo(true);
Certificate = GetCertificate(CertificateInfo);
- HttpServer = new HttpListenerHost(this,
+ HttpServer = new HttpListenerHost(
+ this,
LoggerFactory,
ServerConfigurationManager,
_configuration,
NetworkManager,
JsonSerializer,
XmlSerializer,
- CreateHttpListener());
+ CreateHttpListener())
+ {
+ GlobalResponse = LocalizationManager.GetLocalizedString("StartupEmbyServerIsLoading")
+ };
- HttpServer.GlobalResponse = LocalizationManager.GetLocalizedString("StartupEmbyServerIsLoading");
serviceCollection.AddSingleton(HttpServer);
ImageProcessor = GetImageProcessor();
@@ -862,13 +862,13 @@ namespace Emby.Server.Implementations
LoggerFactory,
JsonSerializer,
StartupOptions.FFmpegPath,
- StartupOptions.FFprobePath,
ServerConfigurationManager,
FileSystemManager,
() => SubtitleEncoder,
() => MediaSourceManager,
ProcessFactory,
- 5000);
+ 5000,
+ LocalizationManager);
serviceCollection.AddSingleton(MediaEncoder);
EncodingManager = new MediaEncoder.EncodingManager(FileSystemManager, LoggerFactory, MediaEncoder, ChapterManager, LibraryManager);
@@ -905,9 +905,7 @@ namespace Emby.Server.Implementations
_serviceProvider = serviceCollection.BuildServiceProvider();
}
- public virtual string PackageRuntime => "netcore";
-
- public static void LogEnvironmentInfo(ILogger logger, IApplicationPaths appPaths, EnvironmentInfo.EnvironmentInfo environmentInfo)
+ public static void LogEnvironmentInfo(ILogger logger, IApplicationPaths appPaths)
{
// Distinct these to prevent users from reporting problems that aren't actually problems
var commandLineArgs = Environment
@@ -915,12 +913,14 @@ namespace Emby.Server.Implementations
.Distinct();
logger.LogInformation("Arguments: {Args}", commandLineArgs);
- logger.LogInformation("Operating system: {OS} {OSVersion}", environmentInfo.OperatingSystemName, environmentInfo.OperatingSystemVersion);
- logger.LogInformation("Architecture: {Architecture}", environmentInfo.SystemArchitecture);
+ // FIXME: @bond this logs the kernel version, not the OS version
+ logger.LogInformation("Operating system: {OS} {OSVersion}", OperatingSystem.Name, Environment.OSVersion.Version);
+ logger.LogInformation("Architecture: {Architecture}", RuntimeInformation.OSArchitecture);
logger.LogInformation("64-Bit Process: {Is64Bit}", Environment.Is64BitProcess);
logger.LogInformation("User Interactive: {IsUserInteractive}", Environment.UserInteractive);
logger.LogInformation("Processor count: {ProcessorCount}", Environment.ProcessorCount);
logger.LogInformation("Program data path: {ProgramDataPath}", appPaths.ProgramDataPath);
+ logger.LogInformation("Web resources path: {WebPath}", appPaths.WebPath);
logger.LogInformation("Application directory: {ApplicationPath}", appPaths.ProgramSystemPath);
}
@@ -957,7 +957,7 @@ namespace Emby.Server.Implementations
var password = string.IsNullOrWhiteSpace(info.Password) ? null : info.Password;
var localCert = new X509Certificate2(certificateLocation, password);
- //localCert.PrivateKey = PrivateKey.CreateFromFile(pvk_file).RSA;
+ // localCert.PrivateKey = PrivateKey.CreateFromFile(pvk_file).RSA;
if (!localCert.HasPrivateKey)
{
Logger.LogError("No private key included in SSL cert {CertificateLocation}.", certificateLocation);
@@ -1044,6 +1044,8 @@ namespace Emby.Server.Implementations
/// </summary>
protected void FindParts()
{
+ InstallationManager = _serviceProvider.GetService<IInstallationManager>();
+
if (!ServerConfigurationManager.Configuration.IsPortAuthorized)
{
ServerConfigurationManager.Configuration.IsPortAuthorized = true;
@@ -1058,13 +1060,15 @@ namespace Emby.Server.Implementations
HttpServer.Init(GetExports<IService>(false), GetExports<IWebSocketListener>(), GetUrlPrefixes());
- LibraryManager.AddParts(GetExports<IResolverIgnoreRule>(),
+ LibraryManager.AddParts(
+ GetExports<IResolverIgnoreRule>(),
GetExports<IItemResolver>(),
GetExports<IIntroProvider>(),
GetExports<IBaseItemComparer>(),
GetExports<ILibraryPostScanTask>());
- ProviderManager.AddParts(GetExports<IImageProvider>(),
+ ProviderManager.AddParts(
+ GetExports<IImageProvider>(),
GetExports<IMetadataService>(),
GetExports<IMetadataProvider>(),
GetExports<IMetadataSaver>(),
@@ -1145,6 +1149,7 @@ namespace Emby.Server.Implementations
}
private CertificateInfo CertificateInfo { get; set; }
+
protected X509Certificate2 Certificate { get; private set; }
private IEnumerable<string> GetUrlPrefixes()
@@ -1155,7 +1160,7 @@ namespace Emby.Server.Implementations
{
var prefixes = new List<string>
{
- "http://"+i+":" + HttpPort + "/"
+ "http://" + i + ":" + HttpPort + "/"
};
if (CertificateInfo != null)
@@ -1184,30 +1189,12 @@ namespace Emby.Server.Implementations
// Generate self-signed cert
var certHost = GetHostnameFromExternalDns(ServerConfigurationManager.Configuration.WanDdns);
var certPath = Path.Combine(ServerConfigurationManager.ApplicationPaths.ProgramDataPath, "ssl", "cert_" + (certHost + "2").GetMD5().ToString("N") + ".pfx");
- var password = "embycert";
-
- //if (generateCertificate)
- //{
- // if (!File.Exists(certPath))
- // {
- // FileSystemManager.CreateDirectory(FileSystemManager.GetDirectoryName(certPath));
-
- // try
- // {
- // CertificateGenerator.CreateSelfSignCertificatePfx(certPath, certHost, password, Logger);
- // }
- // catch (Exception ex)
- // {
- // Logger.LogError(ex, "Error creating ssl cert");
- // return null;
- // }
- // }
- //}
+ const string Password = "embycert";
return new CertificateInfo
{
Path = certPath,
- Password = password
+ Password = Password
};
}
@@ -1242,9 +1229,9 @@ namespace Emby.Server.Implementations
requiresRestart = true;
}
- var currentCertPath = CertificateInfo == null ? null : CertificateInfo.Path;
+ var currentCertPath = CertificateInfo?.Path;
var newCertInfo = GetCertificateInfo(false);
- var newCertPath = newCertInfo == null ? null : newCertInfo.Path;
+ var newCertPath = newCertInfo?.Path;
if (!string.Equals(currentCertPath, newCertPath, StringComparison.OrdinalIgnoreCase))
{
@@ -1377,6 +1364,7 @@ namespace Emby.Server.Implementations
/// <summary>
/// Gets the system status.
/// </summary>
+ /// <param name="cancellationToken">The cancellation token</param>
/// <returns>SystemInfo.</returns>
public async Task<SystemInfo> GetSystemInfo(CancellationToken cancellationToken)
{
@@ -1393,6 +1381,7 @@ namespace Emby.Server.Implementations
CompletedInstallations = InstallationManager.CompletedInstallations.ToArray(),
Id = SystemId,
ProgramDataPath = ApplicationPaths.ProgramDataPath,
+ WebPath = ApplicationPaths.WebPath,
LogPath = ApplicationPaths.LogDirectoryPath,
ItemsByNamePath = ApplicationPaths.InternalMetadataPath,
InternalMetadataPath = ApplicationPaths.InternalMetadataPath,
@@ -1400,8 +1389,8 @@ namespace Emby.Server.Implementations
HttpServerPortNumber = HttpPort,
SupportsHttps = SupportsHttps,
HttpsPortNumber = HttpsPort,
- OperatingSystem = EnvironmentInfo.OperatingSystem.ToString(),
- OperatingSystemDisplayName = EnvironmentInfo.OperatingSystemName,
+ OperatingSystem = OperatingSystem.Id.ToString(),
+ OperatingSystemDisplayName = OperatingSystem.Name,
CanSelfRestart = CanSelfRestart,
CanLaunchWebBrowser = CanLaunchWebBrowser,
WanAddress = wanAddress,
@@ -1411,7 +1400,7 @@ namespace Emby.Server.Implementations
LocalAddress = localAddress,
SupportsLibraryMonitor = true,
EncoderLocation = MediaEncoder.EncoderLocation,
- SystemArchitecture = EnvironmentInfo.SystemArchitecture,
+ SystemArchitecture = RuntimeInformation.OSArchitecture,
SystemUpdateLevel = SystemUpdateLevel,
PackageName = StartupOptions.PackageName
};
@@ -1435,7 +1424,7 @@ namespace Emby.Server.Implementations
{
Version = ApplicationVersion,
Id = SystemId,
- OperatingSystem = EnvironmentInfo.OperatingSystem.ToString(),
+ OperatingSystem = OperatingSystem.Id.ToString(),
WanAddress = wanAddress,
ServerName = FriendlyName,
LocalAddress = localAddress
@@ -1470,18 +1459,18 @@ namespace Emby.Server.Implementations
public async Task<string> GetWanApiUrl(CancellationToken cancellationToken)
{
- const string url = "http://ipv4.icanhazip.com";
+ const string Url = "http://ipv4.icanhazip.com";
try
{
using (var response = await HttpClient.Get(new HttpRequestOptions
{
- Url = url,
+ Url = Url,
LogErrorResponseBody = false,
LogErrors = false,
LogRequest = false,
BufferContent = false,
CancellationToken = cancellationToken
- }))
+ }).ConfigureAwait(false))
{
string res = await response.ReadToEndAsync().ConfigureAwait(false);
return GetLocalApiUrl(res.Trim());
@@ -1570,10 +1559,12 @@ namespace Emby.Server.Implementations
{
return result;
}
+
return null;
}
private readonly ConcurrentDictionary<string, bool> _validAddressResults = new ConcurrentDictionary<string, bool>(StringComparer.OrdinalIgnoreCase);
+
private async Task<bool> IsIpAddressValidAsync(IpAddressInfo address, CancellationToken cancellationToken)
{
if (address.Equals(IpAddressInfo.Loopback) ||
@@ -1590,25 +1581,26 @@ namespace Emby.Server.Implementations
return cachedResult;
}
- var logPing = false;
-
#if DEBUG
- logPing = true;
+ const bool LogPing = true;
+#else
+ const bool LogPing = false;
#endif
try
{
- using (var response = await HttpClient.SendAsync(new HttpRequestOptions
- {
- Url = apiUrl,
- LogErrorResponseBody = false,
- LogErrors = logPing,
- LogRequest = logPing,
- BufferContent = false,
+ using (var response = await HttpClient.SendAsync(
+ new HttpRequestOptions
+ {
+ Url = apiUrl,
+ LogErrorResponseBody = false,
+ LogErrors = logPing,
+ LogRequest = logPing,
+ BufferContent = false,
- CancellationToken = cancellationToken
+ CancellationToken = cancellationToken
- }, HttpMethod.Post).ConfigureAwait(false))
+ }, HttpMethod.Post).ConfigureAwait(false))
{
using (var reader = new StreamReader(response.Content))
{
@@ -1673,6 +1665,7 @@ namespace Emby.Server.Implementations
public event EventHandler HasUpdateAvailableChanged;
private bool _hasUpdateAvailable;
+
public bool HasUpdateAvailable
{
get => _hasUpdateAvailable;
@@ -1733,7 +1726,7 @@ namespace Emby.Server.Implementations
var process = ProcessFactory.Create(new ProcessOptions
{
FileName = url,
- //EnableRaisingEvents = true,
+ EnableRaisingEvents = true,
UseShellExecute = true,
ErrorDialog = false
});
@@ -1768,26 +1761,25 @@ namespace Emby.Server.Implementations
{
Logger.LogInformation("Application has been updated to version {0}", package.versionStr);
- ApplicationUpdated?.Invoke(this, new GenericEventArgs<PackageVersionInfo>
- {
- Argument = package
- });
+ ApplicationUpdated?.Invoke(
+ this,
+ new GenericEventArgs<PackageVersionInfo>()
+ {
+ Argument = package
+ });
NotifyPendingRestart();
}
- private bool _disposed;
+ private bool _disposed = false;
+
/// <summary>
/// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
/// </summary>
public void Dispose()
{
- if (!_disposed)
- {
- _disposed = true;
-
- Dispose(true);
- }
+ Dispose(true);
+ GC.SuppressFinalize(this);
}
/// <summary>
@@ -1796,14 +1788,19 @@ namespace Emby.Server.Implementations
/// <param name="dispose"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param>
protected virtual void Dispose(bool dispose)
{
+ if (_disposed)
+ {
+ return;
+ }
+
if (dispose)
{
var type = GetType();
Logger.LogInformation("Disposing {Type}", type.Name);
- var parts = DisposableParts.Distinct().Where(i => i.GetType() != type).ToList();
- DisposableParts.Clear();
+ var parts = _disposableParts.Distinct().Where(i => i.GetType() != type).ToList();
+ _disposableParts.Clear();
foreach (var part in parts)
{
@@ -1819,6 +1816,8 @@ namespace Emby.Server.Implementations
}
}
}
+
+ _disposed = true;
}
}
diff --git a/Emby.Server.Implementations/ConfigurationOptions.cs b/Emby.Server.Implementations/ConfigurationOptions.cs
index 30bfd8749..9bc60972a 100644
--- a/Emby.Server.Implementations/ConfigurationOptions.cs
+++ b/Emby.Server.Implementations/ConfigurationOptions.cs
@@ -6,7 +6,8 @@ namespace Emby.Server.Implementations
{
public static readonly Dictionary<string, string> Configuration = new Dictionary<string, string>
{
- {"HttpListenerHost:DefaultRedirectPath", "web/index.html"}
+ {"HttpListenerHost:DefaultRedirectPath", "web/index.html"},
+ {"MusicBrainz:BaseUrl", "https://www.musicbrainz.org"}
};
}
}
diff --git a/Emby.Server.Implementations/Cryptography/CryptographyProvider.cs b/Emby.Server.Implementations/Cryptography/CryptographyProvider.cs
index 982bba625..6d7193ce2 100644
--- a/Emby.Server.Implementations/Cryptography/CryptographyProvider.cs
+++ b/Emby.Server.Implementations/Cryptography/CryptographyProvider.cs
@@ -4,7 +4,6 @@ using System.Globalization;
using System.IO;
using System.Security.Cryptography;
using System.Text;
-using System.Linq;
using MediaBrowser.Model.Cryptography;
namespace Emby.Server.Implementations.Cryptography
@@ -136,7 +135,7 @@ namespace Emby.Server.Implementations.Cryptography
{
return PBKDF2(DefaultHashMethod, bytes, salt, _defaultIterations);
}
-
+
public byte[] ComputeHash(PasswordHash hash)
{
int iterations = _defaultIterations;
diff --git a/Emby.Server.Implementations/Data/SqliteDisplayPreferencesRepository.cs b/Emby.Server.Implementations/Data/SqliteDisplayPreferencesRepository.cs
index 3d60925da..47552806d 100644
--- a/Emby.Server.Implementations/Data/SqliteDisplayPreferencesRepository.cs
+++ b/Emby.Server.Implementations/Data/SqliteDisplayPreferencesRepository.cs
@@ -90,9 +90,10 @@ namespace Emby.Server.Implementations.Data
{
throw new ArgumentNullException(nameof(displayPreferences));
}
+
if (string.IsNullOrEmpty(displayPreferences.Id))
{
- throw new ArgumentNullException(nameof(displayPreferences.Id));
+ throw new ArgumentException("Display preferences has an invalid Id", nameof(displayPreferences));
}
cancellationToken.ThrowIfCancellationRequested();
diff --git a/Emby.Server.Implementations/Data/SqliteItemRepository.cs b/Emby.Server.Implementations/Data/SqliteItemRepository.cs
index 06f6563a3..088a6694b 100644
--- a/Emby.Server.Implementations/Data/SqliteItemRepository.cs
+++ b/Emby.Server.Implementations/Data/SqliteItemRepository.cs
@@ -22,9 +22,9 @@ using MediaBrowser.Controller.Persistence;
using MediaBrowser.Controller.Playlists;
using MediaBrowser.Model.Dto;
using MediaBrowser.Model.Entities;
+using MediaBrowser.Model.Globalization;
using MediaBrowser.Model.LiveTv;
using MediaBrowser.Model.Querying;
-using MediaBrowser.Model.Reflection;
using MediaBrowser.Model.Serialization;
using Microsoft.Extensions.Logging;
using SQLitePCL.pretty;
@@ -56,6 +56,8 @@ namespace Emby.Server.Implementations.Data
private readonly IServerConfigurationManager _config;
private IServerApplicationHost _appHost;
+ private readonly ILocalizationManager _localization;
+
public IImageProcessor ImageProcessor { get; set; }
/// <summary>
@@ -66,7 +68,7 @@ namespace Emby.Server.Implementations.Data
IServerApplicationHost appHost,
IJsonSerializer jsonSerializer,
ILoggerFactory loggerFactory,
- IAssemblyInfo assemblyInfo)
+ ILocalizationManager localization)
: base(loggerFactory.CreateLogger(nameof(SqliteItemRepository)))
{
if (config == null)
@@ -82,7 +84,8 @@ namespace Emby.Server.Implementations.Data
_appHost = appHost;
_config = config;
_jsonSerializer = jsonSerializer;
- _typeMapper = new TypeMapper(assemblyInfo);
+ _typeMapper = new TypeMapper();
+ _localization = localization;
DbFilePath = Path.Combine(_config.ApplicationPaths.DataPath, "library.db");
}
@@ -6189,6 +6192,12 @@ where AncestorIdText not null and ItemValues.Value not null and ItemValues.Type
item.ColorTransfer = reader[34].ToString();
}
+ if (item.Type == MediaStreamType.Subtitle){
+ item.localizedUndefined = _localization.GetLocalizedString("Undefined");
+ item.localizedDefault = _localization.GetLocalizedString("Default");
+ item.localizedForced = _localization.GetLocalizedString("Forced");
+ }
+
return item;
}
}
diff --git a/Emby.Server.Implementations/Data/TypeMapper.cs b/Emby.Server.Implementations/Data/TypeMapper.cs
index 37c952e88..0e67affbf 100644
--- a/Emby.Server.Implementations/Data/TypeMapper.cs
+++ b/Emby.Server.Implementations/Data/TypeMapper.cs
@@ -1,7 +1,6 @@
using System;
using System.Collections.Concurrent;
using System.Linq;
-using MediaBrowser.Model.Reflection;
namespace Emby.Server.Implementations.Data
{
@@ -10,16 +9,13 @@ namespace Emby.Server.Implementations.Data
/// </summary>
public class TypeMapper
{
- private readonly IAssemblyInfo _assemblyInfo;
-
/// <summary>
/// This holds all the types in the running assemblies so that we can de-serialize properly when we don't have strong types
/// </summary>
private readonly ConcurrentDictionary<string, Type> _typeMap = new ConcurrentDictionary<string, Type>();
- public TypeMapper(IAssemblyInfo assemblyInfo)
+ public TypeMapper()
{
- _assemblyInfo = assemblyInfo;
}
/// <summary>
@@ -45,8 +41,7 @@ namespace Emby.Server.Implementations.Data
/// <returns>Type.</returns>
private Type LookupType(string typeName)
{
- return _assemblyInfo
- .GetCurrentAssemblies()
+ return AppDomain.CurrentDomain.GetAssemblies()
.Select(a => a.GetType(typeName))
.FirstOrDefault(t => t != null);
}
diff --git a/Emby.Server.Implementations/Diagnostics/CommonProcess.cs b/Emby.Server.Implementations/Diagnostics/CommonProcess.cs
index 2c4ef170d..175a8f3ce 100644
--- a/Emby.Server.Implementations/Diagnostics/CommonProcess.cs
+++ b/Emby.Server.Implementations/Diagnostics/CommonProcess.cs
@@ -9,14 +9,14 @@ namespace Emby.Server.Implementations.Diagnostics
{
public class CommonProcess : IProcess
{
- public event EventHandler Exited;
-
- private readonly ProcessOptions _options;
private readonly Process _process;
+ private bool _disposed = false;
+ private bool _hasExited;
+
public CommonProcess(ProcessOptions options)
{
- _options = options;
+ StartInfo = options;
var startInfo = new ProcessStartInfo
{
@@ -27,10 +27,10 @@ namespace Emby.Server.Implementations.Diagnostics
CreateNoWindow = options.CreateNoWindow,
RedirectStandardError = options.RedirectStandardError,
RedirectStandardInput = options.RedirectStandardInput,
- RedirectStandardOutput = options.RedirectStandardOutput
+ RedirectStandardOutput = options.RedirectStandardOutput,
+ ErrorDialog = options.ErrorDialog
};
- startInfo.ErrorDialog = options.ErrorDialog;
if (options.IsHidden)
{
@@ -45,11 +45,22 @@ namespace Emby.Server.Implementations.Diagnostics
if (options.EnableRaisingEvents)
{
_process.EnableRaisingEvents = true;
- _process.Exited += _process_Exited;
+ _process.Exited += OnProcessExited;
}
}
- private bool _hasExited;
+ public event EventHandler Exited;
+
+ public ProcessOptions StartInfo { get; }
+
+ public StreamWriter StandardInput => _process.StandardInput;
+
+ public StreamReader StandardError => _process.StandardError;
+
+ public StreamReader StandardOutput => _process.StandardOutput;
+
+ public int ExitCode => _process.ExitCode;
+
private bool HasExited
{
get
@@ -72,25 +83,6 @@ namespace Emby.Server.Implementations.Diagnostics
}
}
- private void _process_Exited(object sender, EventArgs e)
- {
- _hasExited = true;
- if (Exited != null)
- {
- Exited(this, e);
- }
- }
-
- public ProcessOptions StartInfo => _options;
-
- public StreamWriter StandardInput => _process.StandardInput;
-
- public StreamReader StandardError => _process.StandardError;
-
- public StreamReader StandardOutput => _process.StandardOutput;
-
- public int ExitCode => _process.ExitCode;
-
public void Start()
{
_process.Start();
@@ -108,7 +100,7 @@ namespace Emby.Server.Implementations.Diagnostics
public Task<bool> WaitForExitAsync(int timeMs)
{
- //Note: For this function to work correctly, the option EnableRisingEvents needs to be set to true.
+ // Note: For this function to work correctly, the option EnableRisingEvents needs to be set to true.
if (HasExited)
{
@@ -130,7 +122,29 @@ namespace Emby.Server.Implementations.Diagnostics
public void Dispose()
{
- _process?.Dispose();
+ Dispose(true);
+ GC.SuppressFinalize(this);
+ }
+
+ protected virtual void Dispose(bool disposing)
+ {
+ if (_disposed)
+ {
+ return;
+ }
+
+ if (disposing)
+ {
+ _process?.Dispose();
+ }
+
+ _disposed = true;
+ }
+
+ private void OnProcessExited(object sender, EventArgs e)
+ {
+ _hasExited = true;
+ Exited?.Invoke(this, e);
}
}
}
diff --git a/Emby.Server.Implementations/Emby.Server.Implementations.csproj b/Emby.Server.Implementations/Emby.Server.Implementations.csproj
index 39e9ed375..2c7962452 100644
--- a/Emby.Server.Implementations/Emby.Server.Implementations.csproj
+++ b/Emby.Server.Implementations/Emby.Server.Implementations.csproj
@@ -13,7 +13,6 @@
<ProjectReference Include="..\Mono.Nat\Mono.Nat.csproj" />
<ProjectReference Include="..\MediaBrowser.Api\MediaBrowser.Api.csproj" />
<ProjectReference Include="..\MediaBrowser.LocalMetadata\MediaBrowser.LocalMetadata.csproj" />
- <ProjectReference Include="..\OpenSubtitlesHandler\OpenSubtitlesHandler.csproj" />
<ProjectReference Include="..\Emby.Photos\Emby.Photos.csproj" />
<ProjectReference Include="..\Emby.Drawing\Emby.Drawing.csproj" />
<ProjectReference Include="..\Emby.XmlTv\Emby.XmlTv\Emby.XmlTv.csproj" />
@@ -47,6 +46,21 @@
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
</PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
+ <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
+ </PropertyGroup>
+
+ <!-- Code analysers-->
+ <ItemGroup Condition=" '$(Configuration)' == 'Debug' ">
+ <PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.6.3" />
+ <PackageReference Include="StyleCop.Analyzers" Version="1.0.2" />
+ <PackageReference Include="SerilogAnalyzer" Version="0.15.0" />
+ </ItemGroup>
+
+ <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
+ <CodeAnalysisRuleSet>../jellyfin.ruleset</CodeAnalysisRuleSet>
+ </PropertyGroup>
+
<ItemGroup>
<EmbeddedResource Include="Localization\iso6392.txt" />
<EmbeddedResource Include="Localization\countries.json" />
diff --git a/Emby.Server.Implementations/EntryPoints/LibraryChangedNotifier.cs b/Emby.Server.Implementations/EntryPoints/LibraryChangedNotifier.cs
index 038965647..8369f4f59 100644
--- a/Emby.Server.Implementations/EntryPoints/LibraryChangedNotifier.cs
+++ b/Emby.Server.Implementations/EntryPoints/LibraryChangedNotifier.cs
@@ -388,7 +388,7 @@ namespace Emby.Server.Implementations.EntryPoints
FoldersRemovedFrom = foldersRemovedFrom.SelectMany(i => TranslatePhysicalItemToUserLibrary(i, user)).Select(i => i.Id.ToString("N")).Distinct().ToArray(),
- CollectionFolders = GetTopParentIds(newAndRemoved, user, allUserRootChildren).ToArray()
+ CollectionFolders = GetTopParentIds(newAndRemoved, allUserRootChildren).ToArray()
};
}
@@ -407,7 +407,7 @@ namespace Emby.Server.Implementations.EntryPoints
return item.SourceType == SourceType.Library;
}
- private IEnumerable<string> GetTopParentIds(List<BaseItem> items, User user, List<Folder> allUserRootChildren)
+ private IEnumerable<string> GetTopParentIds(List<BaseItem> items, List<Folder> allUserRootChildren)
{
var list = new List<string>();
diff --git a/Emby.Server.Implementations/EnvironmentInfo/EnvironmentInfo.cs b/Emby.Server.Implementations/EnvironmentInfo/EnvironmentInfo.cs
deleted file mode 100644
index c8104150d..000000000
--- a/Emby.Server.Implementations/EnvironmentInfo/EnvironmentInfo.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-using System;
-using System.Runtime.InteropServices;
-using MediaBrowser.Model.System;
-
-namespace Emby.Server.Implementations.EnvironmentInfo
-{
- public class EnvironmentInfo : IEnvironmentInfo
- {
- public EnvironmentInfo(MediaBrowser.Model.System.OperatingSystem operatingSystem)
- {
- OperatingSystem = operatingSystem;
- }
-
- public MediaBrowser.Model.System.OperatingSystem OperatingSystem { get; private set; }
-
- public string OperatingSystemName
- {
- get
- {
- switch (OperatingSystem)
- {
- case MediaBrowser.Model.System.OperatingSystem.Android: return "Android";
- case MediaBrowser.Model.System.OperatingSystem.BSD: return "BSD";
- case MediaBrowser.Model.System.OperatingSystem.Linux: return "Linux";
- case MediaBrowser.Model.System.OperatingSystem.OSX: return "macOS";
- case MediaBrowser.Model.System.OperatingSystem.Windows: return "Windows";
- default: throw new Exception($"Unknown OS {OperatingSystem}");
- }
- }
- }
-
- public string OperatingSystemVersion => Environment.OSVersion.Version.ToString() + " " + Environment.OSVersion.ServicePack.ToString();
-
- public Architecture SystemArchitecture => RuntimeInformation.OSArchitecture;
- }
-}
diff --git a/Emby.Server.Implementations/HttpServer/HttpResultFactory.cs b/Emby.Server.Implementations/HttpServer/HttpResultFactory.cs
index 463265862..134f3c841 100644
--- a/Emby.Server.Implementations/HttpServer/HttpResultFactory.cs
+++ b/Emby.Server.Implementations/HttpServer/HttpResultFactory.cs
@@ -100,7 +100,7 @@ namespace Emby.Server.Implementations.HttpServer
if (addCachePrevention && !responseHeaders.TryGetValue(HeaderNames.Expires, out string expires))
{
- responseHeaders[HeaderNames.Expires] = "-1";
+ responseHeaders[HeaderNames.Expires] = "0";
}
AddResponseHeaders(result, responseHeaders);
@@ -146,7 +146,7 @@ namespace Emby.Server.Implementations.HttpServer
if (addCachePrevention && !responseHeaders.TryGetValue(HeaderNames.Expires, out string _))
{
- responseHeaders[HeaderNames.Expires] = "-1";
+ responseHeaders[HeaderNames.Expires] = "0";
}
AddResponseHeaders(result, responseHeaders);
@@ -190,7 +190,7 @@ namespace Emby.Server.Implementations.HttpServer
if (addCachePrevention && !responseHeaders.TryGetValue(HeaderNames.Expires, out string _))
{
- responseHeaders[HeaderNames.Expires] = "-1";
+ responseHeaders[HeaderNames.Expires] = "0";
}
AddResponseHeaders(result, responseHeaders);
@@ -215,7 +215,7 @@ namespace Emby.Server.Implementations.HttpServer
responseHeaders = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
}
- responseHeaders[HeaderNames.Expires] = "-1";
+ responseHeaders[HeaderNames.Expires] = "0";
return ToOptimizedResultInternal(requestContext, result, responseHeaders);
}
diff --git a/Emby.Server.Implementations/HttpServer/Security/AuthService.cs b/Emby.Server.Implementations/HttpServer/Security/AuthService.cs
index 499a334fc..1027883ed 100644
--- a/Emby.Server.Implementations/HttpServer/Security/AuthService.cs
+++ b/Emby.Server.Implementations/HttpServer/Security/AuthService.cs
@@ -45,7 +45,7 @@ namespace Emby.Server.Implementations.HttpServer.Security
// This code is executed before the service
var auth = AuthorizationContext.GetAuthorizationInfo(request);
- if (!IsExemptFromAuthenticationToken(auth, authAttribtues, request))
+ if (!IsExemptFromAuthenticationToken(authAttribtues, request))
{
ValidateSecurityToken(request, auth.Token);
}
@@ -122,7 +122,7 @@ namespace Emby.Server.Implementations.HttpServer.Security
}
}
- private bool IsExemptFromAuthenticationToken(AuthorizationInfo auth, IAuthenticationAttributes authAttribtues, IRequest request)
+ private bool IsExemptFromAuthenticationToken(IAuthenticationAttributes authAttribtues, IRequest request)
{
if (!_config.Configuration.IsStartupWizardCompleted && authAttribtues.AllowBeforeStartupWizard)
{
diff --git a/Emby.Server.Implementations/HttpServer/StreamWriter.cs b/Emby.Server.Implementations/HttpServer/StreamWriter.cs
index 66a13e20d..324f9085e 100644
--- a/Emby.Server.Implementations/HttpServer/StreamWriter.cs
+++ b/Emby.Server.Implementations/HttpServer/StreamWriter.cs
@@ -1,11 +1,9 @@
using System;
using System.Collections.Generic;
-using System.Globalization;
using System.IO;
using System.Threading;
using System.Threading.Tasks;
using MediaBrowser.Model.Services;
-using Microsoft.Extensions.Logging;
using Microsoft.Net.Http.Headers;
namespace Emby.Server.Implementations.HttpServer
@@ -15,8 +13,6 @@ namespace Emby.Server.Implementations.HttpServer
/// </summary>
public class StreamWriter : IAsyncStreamWriter, IHasHeaders
{
- private static readonly CultureInfo UsCulture = new CultureInfo("en-US");
-
/// <summary>
/// Gets or sets the source stream.
/// </summary>
diff --git a/Emby.Server.Implementations/IO/LibraryMonitor.cs b/Emby.Server.Implementations/IO/LibraryMonitor.cs
index d47342511..df4dc41b9 100644
--- a/Emby.Server.Implementations/IO/LibraryMonitor.cs
+++ b/Emby.Server.Implementations/IO/LibraryMonitor.cs
@@ -10,8 +10,8 @@ using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.Plugins;
using MediaBrowser.Model.IO;
using MediaBrowser.Model.System;
-using MediaBrowser.Model.Tasks;
using Microsoft.Extensions.Logging;
+using OperatingSystem = MediaBrowser.Common.System.OperatingSystem;
namespace Emby.Server.Implementations.IO
{
@@ -127,7 +127,6 @@ namespace Emby.Server.Implementations.IO
private IServerConfigurationManager ConfigurationManager { get; set; }
private readonly IFileSystem _fileSystem;
- private readonly IEnvironmentInfo _environmentInfo;
/// <summary>
/// Initializes a new instance of the <see cref="LibraryMonitor" /> class.
@@ -136,14 +135,12 @@ namespace Emby.Server.Implementations.IO
ILoggerFactory loggerFactory,
ILibraryManager libraryManager,
IServerConfigurationManager configurationManager,
- IFileSystem fileSystem,
- IEnvironmentInfo environmentInfo)
+ IFileSystem fileSystem)
{
LibraryManager = libraryManager;
Logger = loggerFactory.CreateLogger(GetType().Name);
ConfigurationManager = configurationManager;
_fileSystem = fileSystem;
- _environmentInfo = environmentInfo;
}
private bool IsLibraryMonitorEnabled(BaseItem item)
@@ -267,7 +264,7 @@ namespace Emby.Server.Implementations.IO
return;
}
- if (_environmentInfo.OperatingSystem != MediaBrowser.Model.System.OperatingSystem.Windows)
+ if (OperatingSystem.Id != OperatingSystemId.Windows)
{
if (path.StartsWith("\\\\", StringComparison.OrdinalIgnoreCase) || path.StartsWith("smb://", StringComparison.OrdinalIgnoreCase))
{
@@ -276,12 +273,6 @@ namespace Emby.Server.Implementations.IO
}
}
- if (_environmentInfo.OperatingSystem == MediaBrowser.Model.System.OperatingSystem.Android)
- {
- // causing crashing
- return;
- }
-
// Already being watched
if (_fileSystemWatchers.ContainsKey(path))
{
diff --git a/Emby.Server.Implementations/IO/ManagedFileSystem.cs b/Emby.Server.Implementations/IO/ManagedFileSystem.cs
index 421592fad..47cea7269 100644
--- a/Emby.Server.Implementations/IO/ManagedFileSystem.cs
+++ b/Emby.Server.Implementations/IO/ManagedFileSystem.cs
@@ -8,6 +8,7 @@ using MediaBrowser.Common.Configuration;
using MediaBrowser.Model.IO;
using MediaBrowser.Model.System;
using Microsoft.Extensions.Logging;
+using OperatingSystem = MediaBrowser.Common.System.OperatingSystem;
namespace Emby.Server.Implementations.IO
{
@@ -24,22 +25,19 @@ namespace Emby.Server.Implementations.IO
private readonly string _tempPath;
- private readonly IEnvironmentInfo _environmentInfo;
private readonly bool _isEnvironmentCaseInsensitive;
public ManagedFileSystem(
ILoggerFactory loggerFactory,
- IEnvironmentInfo environmentInfo,
IApplicationPaths applicationPaths)
{
Logger = loggerFactory.CreateLogger("FileSystem");
_supportsAsyncFileStreams = true;
_tempPath = applicationPaths.TempDirectory;
- _environmentInfo = environmentInfo;
- SetInvalidFileNameChars(environmentInfo.OperatingSystem == MediaBrowser.Model.System.OperatingSystem.Windows);
+ SetInvalidFileNameChars(OperatingSystem.Id == OperatingSystemId.Windows);
- _isEnvironmentCaseInsensitive = environmentInfo.OperatingSystem == MediaBrowser.Model.System.OperatingSystem.Windows;
+ _isEnvironmentCaseInsensitive = OperatingSystem.Id == OperatingSystemId.Windows;
}
public virtual void AddShortcutHandler(IShortcutHandler handler)
@@ -468,7 +466,7 @@ namespace Emby.Server.Implementations.IO
public virtual void SetHidden(string path, bool isHidden)
{
- if (_environmentInfo.OperatingSystem != MediaBrowser.Model.System.OperatingSystem.Windows)
+ if (OperatingSystem.Id != MediaBrowser.Model.System.OperatingSystemId.Windows)
{
return;
}
@@ -492,7 +490,7 @@ namespace Emby.Server.Implementations.IO
public virtual void SetReadOnly(string path, bool isReadOnly)
{
- if (_environmentInfo.OperatingSystem != MediaBrowser.Model.System.OperatingSystem.Windows)
+ if (OperatingSystem.Id != MediaBrowser.Model.System.OperatingSystemId.Windows)
{
return;
}
@@ -516,7 +514,7 @@ namespace Emby.Server.Implementations.IO
public virtual void SetAttributes(string path, bool isHidden, bool isReadOnly)
{
- if (_environmentInfo.OperatingSystem != MediaBrowser.Model.System.OperatingSystem.Windows)
+ if (OperatingSystem.Id != MediaBrowser.Model.System.OperatingSystemId.Windows)
{
return;
}
@@ -801,7 +799,7 @@ namespace Emby.Server.Implementations.IO
public virtual void SetExecutable(string path)
{
- if (_environmentInfo.OperatingSystem == MediaBrowser.Model.System.OperatingSystem.OSX)
+ if (OperatingSystem.Id == MediaBrowser.Model.System.OperatingSystemId.Darwin)
{
RunProcess("chmod", "+x \"" + path + "\"", Path.GetDirectoryName(path));
}
diff --git a/Emby.Server.Implementations/IO/StreamHelper.cs b/Emby.Server.Implementations/IO/StreamHelper.cs
index 09cf4d4a3..d02cd84a0 100644
--- a/Emby.Server.Implementations/IO/StreamHelper.cs
+++ b/Emby.Server.Implementations/IO/StreamHelper.cs
@@ -1,4 +1,5 @@
using System;
+using System.Buffers;
using System.IO;
using System.Threading;
using System.Threading.Tasks;
@@ -8,168 +9,213 @@ namespace Emby.Server.Implementations.IO
{
public class StreamHelper : IStreamHelper
{
+ private const int StreamCopyToBufferSize = 81920;
+
public async Task CopyToAsync(Stream source, Stream destination, int bufferSize, Action onStarted, CancellationToken cancellationToken)
{
- byte[] buffer = new byte[bufferSize];
- int read;
- while ((read = source.Read(buffer, 0, buffer.Length)) != 0)
+ byte[] buffer = ArrayPool<byte>.Shared.Rent(bufferSize);
+ try
{
- cancellationToken.ThrowIfCancellationRequested();
+ int read;
+ while ((read = await source.ReadAsync(buffer, 0, buffer.Length).ConfigureAwait(false)) != 0)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
- await destination.WriteAsync(buffer, 0, read).ConfigureAwait(false);
+ await destination.WriteAsync(buffer, 0, read).ConfigureAwait(false);
- if (onStarted != null)
- {
- onStarted();
- onStarted = null;
+ if (onStarted != null)
+ {
+ onStarted();
+ onStarted = null;
+ }
}
}
+ finally
+ {
+ ArrayPool<byte>.Shared.Return(buffer);
+ }
}
public async Task CopyToAsync(Stream source, Stream destination, int bufferSize, int emptyReadLimit, CancellationToken cancellationToken)
{
- byte[] buffer = new byte[bufferSize];
-
- if (emptyReadLimit <= 0)
+ byte[] buffer = ArrayPool<byte>.Shared.Rent(bufferSize);
+ try
{
- int read;
- while ((read = source.Read(buffer, 0, buffer.Length)) != 0)
+ if (emptyReadLimit <= 0)
{
- cancellationToken.ThrowIfCancellationRequested();
+ int read;
+ while ((read = await source.ReadAsync(buffer, 0, buffer.Length).ConfigureAwait(false)) != 0)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
- await destination.WriteAsync(buffer, 0, read).ConfigureAwait(false);
- }
+ await destination.WriteAsync(buffer, 0, read).ConfigureAwait(false);
+ }
- return;
- }
+ return;
+ }
- var eofCount = 0;
+ var eofCount = 0;
- while (eofCount < emptyReadLimit)
- {
- cancellationToken.ThrowIfCancellationRequested();
+ while (eofCount < emptyReadLimit)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
- var bytesRead = source.Read(buffer, 0, buffer.Length);
+ var bytesRead = await source.ReadAsync(buffer, 0, buffer.Length).ConfigureAwait(false);
- if (bytesRead == 0)
- {
- eofCount++;
- await Task.Delay(50, cancellationToken).ConfigureAwait(false);
- }
- else
- {
- eofCount = 0;
+ if (bytesRead == 0)
+ {
+ eofCount++;
+ await Task.Delay(50, cancellationToken).ConfigureAwait(false);
+ }
+ else
+ {
+ eofCount = 0;
- await destination.WriteAsync(buffer, 0, bytesRead).ConfigureAwait(false);
+ await destination.WriteAsync(buffer, 0, bytesRead).ConfigureAwait(false);
+ }
}
}
+ finally
+ {
+ ArrayPool<byte>.Shared.Return(buffer);
+ }
}
- const int StreamCopyToBufferSize = 81920;
public async Task<int> CopyToAsync(Stream source, Stream destination, CancellationToken cancellationToken)
{
- var array = new byte[StreamCopyToBufferSize];
- int bytesRead;
- int totalBytesRead = 0;
-
- while ((bytesRead = await source.ReadAsync(array, 0, array.Length, cancellationToken).ConfigureAwait(false)) != 0)
+ byte[] buffer = ArrayPool<byte>.Shared.Rent(StreamCopyToBufferSize);
+ try
{
- var bytesToWrite = bytesRead;
+ int totalBytesRead = 0;
- if (bytesToWrite > 0)
+ int bytesRead;
+ while ((bytesRead = await source.ReadAsync(buffer, 0, buffer.Length, cancellationToken).ConfigureAwait(false)) != 0)
{
- await destination.WriteAsync(array, 0, Convert.ToInt32(bytesToWrite), cancellationToken).ConfigureAwait(false);
+ var bytesToWrite = bytesRead;
- totalBytesRead += bytesRead;
+ if (bytesToWrite > 0)
+ {
+ await destination.WriteAsync(buffer, 0, Convert.ToInt32(bytesToWrite), cancellationToken).ConfigureAwait(false);
+
+ totalBytesRead += bytesRead;
+ }
}
- }
- return totalBytesRead;
+ return totalBytesRead;
+ }
+ finally
+ {
+ ArrayPool<byte>.Shared.Return(buffer);
+ }
}
public async Task<int> CopyToAsyncWithSyncRead(Stream source, Stream destination, CancellationToken cancellationToken)
{
- var array = new byte[StreamCopyToBufferSize];
- int bytesRead;
- int totalBytesRead = 0;
-
- while ((bytesRead = source.Read(array, 0, array.Length)) != 0)
+ byte[] buffer = ArrayPool<byte>.Shared.Rent(StreamCopyToBufferSize);
+ try
{
- var bytesToWrite = bytesRead;
+ int bytesRead;
+ int totalBytesRead = 0;
- if (bytesToWrite > 0)
+ while ((bytesRead = source.Read(buffer, 0, buffer.Length)) != 0)
{
- await destination.WriteAsync(array, 0, Convert.ToInt32(bytesToWrite), cancellationToken).ConfigureAwait(false);
+ var bytesToWrite = bytesRead;
- totalBytesRead += bytesRead;
+ if (bytesToWrite > 0)
+ {
+ await destination.WriteAsync(buffer, 0, Convert.ToInt32(bytesToWrite), cancellationToken).ConfigureAwait(false);
+
+ totalBytesRead += bytesRead;
+ }
}
- }
- return totalBytesRead;
+ return totalBytesRead;
+ }
+ finally
+ {
+ ArrayPool<byte>.Shared.Return(buffer);
+ }
}
public async Task CopyToAsyncWithSyncRead(Stream source, Stream destination, long copyLength, CancellationToken cancellationToken)
{
- var array = new byte[StreamCopyToBufferSize];
- int bytesRead;
-
- while ((bytesRead = source.Read(array, 0, array.Length)) != 0)
+ byte[] buffer = ArrayPool<byte>.Shared.Rent(StreamCopyToBufferSize);
+ try
{
- var bytesToWrite = Math.Min(bytesRead, copyLength);
+ int bytesRead;
- if (bytesToWrite > 0)
+ while ((bytesRead = source.Read(buffer, 0, buffer.Length)) != 0)
{
- await destination.WriteAsync(array, 0, Convert.ToInt32(bytesToWrite), cancellationToken).ConfigureAwait(false);
- }
+ var bytesToWrite = Math.Min(bytesRead, copyLength);
- copyLength -= bytesToWrite;
+ if (bytesToWrite > 0)
+ {
+ await destination.WriteAsync(buffer, 0, Convert.ToInt32(bytesToWrite), cancellationToken).ConfigureAwait(false);
+ }
- if (copyLength <= 0)
- {
- break;
+ copyLength -= bytesToWrite;
+
+ if (copyLength <= 0)
+ {
+ break;
+ }
}
}
+ finally
+ {
+ ArrayPool<byte>.Shared.Return(buffer);
+ }
}
public async Task CopyToAsync(Stream source, Stream destination, long copyLength, CancellationToken cancellationToken)
{
- var array = new byte[StreamCopyToBufferSize];
- int bytesRead;
-
- while ((bytesRead = await source.ReadAsync(array, 0, array.Length, cancellationToken).ConfigureAwait(false)) != 0)
+ byte[] buffer = ArrayPool<byte>.Shared.Rent(StreamCopyToBufferSize);
+ try
{
- var bytesToWrite = Math.Min(bytesRead, copyLength);
+ int bytesRead;
- if (bytesToWrite > 0)
+ while ((bytesRead = await source.ReadAsync(buffer, 0, buffer.Length, cancellationToken).ConfigureAwait(false)) != 0)
{
- await destination.WriteAsync(array, 0, Convert.ToInt32(bytesToWrite), cancellationToken).ConfigureAwait(false);
- }
+ var bytesToWrite = Math.Min(bytesRead, copyLength);
- copyLength -= bytesToWrite;
+ if (bytesToWrite > 0)
+ {
+ await destination.WriteAsync(buffer, 0, Convert.ToInt32(bytesToWrite), cancellationToken).ConfigureAwait(false);
+ }
- if (copyLength <= 0)
- {
- break;
+ copyLength -= bytesToWrite;
+
+ if (copyLength <= 0)
+ {
+ break;
+ }
}
}
+ finally
+ {
+ ArrayPool<byte>.Shared.Return(buffer);
+ }
}
public async Task CopyUntilCancelled(Stream source, Stream target, int bufferSize, CancellationToken cancellationToken)
{
- byte[] buffer = new byte[bufferSize];
-
- while (!cancellationToken.IsCancellationRequested)
+ byte[] buffer = ArrayPool<byte>.Shared.Rent(bufferSize);
+ try
{
- var bytesRead = await CopyToAsyncInternal(source, target, buffer, cancellationToken).ConfigureAwait(false);
-
- //var position = fs.Position;
- //_logger.LogDebug("Streamed {0} bytes to position {1} from file {2}", bytesRead, position, path);
-
- if (bytesRead == 0)
+ while (!cancellationToken.IsCancellationRequested)
{
- await Task.Delay(100).ConfigureAwait(false);
+ var bytesRead = await CopyToAsyncInternal(source, target, buffer, cancellationToken).ConfigureAwait(false);
+
+ if (bytesRead == 0)
+ {
+ await Task.Delay(100).ConfigureAwait(false);
+ }
}
}
+ finally
+ {
+ ArrayPool<byte>.Shared.Return(buffer);
+ }
}
private static async Task<int> CopyToAsyncInternal(Stream source, Stream destination, byte[] buffer, CancellationToken cancellationToken)
diff --git a/Emby.Server.Implementations/IStartupOptions.cs b/Emby.Server.Implementations/IStartupOptions.cs
index 24aaa76c0..6e915de3d 100644
--- a/Emby.Server.Implementations/IStartupOptions.cs
+++ b/Emby.Server.Implementations/IStartupOptions.cs
@@ -8,11 +8,6 @@ namespace Emby.Server.Implementations
string FFmpegPath { get; }
/// <summary>
- /// --ffprobe
- /// </summary>
- string FFprobePath { get; }
-
- /// <summary>
/// --service
/// </summary>
bool IsService { get; }
diff --git a/Emby.Server.Implementations/Library/DefaultAuthenticationProvider.cs b/Emby.Server.Implementations/Library/DefaultAuthenticationProvider.cs
index 3ec1f81d3..3d15a8afb 100644
--- a/Emby.Server.Implementations/Library/DefaultAuthenticationProvider.cs
+++ b/Emby.Server.Implementations/Library/DefaultAuthenticationProvider.cs
@@ -52,7 +52,7 @@ namespace Emby.Server.Implementations.Library
PasswordHash readyHash = new PasswordHash(resolvedUser.Password);
byte[] calculatedHash;
string calculatedHashString;
- if (_cryptographyProvider.GetSupportedHashMethods().Contains(readyHash.Id))
+ if (_cryptographyProvider.GetSupportedHashMethods().Contains(readyHash.Id) || _cryptographyProvider.DefaultHashMethod == readyHash.Id)
{
if (string.IsNullOrEmpty(readyHash.Salt))
{
diff --git a/Emby.Server.Implementations/Library/LibraryManager.cs b/Emby.Server.Implementations/Library/LibraryManager.cs
index 6591d54c5..1673e3777 100644
--- a/Emby.Server.Implementations/Library/LibraryManager.cs
+++ b/Emby.Server.Implementations/Library/LibraryManager.cs
@@ -58,22 +58,23 @@ namespace Emby.Server.Implementations.Library
private ILibraryPostScanTask[] PostscanTasks { get; set; }
/// <summary>
- /// Gets the intro providers.
+ /// Gets or sets the intro providers.
/// </summary>
/// <value>The intro providers.</value>
private IIntroProvider[] IntroProviders { get; set; }
/// <summary>
- /// Gets the list of entity resolution ignore rules
+ /// Gets or sets the list of entity resolution ignore rules
/// </summary>
/// <value>The entity resolution ignore rules.</value>
private IResolverIgnoreRule[] EntityResolutionIgnoreRules { get; set; }
/// <summary>
- /// Gets the list of currently registered entity resolvers
+ /// Gets or sets the list of currently registered entity resolvers
/// </summary>
/// <value>The entity resolvers enumerable.</value>
private IItemResolver[] EntityResolvers { get; set; }
+
private IMultiItemResolver[] MultiItemResolvers { get; set; }
/// <summary>
@@ -83,7 +84,7 @@ namespace Emby.Server.Implementations.Library
private IBaseItemComparer[] Comparers { get; set; }
/// <summary>
- /// Gets the active item repository
+ /// Gets or sets the active item repository
/// </summary>
/// <value>The item repository.</value>
public IItemRepository ItemRepository { get; set; }
@@ -133,12 +134,14 @@ namespace Emby.Server.Implementations.Library
private readonly Func<IProviderManager> _providerManagerFactory;
private readonly Func<IUserViewManager> _userviewManager;
public bool IsScanRunning { get; private set; }
+
private IServerApplicationHost _appHost;
/// <summary>
/// The _library items cache
/// </summary>
private readonly ConcurrentDictionary<Guid, BaseItem> _libraryItemsCache;
+
/// <summary>
/// Gets the library items cache.
/// </summary>
@@ -150,7 +153,8 @@ namespace Emby.Server.Implementations.Library
/// <summary>
/// Initializes a new instance of the <see cref="LibraryManager" /> class.
/// </summary>
- /// <param name="logger">The logger.</param>
+ /// <param name="appHost">The application host</param>
+ /// <param name="loggerFactory">The logger factory.</param>
/// <param name="taskManager">The task manager.</param>
/// <param name="userManager">The user manager.</param>
/// <param name="configurationManager">The configuration manager.</param>
@@ -167,6 +171,7 @@ namespace Emby.Server.Implementations.Library
Func<IProviderManager> providerManagerFactory,
Func<IUserViewManager> userviewManager)
{
+ _appHost = appHost;
_logger = loggerFactory.CreateLogger(nameof(LibraryManager));
_taskManager = taskManager;
_userManager = userManager;
@@ -176,7 +181,7 @@ namespace Emby.Server.Implementations.Library
_fileSystem = fileSystem;
_providerManagerFactory = providerManagerFactory;
_userviewManager = userviewManager;
- _appHost = appHost;
+
_libraryItemsCache = new ConcurrentDictionary<Guid, BaseItem>();
ConfigurationManager.ConfigurationUpdated += ConfigurationUpdated;
@@ -191,8 +196,9 @@ namespace Emby.Server.Implementations.Library
/// <param name="resolvers">The resolvers.</param>
/// <param name="introProviders">The intro providers.</param>
/// <param name="itemComparers">The item comparers.</param>
- /// <param name="postscanTasks">The postscan tasks.</param>
- public void AddParts(IEnumerable<IResolverIgnoreRule> rules,
+ /// <param name="postscanTasks">The post scan tasks.</param>
+ public void AddParts(
+ IEnumerable<IResolverIgnoreRule> rules,
IEnumerable<IItemResolver> resolvers,
IEnumerable<IIntroProvider> introProviders,
IEnumerable<IBaseItemComparer> itemComparers,
@@ -203,24 +209,19 @@ namespace Emby.Server.Implementations.Library
MultiItemResolvers = EntityResolvers.OfType<IMultiItemResolver>().ToArray();
IntroProviders = introProviders.ToArray();
Comparers = itemComparers.ToArray();
-
- PostscanTasks = postscanTasks.OrderBy(i =>
- {
- var hasOrder = i as IHasOrder;
-
- return hasOrder == null ? 0 : hasOrder.Order;
-
- }).ToArray();
+ PostscanTasks = postscanTasks.ToArray();
}
/// <summary>
/// The _root folder
/// </summary>
private volatile AggregateFolder _rootFolder;
+
/// <summary>
/// The _root folder sync lock
/// </summary>
private readonly object _rootFolderSyncLock = new object();
+
/// <summary>
/// Gets the root folder.
/// </summary>
@@ -239,11 +240,13 @@ namespace Emby.Server.Implementations.Library
}
}
}
+
return _rootFolder;
}
}
private bool _wizardCompleted;
+
/// <summary>
/// Records the configuration values.
/// </summary>
@@ -258,7 +261,7 @@ namespace Emby.Server.Implementations.Library
/// </summary>
/// <param name="sender">The sender.</param>
/// <param name="e">The <see cref="EventArgs" /> instance containing the event data.</param>
- void ConfigurationUpdated(object sender, EventArgs e)
+ private void ConfigurationUpdated(object sender, EventArgs e)
{
var config = ConfigurationManager.Configuration;
@@ -335,12 +338,14 @@ namespace Emby.Server.Implementations.Library
// channel no longer installed
}
}
+
options.DeleteFileLocation = false;
}
if (item is LiveTvProgram)
{
- _logger.LogDebug("Deleting item, Type: {0}, Name: {1}, Path: {2}, Id: {3}",
+ _logger.LogDebug(
+ "Deleting item, Type: {0}, Name: {1}, Path: {2}, Id: {3}",
item.GetType().Name,
item.Name ?? "Unknown name",
item.Path ?? string.Empty,
@@ -348,7 +353,8 @@ namespace Emby.Server.Implementations.Library
}
else
{
- _logger.LogInformation("Deleting item, Type: {0}, Name: {1}, Path: {2}, Id: {3}",
+ _logger.LogInformation(
+ "Deleting item, Type: {0}, Name: {1}, Path: {2}, Id: {3}",
item.GetType().Name,
item.Name ?? "Unknown name",
item.Path ?? string.Empty,
@@ -488,12 +494,13 @@ namespace Emby.Server.Implementations.Library
{
throw new ArgumentNullException(nameof(key));
}
+
if (type == null)
{
throw new ArgumentNullException(nameof(type));
}
- if (key.StartsWith(ConfigurationManager.ApplicationPaths.ProgramDataPath))
+ if (key.StartsWith(ConfigurationManager.ApplicationPaths.ProgramDataPath, StringComparison.Ordinal))
{
// Try to normalize paths located underneath program-data in an attempt to make them more portable
key = key.Substring(ConfigurationManager.ApplicationPaths.ProgramDataPath.Length)
@@ -511,13 +518,11 @@ namespace Emby.Server.Implementations.Library
return key.GetMD5();
}
- public BaseItem ResolvePath(FileSystemMetadata fileInfo,
- Folder parent = null)
- {
- return ResolvePath(fileInfo, new DirectoryService(_logger, _fileSystem), null, parent);
- }
+ public BaseItem ResolvePath(FileSystemMetadata fileInfo, Folder parent = null)
+ => ResolvePath(fileInfo, new DirectoryService(_logger, _fileSystem), null, parent);
- private BaseItem ResolvePath(FileSystemMetadata fileInfo,
+ private BaseItem ResolvePath(
+ FileSystemMetadata fileInfo,
IDirectoryService directoryService,
IItemResolver[] resolvers,
Folder parent = null,
@@ -572,7 +577,7 @@ namespace Emby.Server.Implementations.Library
{
_logger.LogError(ex, "Error in GetFilteredFileSystemEntries isPhysicalRoot: {0} IsVf: {1}", isPhysicalRoot, isVf);
- files = new FileSystemMetadata[] { };
+ files = Array.Empty<FileSystemMetadata>();
}
else
{
@@ -600,13 +605,7 @@ namespace Emby.Server.Implementations.Library
}
public bool IgnoreFile(FileSystemMetadata file, BaseItem parent)
- {
- if (EntityResolutionIgnoreRules.Any(r => r.ShouldIgnore(file, parent)))
- {
- return true;
- }
- return false;
- }
+ => EntityResolutionIgnoreRules.Any(r => r.ShouldIgnore(file, parent));
public List<FileSystemMetadata> NormalizeRootPathList(IEnumerable<FileSystemMetadata> paths)
{
@@ -646,7 +645,8 @@ namespace Emby.Server.Implementations.Library
return ResolvePaths(files, directoryService, parent, libraryOptions, collectionType, EntityResolvers);
}
- public IEnumerable<BaseItem> ResolvePaths(IEnumerable<FileSystemMetadata> files,
+ public IEnumerable<BaseItem> ResolvePaths(
+ IEnumerable<FileSystemMetadata> files,
IDirectoryService directoryService,
Folder parent,
LibraryOptions libraryOptions,
@@ -672,6 +672,7 @@ namespace Emby.Server.Implementations.Library
{
ResolverHelper.SetInitialItemValues(item, parent, _fileSystem, this, directoryService);
}
+
items.AddRange(ResolveFileList(result.ExtraFiles, directoryService, parent, collectionType, resolvers, libraryOptions));
return items;
}
@@ -681,7 +682,8 @@ namespace Emby.Server.Implementations.Library
return ResolveFileList(fileList, directoryService, parent, collectionType, resolvers, libraryOptions);
}
- private IEnumerable<BaseItem> ResolveFileList(IEnumerable<FileSystemMetadata> fileList,
+ private IEnumerable<BaseItem> ResolveFileList(
+ IEnumerable<FileSystemMetadata> fileList,
IDirectoryService directoryService,
Folder parent,
string collectionType,
@@ -766,6 +768,7 @@ namespace Emby.Server.Implementations.Library
private volatile UserRootFolder _userRootFolder;
private readonly object _syncLock = new object();
+
public Folder GetUserRootFolder()
{
if (_userRootFolder == null)
@@ -810,8 +813,6 @@ namespace Emby.Server.Implementations.Library
throw new ArgumentNullException(nameof(path));
}
- //_logger.LogInformation("FindByPath {0}", path);
-
var query = new InternalItemsQuery
{
Path = path,
@@ -885,7 +886,6 @@ namespace Emby.Server.Implementations.Library
/// </summary>
/// <param name="value">The value.</param>
/// <returns>Task{Year}.</returns>
- /// <exception cref="ArgumentOutOfRangeException"></exception>
public Year GetYear(int value)
{
if (value <= 0)
@@ -1027,20 +1027,25 @@ namespace Emby.Server.Implementations.Library
private async Task ValidateTopLibraryFolders(CancellationToken cancellationToken)
{
- var rootChildren = RootFolder.Children.ToList();
- rootChildren = GetUserRootFolder().Children.ToList();
-
await RootFolder.RefreshMetadata(cancellationToken).ConfigureAwait(false);
// Start by just validating the children of the root, but go no further
- await RootFolder.ValidateChildren(new SimpleProgress<double>(), cancellationToken, new MetadataRefreshOptions(new DirectoryService(_logger, _fileSystem)), recursive: false);
+ await RootFolder.ValidateChildren(
+ new SimpleProgress<double>(),
+ cancellationToken,
+ new MetadataRefreshOptions(new DirectoryService(_logger, _fileSystem)),
+ recursive: false).ConfigureAwait(false);
await GetUserRootFolder().RefreshMetadata(cancellationToken).ConfigureAwait(false);
- await GetUserRootFolder().ValidateChildren(new SimpleProgress<double>(), cancellationToken, new MetadataRefreshOptions(new DirectoryService(_logger, _fileSystem)), recursive: false).ConfigureAwait(false);
+ await GetUserRootFolder().ValidateChildren(
+ new SimpleProgress<double>(),
+ cancellationToken,
+ new MetadataRefreshOptions(new DirectoryService(_logger, _fileSystem)),
+ recursive: false).ConfigureAwait(false);
// Quickly scan CollectionFolders for changes
- foreach (var folder in GetUserRootFolder().Children.OfType<Folder>().ToList())
+ foreach (var folder in GetUserRootFolder().Children.OfType<Folder>())
{
await folder.RefreshMetadata(cancellationToken).ConfigureAwait(false);
}
@@ -1204,7 +1209,7 @@ namespace Emby.Server.Implementations.Library
private string GetCollectionType(string path)
{
return _fileSystem.GetFilePaths(path, new[] { ".collection" }, true, false)
- .Select(i => Path.GetFileNameWithoutExtension(i))
+ .Select(Path.GetFileNameWithoutExtension)
.FirstOrDefault(i => !string.IsNullOrEmpty(i));
}
@@ -1218,7 +1223,7 @@ namespace Emby.Server.Implementations.Library
{
if (id == Guid.Empty)
{
- throw new ArgumentException(nameof(id), "Guid can't be empty");
+ throw new ArgumentException("Guid can't be empty", nameof(id));
}
if (LibraryItemsCache.TryGetValue(id, out BaseItem item))
@@ -1386,17 +1391,7 @@ namespace Emby.Server.Implementations.Library
var parents = query.AncestorIds.Select(i => GetItemById(i)).ToList();
- if (parents.All(i =>
- {
- if (i is ICollectionFolder || i is UserView)
- {
- return true;
- }
-
- //_logger.LogDebug("Query requires ancestor query due to type: " + i.GetType().Name);
- return false;
-
- }))
+ if (parents.All(i => i is ICollectionFolder || i is UserView))
{
// Optimize by querying against top level views
query.TopParentIds = parents.SelectMany(i => GetTopParentIdsForQuery(i, query.User)).ToArray();
@@ -1452,17 +1447,7 @@ namespace Emby.Server.Implementations.Library
private void SetTopParentIdsOrAncestors(InternalItemsQuery query, List<BaseItem> parents)
{
- if (parents.All(i =>
- {
- if (i is ICollectionFolder || i is UserView)
- {
- return true;
- }
-
- //_logger.LogDebug("Query requires ancestor query due to type: " + i.GetType().Name);
- return false;
-
- }))
+ if (parents.All(i => i is ICollectionFolder || i is UserView))
{
// Optimize by querying against top level views
query.TopParentIds = parents.SelectMany(i => GetTopParentIdsForQuery(i, query.User)).ToArray();
@@ -1511,11 +1496,9 @@ namespace Emby.Server.Implementations.Library
private IEnumerable<Guid> GetTopParentIdsForQuery(BaseItem item, User user)
{
- var view = item as UserView;
-
- if (view != null)
+ if (item is UserView view)
{
- if (string.Equals(view.ViewType, CollectionType.LiveTv))
+ if (string.Equals(view.ViewType, CollectionType.LiveTv, StringComparison.Ordinal))
{
return new[] { view.Id };
}
@@ -1528,8 +1511,10 @@ namespace Emby.Server.Implementations.Library
{
return GetTopParentIdsForQuery(displayParent, user);
}
+
return Array.Empty<Guid>();
}
+
if (!view.ParentId.Equals(Guid.Empty))
{
var displayParent = GetItemById(view.ParentId);
@@ -1537,6 +1522,7 @@ namespace Emby.Server.Implementations.Library
{
return GetTopParentIdsForQuery(displayParent, user);
}
+
return Array.Empty<Guid>();
}
@@ -1550,11 +1536,11 @@ namespace Emby.Server.Implementations.Library
.Where(i => user.IsFolderGrouped(i.Id))
.SelectMany(i => GetTopParentIdsForQuery(i, user));
}
+
return Array.Empty<Guid>();
}
- var collectionFolder = item as CollectionFolder;
- if (collectionFolder != null)
+ if (item is CollectionFolder collectionFolder)
{
return collectionFolder.PhysicalFolderIds;
}
@@ -1564,6 +1550,7 @@ namespace Emby.Server.Implementations.Library
{
return new[] { topParent.Id };
}
+
return Array.Empty<Guid>();
}
@@ -1760,19 +1747,16 @@ namespace Emby.Server.Implementations.Library
{
var comparer = Comparers.FirstOrDefault(c => string.Equals(name, c.Name, StringComparison.OrdinalIgnoreCase));
- if (comparer != null)
+ // If it requires a user, create a new one, and assign the user
+ if (comparer is IUserBaseItemComparer)
{
- // If it requires a user, create a new one, and assign the user
- if (comparer is IUserBaseItemComparer)
- {
- var userComparer = (IUserBaseItemComparer)Activator.CreateInstance(comparer.GetType());
+ var userComparer = (IUserBaseItemComparer)Activator.CreateInstance(comparer.GetType());
- userComparer.User = user;
- userComparer.UserManager = _userManager;
- userComparer.UserDataRepository = _userDataRepository;
+ userComparer.User = user;
+ userComparer.UserManager = _userManager;
+ userComparer.UserDataRepository = _userDataRepository;
- return userComparer;
- }
+ return userComparer;
}
return comparer;
@@ -1783,7 +1767,6 @@ namespace Emby.Server.Implementations.Library
/// </summary>
/// <param name="item">The item.</param>
/// <param name="parent">The parent item.</param>
- /// <returns>Task.</returns>
public void CreateItem(BaseItem item, BaseItem parent)
{
CreateItems(new[] { item }, parent, CancellationToken.None);
@@ -1793,20 +1776,23 @@ namespace Emby.Server.Implementations.Library
/// Creates the items.
/// </summary>
/// <param name="items">The items.</param>
+ /// <param name="parent">The parent item</param>
/// <param name="cancellationToken">The cancellation token.</param>
- /// <returns>Task.</returns>
public void CreateItems(IEnumerable<BaseItem> items, BaseItem parent, CancellationToken cancellationToken)
{
- ItemRepository.SaveItems(items, cancellationToken);
+ // Don't iterate multiple times
+ var itemsList = items.ToList();
+
+ ItemRepository.SaveItems(itemsList, cancellationToken);
- foreach (var item in items)
+ foreach (var item in itemsList)
{
RegisterItem(item);
}
if (ItemAdded != null)
{
- foreach (var item in items)
+ foreach (var item in itemsList)
{
// With the live tv guide this just creates too much noise
if (item.SourceType != SourceType.Library)
@@ -1816,11 +1802,13 @@ namespace Emby.Server.Implementations.Library
try
{
- ItemAdded(this, new ItemChangeEventArgs
- {
- Item = item,
- Parent = parent ?? item.GetParent()
- });
+ ItemAdded(
+ this,
+ new ItemChangeEventArgs
+ {
+ Item = item,
+ Parent = parent ?? item.GetParent()
+ });
}
catch (Exception ex)
{
@@ -1842,7 +1830,10 @@ namespace Emby.Server.Implementations.Library
/// </summary>
public void UpdateItems(IEnumerable<BaseItem> items, BaseItem parent, ItemUpdateType updateReason, CancellationToken cancellationToken)
{
- foreach (var item in items)
+ // Don't iterate multiple times
+ var itemsList = items.ToList();
+
+ foreach (var item in itemsList)
{
if (item.IsFileProtocol)
{
@@ -1854,14 +1845,11 @@ namespace Emby.Server.Implementations.Library
RegisterItem(item);
}
- //var logName = item.LocationType == LocationType.Remote ? item.Name ?? item.Path : item.Path ?? item.Name;
- //_logger.LogDebug("Saving {0} to database.", logName);
-
- ItemRepository.SaveItems(items, cancellationToken);
+ ItemRepository.SaveItems(itemsList, cancellationToken);
if (ItemUpdated != null)
{
- foreach (var item in items)
+ foreach (var item in itemsList)
{
// With the live tv guide this just creates too much noise
if (item.SourceType != SourceType.Library)
@@ -1871,12 +1859,14 @@ namespace Emby.Server.Implementations.Library
try
{
- ItemUpdated(this, new ItemChangeEventArgs
- {
- Item = item,
- Parent = parent,
- UpdateReason = updateReason
- });
+ ItemUpdated(
+ this,
+ new ItemChangeEventArgs
+ {
+ Item = item,
+ Parent = parent,
+ UpdateReason = updateReason
+ });
}
catch (Exception ex)
{
@@ -1890,9 +1880,9 @@ namespace Emby.Server.Implementations.Library
/// Updates the item.
/// </summary>
/// <param name="item">The item.</param>
+ /// <param name="parent">The parent item.</param>
/// <param name="updateReason">The update reason.</param>
/// <param name="cancellationToken">The cancellation token.</param>
- /// <returns>Task.</returns>
public void UpdateItem(BaseItem item, BaseItem parent, ItemUpdateType updateReason, CancellationToken cancellationToken)
{
UpdateItems(new [] { item }, parent, updateReason, cancellationToken);
@@ -1902,17 +1892,20 @@ namespace Emby.Server.Implementations.Library
/// Reports the item removed.
/// </summary>
/// <param name="item">The item.</param>
+ /// <param name="parent">The parent item.</param>
public void ReportItemRemoved(BaseItem item, BaseItem parent)
{
if (ItemRemoved != null)
{
try
{
- ItemRemoved(this, new ItemChangeEventArgs
- {
- Item = item,
- Parent = parent
- });
+ ItemRemoved(
+ this,
+ new ItemChangeEventArgs
+ {
+ Item = item,
+ Parent = parent
+ });
}
catch (Exception ex)
{
@@ -2038,8 +2031,7 @@ namespace Emby.Server.Implementations.Library
public string GetConfiguredContentType(BaseItem item, bool inheritConfiguredPath)
{
- var collectionFolder = item as ICollectionFolder;
- if (collectionFolder != null)
+ if (item is ICollectionFolder collectionFolder)
{
return collectionFolder.CollectionType;
}
@@ -2049,13 +2041,11 @@ namespace Emby.Server.Implementations.Library
private string GetContentTypeOverride(string path, bool inherit)
{
- var nameValuePair = ConfigurationManager.Configuration.ContentTypes.FirstOrDefault(i => _fileSystem.AreEqual(i.Name, path) || (inherit && !string.IsNullOrEmpty(i.Name) && _fileSystem.ContainsSubPath(i.Name, path)));
- if (nameValuePair != null)
- {
- return nameValuePair.Value;
- }
-
- return null;
+ var nameValuePair = ConfigurationManager.Configuration.ContentTypes
+ .FirstOrDefault(i => _fileSystem.AreEqual(i.Name, path)
+ || (inherit && !string.IsNullOrEmpty(i.Name)
+ && _fileSystem.ContainsSubPath(i.Name, path)));
+ return nameValuePair?.Value;
}
private string GetTopFolderContentType(BaseItem item)
@@ -2072,6 +2062,7 @@ namespace Emby.Server.Implementations.Library
{
break;
}
+
item = parent;
}
@@ -2083,9 +2074,9 @@ namespace Emby.Server.Implementations.Library
}
private readonly TimeSpan _viewRefreshInterval = TimeSpan.FromHours(24);
- //private readonly TimeSpan _viewRefreshInterval = TimeSpan.FromMinutes(1);
- public UserView GetNamedView(User user,
+ public UserView GetNamedView(
+ User user,
string name,
string viewType,
string sortName)
@@ -2093,13 +2084,15 @@ namespace Emby.Server.Implementations.Library
return GetNamedView(user, name, Guid.Empty, viewType, sortName);
}
- public UserView GetNamedView(string name,
+ public UserView GetNamedView(
+ string name,
string viewType,
string sortName)
{
- var path = Path.Combine(ConfigurationManager.ApplicationPaths.InternalMetadataPath,
- "views",
- _fileSystem.GetValidFilename(viewType));
+ var path = Path.Combine(
+ ConfigurationManager.ApplicationPaths.InternalMetadataPath,
+ "views",
+ _fileSystem.GetValidFilename(viewType));
var id = GetNewItemId(path + "_namedview_" + name, typeof(UserView));
@@ -2135,7 +2128,8 @@ namespace Emby.Server.Implementations.Library
return item;
}
- public UserView GetNamedView(User user,
+ public UserView GetNamedView(
+ User user,
string name,
Guid parentId,
string viewType,
@@ -2164,10 +2158,10 @@ namespace Emby.Server.Implementations.Library
Name = name,
ViewType = viewType,
ForcedSortName = sortName,
- UserId = user.Id
+ UserId = user.Id,
+ DisplayParentId = parentId
};
- item.DisplayParentId = parentId;
CreateItem(item, null);
@@ -2184,20 +2178,24 @@ namespace Emby.Server.Implementations.Library
if (refresh)
{
- _providerManagerFactory().QueueRefresh(item.Id, new MetadataRefreshOptions(new DirectoryService(_logger, _fileSystem))
- {
- // Need to force save to increment DateLastSaved
- ForceSave = true
+ _providerManagerFactory().QueueRefresh(
+ item.Id,
+ new MetadataRefreshOptions(new DirectoryService(_logger, _fileSystem))
+ {
+ // Need to force save to increment DateLastSaved
+ ForceSave = true
- }, RefreshPriority.Normal);
+ },
+ RefreshPriority.Normal);
}
return item;
}
- public UserView GetShadowView(BaseItem parent,
- string viewType,
- string sortName)
+ public UserView GetShadowView(
+ BaseItem parent,
+ string viewType,
+ string sortName)
{
if (parent == null)
{
@@ -2248,18 +2246,21 @@ namespace Emby.Server.Implementations.Library
if (refresh)
{
- _providerManagerFactory().QueueRefresh(item.Id, new MetadataRefreshOptions(new DirectoryService(_logger, _fileSystem))
- {
- // Need to force save to increment DateLastSaved
- ForceSave = true
-
- }, RefreshPriority.Normal);
+ _providerManagerFactory().QueueRefresh(
+ item.Id,
+ new MetadataRefreshOptions(new DirectoryService(_logger, _fileSystem))
+ {
+ // Need to force save to increment DateLastSaved
+ ForceSave = true
+ },
+ RefreshPriority.Normal);
}
return item;
}
- public UserView GetNamedView(string name,
+ public UserView GetNamedView(
+ string name,
Guid parentId,
string viewType,
string sortName,
@@ -2322,17 +2323,21 @@ namespace Emby.Server.Implementations.Library
if (refresh)
{
- _providerManagerFactory().QueueRefresh(item.Id, new MetadataRefreshOptions(new DirectoryService(_logger, _fileSystem))
- {
- // Need to force save to increment DateLastSaved
- ForceSave = true
- }, RefreshPriority.Normal);
+ _providerManagerFactory().QueueRefresh(
+ item.Id,
+ new MetadataRefreshOptions(new DirectoryService(_logger, _fileSystem))
+ {
+ // Need to force save to increment DateLastSaved
+ ForceSave = true
+ },
+ RefreshPriority.Normal);
}
return item;
}
- public void AddExternalSubtitleStreams(List<MediaStream> streams,
+ public void AddExternalSubtitleStreams(
+ List<MediaStream> streams,
string videoPath,
string[] files)
{
@@ -2436,6 +2441,7 @@ namespace Emby.Server.Implementations.Library
{
changed = true;
}
+
episode.IndexNumber = episodeInfo.EpisodeNumber;
}
@@ -2445,6 +2451,7 @@ namespace Emby.Server.Implementations.Library
{
changed = true;
}
+
episode.IndexNumberEnd = episodeInfo.EndingEpsiodeNumber;
}
@@ -2454,6 +2461,7 @@ namespace Emby.Server.Implementations.Library
{
changed = true;
}
+
episode.ParentIndexNumber = episodeInfo.SeasonNumber;
}
}
@@ -2483,6 +2491,7 @@ namespace Emby.Server.Implementations.Library
private NamingOptions _namingOptions;
private string[] _videoFileExtensions;
+
private NamingOptions GetNamingOptionsInternal()
{
if (_namingOptions == null)
@@ -2679,7 +2688,7 @@ namespace Emby.Server.Implementations.Library
var newPath = path.Replace(from, to, StringComparison.OrdinalIgnoreCase);
var changed = false;
- if (!string.Equals(newPath, path))
+ if (!string.Equals(newPath, path, StringComparison.Ordinal))
{
if (to.IndexOf('/') != -1)
{
@@ -2803,6 +2812,7 @@ namespace Emby.Server.Implementations.Library
{
continue;
}
+
throw;
}
}
@@ -2907,6 +2917,7 @@ namespace Emby.Server.Implementations.Library
}
private const string ShortcutFileExtension = ".mblink";
+
public void AddMediaPath(string virtualFolderName, MediaPathInfo pathInfo)
{
AddMediaPathInternal(virtualFolderName, pathInfo, true);
@@ -2923,7 +2934,7 @@ namespace Emby.Server.Implementations.Library
if (string.IsNullOrWhiteSpace(path))
{
- throw new ArgumentNullException(nameof(path));
+ throw new ArgumentException(nameof(path));
}
if (!Directory.Exists(path))
diff --git a/Emby.Server.Implementations/Library/UserManager.cs b/Emby.Server.Implementations/Library/UserManager.cs
index efb1ef4a5..4cf703add 100644
--- a/Emby.Server.Implementations/Library/UserManager.cs
+++ b/Emby.Server.Implementations/Library/UserManager.cs
@@ -216,10 +216,10 @@ namespace Emby.Server.Implementations.Library
public static bool IsValidUsername(string username)
{
- //This is some regex that matches only on unicode "word" characters, as well as -, _ and @
- //In theory this will cut out most if not all 'control' characters which should help minimize any weirdness
- // Usernames can contain letters (a-z + whatever else unicode is cool with), numbers (0-9), dashes (-), underscores (_), apostrophes ('), and periods (.)
- return Regex.IsMatch(username, "^[\\w-'._@]*$");
+ // This is some regex that matches only on unicode "word" characters, as well as -, _ and @
+ // In theory this will cut out most if not all 'control' characters which should help minimize any weirdness
+ // Usernames can contain letters (a-z + whatever else unicode is cool with), numbers (0-9), at-signs (@), dashes (-), underscores (_), apostrophes ('), and periods (.)
+ return Regex.IsMatch(username, @"^[\w\-'._@]*$");
}
private static bool IsValidUsernameCharacter(char i)
@@ -448,11 +448,19 @@ namespace Emby.Server.Implementations.Library
user.Policy.InvalidLoginAttemptCount = newValue;
- var maxCount = user.Policy.IsAdministrator ? 3 : 5;
+ // Check for users without a value here and then fill in the default value
+ // also protect from an always lockout if misconfigured
+ if (user.Policy.LoginAttemptsBeforeLockout == null || user.Policy.LoginAttemptsBeforeLockout == 0)
+ {
+ user.Policy.LoginAttemptsBeforeLockout = user.Policy.IsAdministrator ? 5 : 3;
+ }
+
+ var maxCount = user.Policy.LoginAttemptsBeforeLockout;
var fireLockout = false;
- if (newValue >= maxCount)
+ // -1 can be used to specify no lockout value
+ if (maxCount != -1 && newValue >= maxCount)
{
_logger.LogDebug("Disabling user {0} due to {1} unsuccessful login attempts.", user.Name, newValue);
user.Policy.IsDisabled = true;
diff --git a/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs b/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs
index f424bdf5c..7b210d231 100644
--- a/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs
+++ b/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs
@@ -33,7 +33,6 @@ using MediaBrowser.Model.LiveTv;
using MediaBrowser.Model.MediaInfo;
using MediaBrowser.Model.Providers;
using MediaBrowser.Model.Querying;
-using MediaBrowser.Model.Reflection;
using MediaBrowser.Model.Serialization;
using Microsoft.Extensions.Logging;
@@ -58,7 +57,6 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
private readonly IProviderManager _providerManager;
private readonly IMediaEncoder _mediaEncoder;
private readonly IProcessFactory _processFactory;
- private readonly IAssemblyInfo _assemblyInfo;
private IMediaSourceManager _mediaSourceManager;
public static EmbyTV Current;
@@ -74,7 +72,6 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
public EmbyTV(IServerApplicationHost appHost,
IStreamHelper streamHelper,
IMediaSourceManager mediaSourceManager,
- IAssemblyInfo assemblyInfo,
ILogger logger,
IJsonSerializer jsonSerializer,
IHttpClient httpClient,
@@ -101,7 +98,6 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
_processFactory = processFactory;
_liveTvManager = (LiveTvManager)liveTvManager;
_jsonSerializer = jsonSerializer;
- _assemblyInfo = assemblyInfo;
_mediaSourceManager = mediaSourceManager;
_streamHelper = streamHelper;
@@ -265,7 +261,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
public string HomePageUrl => "https://github.com/jellyfin/jellyfin";
- public async Task RefreshSeriesTimers(CancellationToken cancellationToken, IProgress<double> progress)
+ public async Task RefreshSeriesTimers(CancellationToken cancellationToken)
{
var seriesTimers = await GetSeriesTimersAsync(cancellationToken).ConfigureAwait(false);
@@ -275,7 +271,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
}
}
- public async Task RefreshTimers(CancellationToken cancellationToken, IProgress<double> progress)
+ public async Task RefreshTimers(CancellationToken cancellationToken)
{
var timers = await GetTimersAsync(cancellationToken).ConfigureAwait(false);
diff --git a/Emby.Server.Implementations/LiveTv/LiveTvManager.cs b/Emby.Server.Implementations/LiveTv/LiveTvManager.cs
index f7ef16fb0..9093d9740 100644
--- a/Emby.Server.Implementations/LiveTv/LiveTvManager.cs
+++ b/Emby.Server.Implementations/LiveTv/LiveTvManager.cs
@@ -1087,8 +1087,8 @@ namespace Emby.Server.Implementations.LiveTv
if (coreService != null)
{
- await coreService.RefreshSeriesTimers(cancellationToken, new SimpleProgress<double>()).ConfigureAwait(false);
- await coreService.RefreshTimers(cancellationToken, new SimpleProgress<double>()).ConfigureAwait(false);
+ await coreService.RefreshSeriesTimers(cancellationToken).ConfigureAwait(false);
+ await coreService.RefreshTimers(cancellationToken).ConfigureAwait(false);
}
// Load these now which will prefetch metadata
diff --git a/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunUdpStream.cs b/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunUdpStream.cs
index 8774371d5..7f426ea31 100644
--- a/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunUdpStream.cs
+++ b/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunUdpStream.cs
@@ -151,7 +151,8 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts.HdHomerun
});
}
- private static int RtpHeaderBytes = 12;
+ private const int RtpHeaderBytes = 12;
+
private async Task CopyTo(MediaBrowser.Model.Net.ISocket udpClient, string file, TaskCompletionSource<bool> openTaskCompletionSource, CancellationToken cancellationToken)
{
var bufferSize = 81920;
diff --git a/Emby.Server.Implementations/LiveTv/TunerHosts/LiveStream.cs b/Emby.Server.Implementations/LiveTv/TunerHosts/LiveStream.cs
index 1f8ca276e..ece2cbd54 100644
--- a/Emby.Server.Implementations/LiveTv/TunerHosts/LiveStream.cs
+++ b/Emby.Server.Implementations/LiveTv/TunerHosts/LiveStream.cs
@@ -22,7 +22,7 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts
public string OriginalStreamId { get; set; }
public bool EnableStreamSharing { get; set; }
- public string UniqueId { get; private set; }
+ public string UniqueId { get; }
protected readonly IFileSystem FileSystem;
protected readonly IServerApplicationPaths AppPaths;
@@ -31,12 +31,10 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts
protected readonly ILogger Logger;
protected readonly CancellationTokenSource LiveStreamCancellationTokenSource = new CancellationTokenSource();
- public string TunerHostId { get; private set; }
+ public string TunerHostId { get; }
public DateTime DateOpened { get; protected set; }
- public Func<Task> OnClose { get; set; }
-
public LiveStream(MediaSourceInfo mediaSource, TunerHostInfo tuner, IFileSystem fileSystem, ILogger logger, IServerApplicationPaths appPaths)
{
OriginalMediaSource = mediaSource;
@@ -76,26 +74,9 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts
LiveStreamCancellationTokenSource.Cancel();
- if (OnClose != null)
- {
- return CloseWithExternalFn();
- }
-
return Task.CompletedTask;
}
- private async Task CloseWithExternalFn()
- {
- try
- {
- await OnClose().ConfigureAwait(false);
- }
- catch (Exception ex)
- {
- Logger.LogError(ex, "Error closing live stream");
- }
- }
-
protected Stream GetInputStream(string path, bool allowAsyncFileRead)
{
var fileOpenOptions = FileOpenOptions.SequentialScan;
@@ -113,26 +94,25 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts
return DeleteTempFiles(GetStreamFilePaths());
}
- protected async Task DeleteTempFiles(List<string> paths, int retryCount = 0)
+ protected async Task DeleteTempFiles(IEnumerable<string> paths, int retryCount = 0)
{
if (retryCount == 0)
{
- Logger.LogInformation("Deleting temp files {0}", string.Join(", ", paths.ToArray()));
+ Logger.LogInformation("Deleting temp files {0}", paths);
}
var failedFiles = new List<string>();
foreach (var path in paths)
{
- try
- {
- FileSystem.DeleteFile(path);
- }
- catch (DirectoryNotFoundException)
+ if (!File.Exists(path))
{
+ continue;
}
- catch (FileNotFoundException)
+
+ try
{
+ FileSystem.DeleteFile(path);
}
catch (Exception ex)
{
@@ -157,8 +137,8 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts
{
cancellationToken = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken, LiveStreamCancellationTokenSource.Token).Token;
- var allowAsync = false;
- // use non-async filestream along with read due to https://github.com/dotnet/corefx/issues/6039
+ // use non-async filestream on windows along with read due to https://github.com/dotnet/corefx/issues/6039
+ var allowAsync = Environment.OSVersion.Platform != PlatformID.Win32NT;
bool seekFile = (DateTime.UtcNow - DateOpened).TotalSeconds > 10;
@@ -181,28 +161,24 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts
Logger.LogInformation("Live Stream ended.");
}
- private Tuple<string, bool> GetNextFile(string currentFile)
+ private (string file, bool isLastFile) GetNextFile(string currentFile)
{
var files = GetStreamFilePaths();
- //logger.LogInformation("Live stream files: {0}", string.Join(", ", files.ToArray()));
-
if (string.IsNullOrEmpty(currentFile))
{
- return new Tuple<string, bool>(files.Last(), true);
+ return (files.Last(), true);
}
var nextIndex = files.FindIndex(i => string.Equals(i, currentFile, StringComparison.OrdinalIgnoreCase)) + 1;
var isLastFile = nextIndex == files.Count - 1;
- return new Tuple<string, bool>(files.ElementAtOrDefault(nextIndex), isLastFile);
+ return (files.ElementAtOrDefault(nextIndex), isLastFile);
}
private async Task CopyFile(string path, bool seekFile, int emptyReadLimit, bool allowAsync, Stream stream, CancellationToken cancellationToken)
{
- //logger.LogInformation("Opening live stream file {0}. Empty read limit: {1}", path, emptyReadLimit);
-
using (var inputStream = (FileStream)GetInputStream(path, allowAsync))
{
if (seekFile)
@@ -218,7 +194,11 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts
private void TrySeek(FileStream stream, long offset)
{
- //logger.LogInformation("TrySeek live stream");
+ if (!stream.CanSeek)
+ {
+ return;
+ }
+
try
{
stream.Seek(offset, SeekOrigin.End);
diff --git a/Emby.Server.Implementations/LiveTv/TunerHosts/M3UTunerHost.cs b/Emby.Server.Implementations/LiveTv/TunerHosts/M3UTunerHost.cs
index 588dcb843..2d9bec53f 100644
--- a/Emby.Server.Implementations/LiveTv/TunerHosts/M3UTunerHost.cs
+++ b/Emby.Server.Implementations/LiveTv/TunerHosts/M3UTunerHost.cs
@@ -10,14 +10,12 @@ using MediaBrowser.Controller;
using MediaBrowser.Controller.Configuration;
using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.LiveTv;
-using MediaBrowser.Controller.MediaEncoding;
using MediaBrowser.Model.Dto;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.IO;
using MediaBrowser.Model.LiveTv;
using MediaBrowser.Model.MediaInfo;
using MediaBrowser.Model.Serialization;
-using MediaBrowser.Model.System;
using Microsoft.Extensions.Logging;
using Microsoft.Net.Http.Headers;
@@ -52,9 +50,7 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts
{
var channelIdPrefix = GetFullChannelIdPrefix(info);
- var result = await new M3uParser(Logger, _httpClient, _appHost).Parse(info.Url, channelIdPrefix, info.Id, cancellationToken).ConfigureAwait(false);
-
- return result.Cast<ChannelInfo>().ToList();
+ return await new M3uParser(Logger, _httpClient, _appHost).Parse(info.Url, channelIdPrefix, info.Id, cancellationToken).ConfigureAwait(false);
}
public Task<List<LiveTvTunerInfo>> GetTunerInfos(CancellationToken cancellationToken)
@@ -73,7 +69,7 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts
return Task.FromResult(list);
}
- private string[] _disallowedSharedStreamExtensions = new string[]
+ private static readonly string[] _disallowedSharedStreamExtensions = new string[]
{
".mkv",
".mp4",
@@ -88,9 +84,9 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts
if (tunerCount > 0)
{
var tunerHostId = info.Id;
- var liveStreams = currentLiveStreams.Where(i => string.Equals(i.TunerHostId, tunerHostId, StringComparison.OrdinalIgnoreCase)).ToList();
+ var liveStreams = currentLiveStreams.Where(i => string.Equals(i.TunerHostId, tunerHostId, StringComparison.OrdinalIgnoreCase));
- if (liveStreams.Count >= tunerCount)
+ if (liveStreams.Count() >= tunerCount)
{
throw new LiveTvConflictException("M3U simultaneous stream limit has been reached.");
}
@@ -98,7 +94,7 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts
var sources = await GetChannelStreamMediaSources(info, channelInfo, cancellationToken).ConfigureAwait(false);
- var mediaSource = sources.First();
+ var mediaSource = sources[0];
if (mediaSource.Protocol == MediaProtocol.Http && !mediaSource.RequiresLooping)
{
diff --git a/Emby.Server.Implementations/LiveTv/TunerHosts/M3uParser.cs b/Emby.Server.Implementations/LiveTv/TunerHosts/M3uParser.cs
index ad124bb0f..814031b12 100644
--- a/Emby.Server.Implementations/LiveTv/TunerHosts/M3uParser.cs
+++ b/Emby.Server.Implementations/LiveTv/TunerHosts/M3uParser.cs
@@ -11,7 +11,6 @@ using MediaBrowser.Common.Net;
using MediaBrowser.Controller;
using MediaBrowser.Controller.LiveTv;
using MediaBrowser.Model.Extensions;
-using MediaBrowser.Model.IO;
using Microsoft.Extensions.Logging;
namespace Emby.Server.Implementations.LiveTv.TunerHosts
@@ -62,12 +61,13 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts
return Task.FromResult((Stream)File.OpenRead(url));
}
- const string ExtInfPrefix = "#EXTINF:";
+ private const string ExtInfPrefix = "#EXTINF:";
+
private List<ChannelInfo> GetChannels(TextReader reader, string channelIdPrefix, string tunerHostId)
{
var channels = new List<ChannelInfo>();
string line;
- string extInf = "";
+ string extInf = string.Empty;
while ((line = reader.ReadLine()) != null)
{
@@ -101,7 +101,7 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts
channel.Path = line;
channels.Add(channel);
- extInf = "";
+ extInf = string.Empty;
}
}
@@ -110,8 +110,10 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts
private ChannelInfo GetChannelnfo(string extInf, string tunerHostId, string mediaUrl)
{
- var channel = new ChannelInfo();
- channel.TunerHostId = tunerHostId;
+ var channel = new ChannelInfo()
+ {
+ TunerHostId = tunerHostId
+ };
extInf = extInf.Trim();
@@ -137,13 +139,15 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts
{
channelIdValues.Add(channelId);
}
+
if (!string.IsNullOrWhiteSpace(tvgId))
{
channelIdValues.Add(tvgId);
}
+
if (channelIdValues.Count > 0)
{
- channel.Id = string.Join("_", channelIdValues.ToArray());
+ channel.Id = string.Join("_", channelIdValues);
}
return channel;
@@ -152,7 +156,7 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts
private string GetChannelNumber(string extInf, Dictionary<string, string> attributes, string mediaUrl)
{
var nameParts = extInf.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
- var nameInExtInf = nameParts.Length > 1 ? nameParts.Last().Trim() : null;
+ var nameInExtInf = nameParts.Length > 1 ? nameParts[nameParts.Length - 1].Trim() : null;
string numberString = null;
string attributeValue;
diff --git a/Emby.Server.Implementations/Localization/Core/es-AR.json b/Emby.Server.Implementations/Localization/Core/es-AR.json
index c01bb0c50..dc73ba6b3 100644
--- a/Emby.Server.Implementations/Localization/Core/es-AR.json
+++ b/Emby.Server.Implementations/Localization/Core/es-AR.json
@@ -1,97 +1,97 @@
{
- "Albums": "Albums",
- "AppDeviceValues": "App: {0}, Device: {1}",
- "Application": "Application",
- "Artists": "Artists",
- "AuthenticationSucceededWithUserName": "{0} successfully authenticated",
- "Books": "Books",
- "CameraImageUploadedFrom": "A new camera image has been uploaded from {0}",
- "Channels": "Channels",
- "ChapterNameValue": "Chapter {0}",
- "Collections": "Collections",
- "DeviceOfflineWithName": "{0} has disconnected",
- "DeviceOnlineWithName": "{0} is connected",
- "FailedLoginAttemptWithUserName": "Failed login attempt from {0}",
- "Favorites": "Favorites",
- "Folders": "Folders",
- "Genres": "Genres",
- "HeaderAlbumArtists": "Album Artists",
- "HeaderCameraUploads": "Camera Uploads",
- "HeaderContinueWatching": "Continue Watching",
- "HeaderFavoriteAlbums": "Favorite Albums",
- "HeaderFavoriteArtists": "Favorite Artists",
- "HeaderFavoriteEpisodes": "Favorite Episodes",
- "HeaderFavoriteShows": "Favorite Shows",
- "HeaderFavoriteSongs": "Favorite Songs",
- "HeaderLiveTV": "Live TV",
- "HeaderNextUp": "Next Up",
- "HeaderRecordingGroups": "Recording Groups",
- "HomeVideos": "Home videos",
- "Inherit": "Inherit",
- "ItemAddedWithName": "{0} was added to the library",
- "ItemRemovedWithName": "{0} was removed from the library",
- "LabelIpAddressValue": "Ip address: {0}",
- "LabelRunningTimeValue": "Running time: {0}",
- "Latest": "Latest",
- "MessageApplicationUpdated": "Jellyfin Server has been updated",
- "MessageApplicationUpdatedTo": "Jellyfin Server has been updated to {0}",
- "MessageNamedServerConfigurationUpdatedWithValue": "Server configuration section {0} has been updated",
- "MessageServerConfigurationUpdated": "Server configuration has been updated",
- "MixedContent": "Mixed content",
- "Movies": "Movies",
- "Music": "Music",
- "MusicVideos": "Music videos",
- "NameInstallFailed": "{0} installation failed",
- "NameSeasonNumber": "Season {0}",
- "NameSeasonUnknown": "Season Unknown",
- "NewVersionIsAvailable": "A new version of Jellyfin Server is available for download.",
- "NotificationOptionApplicationUpdateAvailable": "Application update available",
- "NotificationOptionApplicationUpdateInstalled": "Application update installed",
- "NotificationOptionAudioPlayback": "Audio playback started",
- "NotificationOptionAudioPlaybackStopped": "Audio playback stopped",
- "NotificationOptionCameraImageUploaded": "Camera image uploaded",
- "NotificationOptionInstallationFailed": "Installation failure",
- "NotificationOptionNewLibraryContent": "New content added",
- "NotificationOptionPluginError": "Plugin failure",
- "NotificationOptionPluginInstalled": "Plugin installed",
- "NotificationOptionPluginUninstalled": "Plugin uninstalled",
- "NotificationOptionPluginUpdateInstalled": "Plugin update installed",
- "NotificationOptionServerRestartRequired": "Server restart required",
- "NotificationOptionTaskFailed": "Scheduled task failure",
- "NotificationOptionUserLockedOut": "User locked out",
- "NotificationOptionVideoPlayback": "Video playback started",
- "NotificationOptionVideoPlaybackStopped": "Video playback stopped",
- "Photos": "Photos",
- "Playlists": "Playlists",
+ "Albums": "Álbumes",
+ "AppDeviceValues": "Aplicación: {0}, Dispositivo: {1}",
+ "Application": "Aplicación",
+ "Artists": "Artistas",
+ "AuthenticationSucceededWithUserName": "{0} autenticado correctamente",
+ "Books": "Libros",
+ "CameraImageUploadedFrom": "Se ha subido una nueva imagen de cámara desde {0}",
+ "Channels": "Canales",
+ "ChapterNameValue": "Capítulo {0}",
+ "Collections": "Colecciones",
+ "DeviceOfflineWithName": "{0} se ha desconectado",
+ "DeviceOnlineWithName": "{0} está conectado",
+ "FailedLoginAttemptWithUserName": "Error al intentar iniciar sesión desde {0}",
+ "Favorites": "Favoritos",
+ "Folders": "Carpetas",
+ "Genres": "Géneros",
+ "HeaderAlbumArtists": "Artistas de álbumes",
+ "HeaderCameraUploads": "Subidas de cámara",
+ "HeaderContinueWatching": "Continuar viendo",
+ "HeaderFavoriteAlbums": "Álbumes favoritos",
+ "HeaderFavoriteArtists": "Artistas favoritos",
+ "HeaderFavoriteEpisodes": "Episodios favoritos",
+ "HeaderFavoriteShows": "Programas favoritos",
+ "HeaderFavoriteSongs": "Canciones favoritas",
+ "HeaderLiveTV": "TV en vivo",
+ "HeaderNextUp": "Continuar Viendo",
+ "HeaderRecordingGroups": "Grupos de grabación",
+ "HomeVideos": "Videos caseros",
+ "Inherit": "Heredar",
+ "ItemAddedWithName": "{0} se ha añadido a la biblioteca",
+ "ItemRemovedWithName": "{0} ha sido eliminado de la biblioteca",
+ "LabelIpAddressValue": "Dirección IP: {0}",
+ "LabelRunningTimeValue": "Tiempo de funcionamiento: {0}",
+ "Latest": "Últimos",
+ "MessageApplicationUpdated": "El servidor Jellyfin fue actualizado",
+ "MessageApplicationUpdatedTo": "Se ha actualizado el servidor Jellyfin a la versión {0}",
+ "MessageNamedServerConfigurationUpdatedWithValue": "Fue actualizada la sección {0} de la configuración del servidor",
+ "MessageServerConfigurationUpdated": "Fue actualizada la configuración del servidor",
+ "MixedContent": "Contenido mixto",
+ "Movies": "Películas",
+ "Music": "Música",
+ "MusicVideos": "Videos musicales",
+ "NameInstallFailed": "{0} error de instalación",
+ "NameSeasonNumber": "Temporada {0}",
+ "NameSeasonUnknown": "Temporada desconocida",
+ "NewVersionIsAvailable": "Disponible una nueva versión de Jellyfin para descargar.",
+ "NotificationOptionApplicationUpdateAvailable": "Actualización de la aplicación disponible",
+ "NotificationOptionApplicationUpdateInstalled": "Actualización de la aplicación instalada",
+ "NotificationOptionAudioPlayback": "Se inició la reproducción de audio",
+ "NotificationOptionAudioPlaybackStopped": "Se detuvo la reproducción de audio",
+ "NotificationOptionCameraImageUploaded": "Imagen de la cámara cargada",
+ "NotificationOptionInstallationFailed": "Error de instalación",
+ "NotificationOptionNewLibraryContent": "Nuevo contenido añadido",
+ "NotificationOptionPluginError": "Error en plugin",
+ "NotificationOptionPluginInstalled": "Plugin instalado",
+ "NotificationOptionPluginUninstalled": "Plugin desinstalado",
+ "NotificationOptionPluginUpdateInstalled": "Actualización del complemento instalada",
+ "NotificationOptionServerRestartRequired": "Se requiere reinicio del servidor",
+ "NotificationOptionTaskFailed": "Error de tarea programada",
+ "NotificationOptionUserLockedOut": "Usuario bloqueado",
+ "NotificationOptionVideoPlayback": "Se inició la reproducción de video",
+ "NotificationOptionVideoPlaybackStopped": "Reproducción de video detenida",
+ "Photos": "Fotos",
+ "Playlists": "Listas de reproducción",
"Plugin": "Plugin",
- "PluginInstalledWithName": "{0} was installed",
- "PluginUninstalledWithName": "{0} was uninstalled",
- "PluginUpdatedWithName": "{0} was updated",
- "ProviderValue": "Provider: {0}",
- "ScheduledTaskFailedWithName": "{0} failed",
- "ScheduledTaskStartedWithName": "{0} started",
- "ServerNameNeedsToBeRestarted": "{0} needs to be restarted",
+ "PluginInstalledWithName": "{0} fue instalado",
+ "PluginUninstalledWithName": "{0} fue desinstalado",
+ "PluginUpdatedWithName": "{0} fue actualizado",
+ "ProviderValue": "Proveedor: {0}",
+ "ScheduledTaskFailedWithName": "{0} falló",
+ "ScheduledTaskStartedWithName": "{0} iniciada",
+ "ServerNameNeedsToBeRestarted": "{0} necesita ser reiniciado",
"Shows": "Series",
- "Songs": "Songs",
- "StartupEmbyServerIsLoading": "Jellyfin Server is loading. Please try again shortly.",
+ "Songs": "Canciones",
+ "StartupEmbyServerIsLoading": "Jellyfin Server se está cargando. Vuelve a intentarlo en breve.",
"SubtitleDownloadFailureForItem": "Subtitles failed to download for {0}",
- "SubtitleDownloadFailureFromForItem": "Subtitles failed to download from {0} for {1}",
- "SubtitlesDownloadedForItem": "Subtitles downloaded for {0}",
- "Sync": "Sync",
- "System": "System",
- "TvShows": "TV Shows",
- "User": "User",
- "UserCreatedWithName": "User {0} has been created",
- "UserDeletedWithName": "User {0} has been deleted",
- "UserDownloadingItemWithValues": "{0} is downloading {1}",
- "UserLockedOutWithName": "User {0} has been locked out",
- "UserOfflineFromDevice": "{0} has disconnected from {1}",
- "UserOnlineFromDevice": "{0} is online from {1}",
- "UserPasswordChangedWithName": "Password has been changed for user {0}",
- "UserPolicyUpdatedWithName": "User policy has been updated for {0}",
- "UserStartedPlayingItemWithValues": "{0} is playing {1} on {2}",
- "UserStoppedPlayingItemWithValues": "{0} has finished playing {1} on {2}",
- "ValueHasBeenAddedToLibrary": "{0} has been added to your media library",
- "ValueSpecialEpisodeName": "Special - {0}",
- "VersionNumber": "Version {0}"
+ "SubtitleDownloadFailureFromForItem": "Fallo de descarga de subtítulos desde {0} para {1}",
+ "SubtitlesDownloadedForItem": "Descargar subtítulos para {0}",
+ "Sync": "Sincronizar",
+ "System": "Sistema",
+ "TvShows": "Series de TV",
+ "User": "Usuario",
+ "UserCreatedWithName": "El usuario {0} ha sido creado",
+ "UserDeletedWithName": "El usuario {0} ha sido borrado",
+ "UserDownloadingItemWithValues": "{0} está descargando {1}",
+ "UserLockedOutWithName": "El usuario {0} ha sido bloqueado",
+ "UserOfflineFromDevice": "{0} se ha desconectado de {1}",
+ "UserOnlineFromDevice": "{0} está en línea desde {1}",
+ "UserPasswordChangedWithName": "Se ha cambiado la contraseña para el usuario {0}",
+ "UserPolicyUpdatedWithName": "Actualizada política de usuario para {0}",
+ "UserStartedPlayingItemWithValues": "{0} está reproduciendo {1} en {2}",
+ "UserStoppedPlayingItemWithValues": "{0} ha terminado de reproducir {1} en {2}",
+ "ValueHasBeenAddedToLibrary": "{0} ha sido añadido a tu biblioteca multimedia",
+ "ValueSpecialEpisodeName": "Especial - {0}",
+ "VersionNumber": "Versión {0}"
}
diff --git a/Emby.Server.Implementations/Localization/Core/fr-CA.json b/Emby.Server.Implementations/Localization/Core/fr-CA.json
index 7202be9f5..4b4db39a8 100644
--- a/Emby.Server.Implementations/Localization/Core/fr-CA.json
+++ b/Emby.Server.Implementations/Localization/Core/fr-CA.json
@@ -1,97 +1,97 @@
{
"Albums": "Albums",
- "AppDeviceValues": "App: {0}, Device: {1}",
+ "AppDeviceValues": "Application : {0}, Appareil : {1}",
"Application": "Application",
- "Artists": "Artists",
- "AuthenticationSucceededWithUserName": "{0} successfully authenticated",
- "Books": "Books",
- "CameraImageUploadedFrom": "A new camera image has been uploaded from {0}",
- "Channels": "Channels",
- "ChapterNameValue": "Chapter {0}",
+ "Artists": "Artistes",
+ "AuthenticationSucceededWithUserName": "{0} s'est authentifié avec succès",
+ "Books": "Livres",
+ "CameraImageUploadedFrom": "Une nouvelle image de caméra a été téléchargée depuis {0}",
+ "Channels": "Chaînes",
+ "ChapterNameValue": "Chapitre {0}",
"Collections": "Collections",
- "DeviceOfflineWithName": "{0} has disconnected",
- "DeviceOnlineWithName": "{0} is connected",
- "FailedLoginAttemptWithUserName": "Failed login attempt from {0}",
- "Favorites": "Favorites",
- "Folders": "Folders",
+ "DeviceOfflineWithName": "{0} s'est déconnecté",
+ "DeviceOnlineWithName": "{0} est connecté",
+ "FailedLoginAttemptWithUserName": "Échec d'une tentative de connexion de {0}",
+ "Favorites": "Favoris",
+ "Folders": "Dossiers",
"Genres": "Genres",
- "HeaderAlbumArtists": "Album Artists",
- "HeaderCameraUploads": "Camera Uploads",
+ "HeaderAlbumArtists": "Artistes de l'album",
+ "HeaderCameraUploads": "Photos transférées",
"HeaderContinueWatching": "Continuer à regarder",
- "HeaderFavoriteAlbums": "Favorite Albums",
- "HeaderFavoriteArtists": "Favorite Artists",
- "HeaderFavoriteEpisodes": "Favorite Episodes",
- "HeaderFavoriteShows": "Favorite Shows",
- "HeaderFavoriteSongs": "Favorite Songs",
- "HeaderLiveTV": "Live TV",
+ "HeaderFavoriteAlbums": "Albums favoris",
+ "HeaderFavoriteArtists": "Artistes favoris",
+ "HeaderFavoriteEpisodes": "Épisodes favoris",
+ "HeaderFavoriteShows": "Séries favorites",
+ "HeaderFavoriteSongs": "Chansons favorites",
+ "HeaderLiveTV": "TV en direct",
"HeaderNextUp": "À Suivre",
- "HeaderRecordingGroups": "Recording Groups",
- "HomeVideos": "Home videos",
- "Inherit": "Inherit",
- "ItemAddedWithName": "{0} was added to the library",
- "ItemRemovedWithName": "{0} was removed from the library",
- "LabelIpAddressValue": "Ip address: {0}",
- "LabelRunningTimeValue": "Running time: {0}",
- "Latest": "Latest",
- "MessageApplicationUpdated": "Jellyfin Server has been updated",
- "MessageApplicationUpdatedTo": "Jellyfin Server has been updated to {0}",
- "MessageNamedServerConfigurationUpdatedWithValue": "Server configuration section {0} has been updated",
- "MessageServerConfigurationUpdated": "Server configuration has been updated",
- "MixedContent": "Mixed content",
- "Movies": "Movies",
- "Music": "Music",
- "MusicVideos": "Music videos",
- "NameInstallFailed": "{0} installation failed",
- "NameSeasonNumber": "Season {0}",
- "NameSeasonUnknown": "Season Unknown",
- "NewVersionIsAvailable": "A new version of Jellyfin Server is available for download.",
- "NotificationOptionApplicationUpdateAvailable": "Application update available",
- "NotificationOptionApplicationUpdateInstalled": "Application update installed",
- "NotificationOptionAudioPlayback": "Audio playback started",
- "NotificationOptionAudioPlaybackStopped": "Audio playback stopped",
- "NotificationOptionCameraImageUploaded": "Camera image uploaded",
- "NotificationOptionInstallationFailed": "Installation failure",
- "NotificationOptionNewLibraryContent": "New content added",
- "NotificationOptionPluginError": "Plugin failure",
- "NotificationOptionPluginInstalled": "Plugin installed",
- "NotificationOptionPluginUninstalled": "Plugin uninstalled",
- "NotificationOptionPluginUpdateInstalled": "Plugin update installed",
- "NotificationOptionServerRestartRequired": "Server restart required",
- "NotificationOptionTaskFailed": "Scheduled task failure",
- "NotificationOptionUserLockedOut": "User locked out",
- "NotificationOptionVideoPlayback": "Video playback started",
- "NotificationOptionVideoPlaybackStopped": "Video playback stopped",
+ "HeaderRecordingGroups": "Groupes d'enregistrements",
+ "HomeVideos": "Vidéos personnelles",
+ "Inherit": "Hériter",
+ "ItemAddedWithName": "{0} a été ajouté à la médiathèque",
+ "ItemRemovedWithName": "{0} a été supprimé de la médiathèque",
+ "LabelIpAddressValue": "Adresse IP : {0}",
+ "LabelRunningTimeValue": "Durée : {0}",
+ "Latest": "Derniers",
+ "MessageApplicationUpdated": "Le serveur Jellyfin a été mis à jour",
+ "MessageApplicationUpdatedTo": "Le serveur Jellyfin a été mis à jour vers la version {0}",
+ "MessageNamedServerConfigurationUpdatedWithValue": "La configuration de la section {0} du serveur a été mise à jour",
+ "MessageServerConfigurationUpdated": "La configuration du serveur a été mise à jour",
+ "MixedContent": "Contenu mixte",
+ "Movies": "Films",
+ "Music": "Musique",
+ "MusicVideos": "Vidéos musicales",
+ "NameInstallFailed": "{0} échec d'installation",
+ "NameSeasonNumber": "Saison {0}",
+ "NameSeasonUnknown": "Saison Inconnue",
+ "NewVersionIsAvailable": "Une nouvelle version du serveur Jellyfin est disponible au téléchargement.",
+ "NotificationOptionApplicationUpdateAvailable": "Mise à jour de l'application disponible",
+ "NotificationOptionApplicationUpdateInstalled": "Mise à jour de l'application installée",
+ "NotificationOptionAudioPlayback": "Lecture audio démarrée",
+ "NotificationOptionAudioPlaybackStopped": "Lecture audio arrêtée",
+ "NotificationOptionCameraImageUploaded": "L'image de l'appareil photo a été transférée",
+ "NotificationOptionInstallationFailed": "Échec d'installation",
+ "NotificationOptionNewLibraryContent": "Nouveau contenu ajouté",
+ "NotificationOptionPluginError": "Erreur d'extension",
+ "NotificationOptionPluginInstalled": "Extension installée",
+ "NotificationOptionPluginUninstalled": "Extension désinstallée",
+ "NotificationOptionPluginUpdateInstalled": "Mise à jour d'extension installée",
+ "NotificationOptionServerRestartRequired": "Un redémarrage du serveur est requis",
+ "NotificationOptionTaskFailed": "Échec de tâche planifiée",
+ "NotificationOptionUserLockedOut": "Utilisateur verrouillé",
+ "NotificationOptionVideoPlayback": "Lecture vidéo démarrée",
+ "NotificationOptionVideoPlaybackStopped": "Lecture vidéo arrêtée",
"Photos": "Photos",
- "Playlists": "Playlists",
- "Plugin": "Plugin",
- "PluginInstalledWithName": "{0} was installed",
- "PluginUninstalledWithName": "{0} was uninstalled",
- "PluginUpdatedWithName": "{0} was updated",
- "ProviderValue": "Provider: {0}",
- "ScheduledTaskFailedWithName": "{0} failed",
- "ScheduledTaskStartedWithName": "{0} started",
- "ServerNameNeedsToBeRestarted": "{0} needs to be restarted",
- "Shows": "Series",
- "Songs": "Songs",
- "StartupEmbyServerIsLoading": "Jellyfin Server is loading. Please try again shortly.",
+ "Playlists": "Listes de lecture",
+ "Plugin": "Extension",
+ "PluginInstalledWithName": "{0} a été installé",
+ "PluginUninstalledWithName": "{0} a été désinstallé",
+ "PluginUpdatedWithName": "{0} a été mis à jour",
+ "ProviderValue": "Fournisseur : {0}",
+ "ScheduledTaskFailedWithName": "{0} a échoué",
+ "ScheduledTaskStartedWithName": "{0} a commencé",
+ "ServerNameNeedsToBeRestarted": "{0} doit être redémarré",
+ "Shows": "Émissions",
+ "Songs": "Chansons",
+ "StartupEmbyServerIsLoading": "Le serveur Jellyfin est en cours de chargement. Veuillez réessayer dans quelques instants.",
"SubtitleDownloadFailureForItem": "Subtitles failed to download for {0}",
- "SubtitleDownloadFailureFromForItem": "Subtitles failed to download from {0} for {1}",
- "SubtitlesDownloadedForItem": "Subtitles downloaded for {0}",
- "Sync": "Sync",
- "System": "System",
- "TvShows": "TV Shows",
- "User": "User",
- "UserCreatedWithName": "User {0} has been created",
- "UserDeletedWithName": "User {0} has been deleted",
- "UserDownloadingItemWithValues": "{0} is downloading {1}",
- "UserLockedOutWithName": "User {0} has been locked out",
- "UserOfflineFromDevice": "{0} has disconnected from {1}",
- "UserOnlineFromDevice": "{0} is online from {1}",
- "UserPasswordChangedWithName": "Password has been changed for user {0}",
- "UserPolicyUpdatedWithName": "User policy has been updated for {0}",
- "UserStartedPlayingItemWithValues": "{0} is playing {1} on {2}",
- "UserStoppedPlayingItemWithValues": "{0} has finished playing {1} on {2}",
- "ValueHasBeenAddedToLibrary": "{0} has been added to your media library",
+ "SubtitleDownloadFailureFromForItem": "Échec du téléchargement des sous-titres depuis {0} pour {1}",
+ "SubtitlesDownloadedForItem": "Les sous-titres de {0} ont été téléchargés",
+ "Sync": "Synchroniser",
+ "System": "Système",
+ "TvShows": "Séries Télé",
+ "User": "Utilisateur",
+ "UserCreatedWithName": "L'utilisateur {0} a été créé",
+ "UserDeletedWithName": "L'utilisateur {0} a été supprimé",
+ "UserDownloadingItemWithValues": "{0} est en train de télécharger {1}",
+ "UserLockedOutWithName": "L'utilisateur {0} a été verrouillé",
+ "UserOfflineFromDevice": "{0} s'est déconnecté depuis {1}",
+ "UserOnlineFromDevice": "{0} s'est connecté depuis {1}",
+ "UserPasswordChangedWithName": "Le mot de passe pour l'utilisateur {0} a été modifié",
+ "UserPolicyUpdatedWithName": "La politique de l'utilisateur a été mise à jour pour {0}",
+ "UserStartedPlayingItemWithValues": "{0} est en train de lire {1} sur {2}",
+ "UserStoppedPlayingItemWithValues": "{0} vient d'arrêter la lecture de {1} sur {2}",
+ "ValueHasBeenAddedToLibrary": "{0} a été ajouté à votre médiathèque",
"ValueSpecialEpisodeName": "Spécial - {0}",
"VersionNumber": "Version {0}"
}
diff --git a/Emby.Server.Implementations/Localization/Core/fr.json b/Emby.Server.Implementations/Localization/Core/fr.json
index 52afb4e49..e434b7605 100644
--- a/Emby.Server.Implementations/Localization/Core/fr.json
+++ b/Emby.Server.Implementations/Localization/Core/fr.json
@@ -44,7 +44,7 @@
"NameInstallFailed": "{0} échec d'installation",
"NameSeasonNumber": "Saison {0}",
"NameSeasonUnknown": "Saison Inconnue",
- "NewVersionIsAvailable": "Une nouvelle version d'Jellyfin Serveur est disponible au téléchargement.",
+ "NewVersionIsAvailable": "Une nouvelle version de Jellyfin Serveur est disponible au téléchargement.",
"NotificationOptionApplicationUpdateAvailable": "Mise à jour de l'application disponible",
"NotificationOptionApplicationUpdateInstalled": "Mise à jour de l'application installée",
"NotificationOptionAudioPlayback": "Lecture audio démarrée",
@@ -89,7 +89,7 @@
"UserOnlineFromDevice": "{0} s'est connecté depuis {1}",
"UserPasswordChangedWithName": "Le mot de passe pour l'utilisateur {0} a été modifié",
"UserPolicyUpdatedWithName": "La politique de l'utilisateur a été mise à jour pour {0}",
- "UserStartedPlayingItemWithValues": "{0} est entrain de lire {1} sur {2}",
+ "UserStartedPlayingItemWithValues": "{0} est en train de lire {1} sur {2}",
"UserStoppedPlayingItemWithValues": "{0} vient d'arrêter la lecture de {1} sur {2}",
"ValueHasBeenAddedToLibrary": "{0} a été ajouté à votre librairie",
"ValueSpecialEpisodeName": "Spécial - {0}",
diff --git a/Emby.Server.Implementations/Localization/Core/he.json b/Emby.Server.Implementations/Localization/Core/he.json
index fff1d1f0e..0ed998c4b 100644
--- a/Emby.Server.Implementations/Localization/Core/he.json
+++ b/Emby.Server.Implementations/Localization/Core/he.json
@@ -1,8 +1,8 @@
{
- "Albums": "Albums",
+ "Albums": "אלבומים",
"AppDeviceValues": "App: {0}, Device: {1}",
- "Application": "Application",
- "Artists": "Artists",
+ "Application": "אפליקציה",
+ "Artists": "אמנים",
"AuthenticationSucceededWithUserName": "{0} successfully authenticated",
"Books": "ספרים",
"CameraImageUploadedFrom": "A new camera image has been uploaded from {0}",
diff --git a/Emby.Server.Implementations/Localization/Core/it.json b/Emby.Server.Implementations/Localization/Core/it.json
index a5f1e8f94..357883cd3 100644
--- a/Emby.Server.Implementations/Localization/Core/it.json
+++ b/Emby.Server.Implementations/Localization/Core/it.json
@@ -34,17 +34,17 @@
"LabelRunningTimeValue": "Durata: {0}",
"Latest": "Più recenti",
"MessageApplicationUpdated": "Il Server Jellyfin è stato aggiornato",
- "MessageApplicationUpdatedTo": "Jellyfin Server has been updated to {0}",
+ "MessageApplicationUpdatedTo": "Jellyfin Server è stato aggiornato a {0}",
"MessageNamedServerConfigurationUpdatedWithValue": "La sezione {0} della configurazione server è stata aggiornata",
"MessageServerConfigurationUpdated": "La configurazione del server è stata aggiornata",
"MixedContent": "Contenuto misto",
"Movies": "Film",
"Music": "Musica",
"MusicVideos": "Video musicali",
- "NameInstallFailed": "{0} installation failed",
+ "NameInstallFailed": "{0} installazione fallita",
"NameSeasonNumber": "Stagione {0}",
"NameSeasonUnknown": "Stagione sconosciuto",
- "NewVersionIsAvailable": "A new version of Jellyfin Server is available for download.",
+ "NewVersionIsAvailable": "Una nuova versione di Jellyfin Server è disponibile per il download.",
"NotificationOptionApplicationUpdateAvailable": "Aggiornamento dell'applicazione disponibile",
"NotificationOptionApplicationUpdateInstalled": "Aggiornamento dell'applicazione installato",
"NotificationOptionAudioPlayback": "La riproduzione audio è iniziata",
@@ -70,12 +70,12 @@
"ProviderValue": "Provider: {0}",
"ScheduledTaskFailedWithName": "{0} fallito",
"ScheduledTaskStartedWithName": "{0} avviati",
- "ServerNameNeedsToBeRestarted": "{0} needs to be restarted",
+ "ServerNameNeedsToBeRestarted": "{0} deve essere riavviato",
"Shows": "Programmi",
"Songs": "Canzoni",
"StartupEmbyServerIsLoading": "Jellyfin server si sta avviando. Per favore riprova più tardi.",
"SubtitleDownloadFailureForItem": "Impossibile scaricare i sottotitoli per {0}",
- "SubtitleDownloadFailureFromForItem": "Subtitles failed to download from {0} for {1}",
+ "SubtitleDownloadFailureFromForItem": "Impossibile scaricare i sottotitoli da {0} per {1}",
"SubtitlesDownloadedForItem": "Sottotitoli scaricati per {0}",
"Sync": "Sincronizza",
"System": "Sistema",
@@ -91,7 +91,7 @@
"UserPolicyUpdatedWithName": "La politica dell'utente è stata aggiornata per {0}",
"UserStartedPlayingItemWithValues": "{0} ha avviato la riproduzione di {1}",
"UserStoppedPlayingItemWithValues": "{0} ha interrotto la riproduzione di {1}",
- "ValueHasBeenAddedToLibrary": "{0} has been added to your media library",
+ "ValueHasBeenAddedToLibrary": "{0} è stato aggiunto alla tua libreria multimediale",
"ValueSpecialEpisodeName": "Speciale - {0}",
"VersionNumber": "Versione {0}"
}
diff --git a/Emby.Server.Implementations/Localization/Core/kk.json b/Emby.Server.Implementations/Localization/Core/kk.json
index 658d168e9..23841f37d 100644
--- a/Emby.Server.Implementations/Localization/Core/kk.json
+++ b/Emby.Server.Implementations/Localization/Core/kk.json
@@ -3,15 +3,15 @@
"AppDeviceValues": "Qoldanba: {0}, Qurylǵy: {1}",
"Application": "Qoldanba",
"Artists": "Oryndaýshylar",
- "AuthenticationSucceededWithUserName": "{0} túpnusqalyǵyn rastalýy sátti",
+ "AuthenticationSucceededWithUserName": "{0} túpnusqalyq rastalýy sátti aıaqtaldy",
"Books": "Kitaptar",
- "CameraImageUploadedFrom": "Jańa sýret {0} kamerasynan júktep alyndy",
+ "CameraImageUploadedFrom": "{0} kamerasynan jańa sýret júktep alyndy",
"Channels": "Arnalar",
"ChapterNameValue": "{0}-sahna",
"Collections": "Jıyntyqtar",
"DeviceOfflineWithName": "{0} ajyratylǵan",
"DeviceOnlineWithName": "{0} qosylǵan",
- "FailedLoginAttemptWithUserName": "{0} tarapynan kirý áreketi sátsiz",
+ "FailedLoginAttemptWithUserName": "{0} tarapynan kirý áreketi sátsiz aıaqtaldy",
"Favorites": "Tańdaýlylar",
"Folders": "Qaltalar",
"Genres": "Janrlar",
@@ -28,13 +28,13 @@
"HeaderRecordingGroups": "Jazba toptary",
"HomeVideos": "Úılik beıneler",
"Inherit": "Muraǵa ıelený",
- "ItemAddedWithName": "{0} tasyǵyshhanaǵa ústelindi",
+ "ItemAddedWithName": "{0} tasyǵyshhanaǵa ústeldi",
"ItemRemovedWithName": "{0} tasyǵyshhanadan alastaldy",
"LabelIpAddressValue": "IP-mekenjaıy: {0}",
"LabelRunningTimeValue": "Oınatý ýaqyty: {0}",
"Latest": "Eń keıingi",
"MessageApplicationUpdated": "Jellyfin Serveri jańartyldy",
- "MessageApplicationUpdatedTo": "Jellyfin Serveri {0} deńgeıge jańartyldy",
+ "MessageApplicationUpdatedTo": "Jellyfin Serveri {0} nusqasyna jańartyldy",
"MessageNamedServerConfigurationUpdatedWithValue": "Server teńsheliminiń {0} bólimi jańartyldy",
"MessageServerConfigurationUpdated": "Server teńshelimi jańartyldy",
"MixedContent": "Aralas mazmun",
diff --git a/Emby.Server.Implementations/Localization/Core/pt-BR.json b/Emby.Server.Implementations/Localization/Core/pt-BR.json
index aaedf0850..dbc9c4c4b 100644
--- a/Emby.Server.Implementations/Localization/Core/pt-BR.json
+++ b/Emby.Server.Implementations/Localization/Core/pt-BR.json
@@ -5,7 +5,7 @@
"Artists": "Artistas",
"AuthenticationSucceededWithUserName": "{0} autenticado com sucesso",
"Books": "Livros",
- "CameraImageUploadedFrom": "A new camera image has been uploaded from {0}",
+ "CameraImageUploadedFrom": "Uma nova imagem da câmera foi submetida de {0}",
"Channels": "Canais",
"ChapterNameValue": "Capítulo {0}",
"Collections": "Coletâneas",
@@ -30,21 +30,21 @@
"Inherit": "Herdar",
"ItemAddedWithName": "{0} foi adicionado à biblioteca",
"ItemRemovedWithName": "{0} foi removido da biblioteca",
- "LabelIpAddressValue": "Endereço ip: {0}",
+ "LabelIpAddressValue": "Endereço IP: {0}",
"LabelRunningTimeValue": "Tempo de execução: {0}",
"Latest": "Recente",
"MessageApplicationUpdated": "O servidor Jellyfin foi atualizado",
- "MessageApplicationUpdatedTo": "Jellyfin Server has been updated to {0}",
+ "MessageApplicationUpdatedTo": "O Servidor Jellyfin foi atualizado para {0}",
"MessageNamedServerConfigurationUpdatedWithValue": "A seção {0} da configuração do servidor foi atualizada",
"MessageServerConfigurationUpdated": "A configuração do servidor foi atualizada",
"MixedContent": "Conteúdo misto",
"Movies": "Filmes",
"Music": "Música",
"MusicVideos": "Vídeos musicais",
- "NameInstallFailed": "{0} installation failed",
+ "NameInstallFailed": "A instalação de {0} falhou",
"NameSeasonNumber": "Temporada {0}",
"NameSeasonUnknown": "Temporada Desconhecida",
- "NewVersionIsAvailable": "A new version of Jellyfin Server is available for download.",
+ "NewVersionIsAvailable": "Uma nova versão do servidor Jellyfin está disponível para download.",
"NotificationOptionApplicationUpdateAvailable": "Atualização de aplicativo disponível",
"NotificationOptionApplicationUpdateInstalled": "Atualização de aplicativo instalada",
"NotificationOptionAudioPlayback": "Reprodução de áudio iniciada",
@@ -70,12 +70,12 @@
"ProviderValue": "Provedor: {0}",
"ScheduledTaskFailedWithName": "{0} falhou",
"ScheduledTaskStartedWithName": "{0} iniciada",
- "ServerNameNeedsToBeRestarted": "{0} needs to be restarted",
+ "ServerNameNeedsToBeRestarted": "O servidor {0} precisa ser reiniciado",
"Shows": "Séries",
"Songs": "Músicas",
"StartupEmbyServerIsLoading": "O Servidor Jellyfin está carregando. Por favor tente novamente em breve.",
"SubtitleDownloadFailureForItem": "Download de legendas falhou para {0}",
- "SubtitleDownloadFailureFromForItem": "Subtitles failed to download from {0} for {1}",
+ "SubtitleDownloadFailureFromForItem": "Houve um problema ao baixar as legendas de {0} para {1}",
"SubtitlesDownloadedForItem": "Legendas baixadas para {0}",
"Sync": "Sincronizar",
"System": "Sistema",
@@ -91,7 +91,7 @@
"UserPolicyUpdatedWithName": "A política de usuário foi atualizada para {0}",
"UserStartedPlayingItemWithValues": "{0} iniciou a reprodução de {1}",
"UserStoppedPlayingItemWithValues": "{0} parou de reproduzir {1}",
- "ValueHasBeenAddedToLibrary": "{0} has been added to your media library",
+ "ValueHasBeenAddedToLibrary": "{0} foi adicionado a sua biblioteca",
"ValueSpecialEpisodeName": "Especial - {0}",
"VersionNumber": "Versão {0}"
}
diff --git a/Emby.Server.Implementations/Localization/Core/sl-SI.json b/Emby.Server.Implementations/Localization/Core/sl-SI.json
index e850257d4..b50ff4706 100644
--- a/Emby.Server.Implementations/Localization/Core/sl-SI.json
+++ b/Emby.Server.Implementations/Localization/Core/sl-SI.json
@@ -1,62 +1,62 @@
{
- "Albums": "Albums",
- "AppDeviceValues": "App: {0}, Device: {1}",
- "Application": "Application",
- "Artists": "Artists",
- "AuthenticationSucceededWithUserName": "{0} successfully authenticated",
- "Books": "Books",
- "CameraImageUploadedFrom": "A new camera image has been uploaded from {0}",
- "Channels": "Channels",
- "ChapterNameValue": "Chapter {0}",
- "Collections": "Collections",
+ "Albums": "Albumi",
+ "AppDeviceValues": "Aplikacija: {0}, Naprava: {1}",
+ "Application": "Aplikacija",
+ "Artists": "Izvajalci",
+ "AuthenticationSucceededWithUserName": "{0} preverjanje uspešno",
+ "Books": "Knjige",
+ "CameraImageUploadedFrom": "Nova fotografija je bila naložena z {0}",
+ "Channels": "Kanali",
+ "ChapterNameValue": "Poglavje {0}",
+ "Collections": "Zbirke",
"DeviceOfflineWithName": "{0} has disconnected",
- "DeviceOnlineWithName": "{0} is connected",
- "FailedLoginAttemptWithUserName": "Failed login attempt from {0}",
- "Favorites": "Favorites",
- "Folders": "Folders",
- "Genres": "Genres",
- "HeaderAlbumArtists": "Album Artists",
- "HeaderCameraUploads": "Camera Uploads",
- "HeaderContinueWatching": "Continue Watching",
- "HeaderFavoriteAlbums": "Favorite Albums",
- "HeaderFavoriteArtists": "Favorite Artists",
- "HeaderFavoriteEpisodes": "Favorite Episodes",
- "HeaderFavoriteShows": "Favorite Shows",
- "HeaderFavoriteSongs": "Favorite Songs",
- "HeaderLiveTV": "Live TV",
- "HeaderNextUp": "Next Up",
- "HeaderRecordingGroups": "Recording Groups",
- "HomeVideos": "Home videos",
- "Inherit": "Inherit",
- "ItemAddedWithName": "{0} was added to the library",
- "ItemRemovedWithName": "{0} was removed from the library",
- "LabelIpAddressValue": "Ip address: {0}",
- "LabelRunningTimeValue": "Running time: {0}",
- "Latest": "Latest",
- "MessageApplicationUpdated": "Jellyfin Server has been updated",
- "MessageApplicationUpdatedTo": "Jellyfin Server has been updated to {0}",
+ "DeviceOnlineWithName": "{0} je povezan",
+ "FailedLoginAttemptWithUserName": "Neuspešen poskus prijave z {0}",
+ "Favorites": "Priljubljeni",
+ "Folders": "Mape",
+ "Genres": "Zvrsti",
+ "HeaderAlbumArtists": "Izvajalci albuma",
+ "HeaderCameraUploads": "Posnetki kamere",
+ "HeaderContinueWatching": "Nadaljuj gledanje",
+ "HeaderFavoriteAlbums": "Priljubljeni albumi",
+ "HeaderFavoriteArtists": "Priljubljeni izvajalci",
+ "HeaderFavoriteEpisodes": "Priljubljene epizode",
+ "HeaderFavoriteShows": "Priljubljene serije",
+ "HeaderFavoriteSongs": "Priljubljene pesmi",
+ "HeaderLiveTV": "TV v živo",
+ "HeaderNextUp": "Sledi",
+ "HeaderRecordingGroups": "Zbirke posnetkov",
+ "HomeVideos": "Domači posnetki",
+ "Inherit": "Podeduj",
+ "ItemAddedWithName": "{0} je dodan v knjižnico",
+ "ItemRemovedWithName": "{0} je bil odstranjen iz knjižnice",
+ "LabelIpAddressValue": "IP naslov: {0}",
+ "LabelRunningTimeValue": "Čas trajanja: {0}",
+ "Latest": "Najnovejše",
+ "MessageApplicationUpdated": "Jellyfin strežnik je bil posodobljen",
+ "MessageApplicationUpdatedTo": "Jellyfin strežnik je bil posodobljen na {0}",
"MessageNamedServerConfigurationUpdatedWithValue": "Server configuration section {0} has been updated",
- "MessageServerConfigurationUpdated": "Server configuration has been updated",
- "MixedContent": "Mixed content",
- "Movies": "Movies",
- "Music": "Music",
- "MusicVideos": "Music videos",
- "NameInstallFailed": "{0} installation failed",
- "NameSeasonNumber": "Season {0}",
- "NameSeasonUnknown": "Season Unknown",
- "NewVersionIsAvailable": "A new version of Jellyfin Server is available for download.",
- "NotificationOptionApplicationUpdateAvailable": "Application update available",
- "NotificationOptionApplicationUpdateInstalled": "Application update installed",
- "NotificationOptionAudioPlayback": "Audio playback started",
- "NotificationOptionAudioPlaybackStopped": "Audio playback stopped",
- "NotificationOptionCameraImageUploaded": "Camera image uploaded",
- "NotificationOptionInstallationFailed": "Installation failure",
- "NotificationOptionNewLibraryContent": "New content added",
- "NotificationOptionPluginError": "Plugin failure",
- "NotificationOptionPluginInstalled": "Plugin installed",
- "NotificationOptionPluginUninstalled": "Plugin uninstalled",
- "NotificationOptionPluginUpdateInstalled": "Plugin update installed",
- "NotificationOptionServerRestartRequired": "Server restart required",
+ "MessageServerConfigurationUpdated": "Nastavitve strežnika so bile posodobljene",
+ "MixedContent": "Razne vsebine",
+ "Movies": "Filmi",
+ "Music": "Glasba",
+ "MusicVideos": "Glasbeni posnetki",
+ "NameInstallFailed": "{0} namestitev neuspešna",
+ "NameSeasonNumber": "Sezona {0}",
+ "NameSeasonUnknown": "Season neznana",
+ "NewVersionIsAvailable": "Nova razničica Jellyfin strežnika je na voljo za prenos.",
+ "NotificationOptionApplicationUpdateAvailable": "Posodobitev aplikacije je na voljo",
+ "NotificationOptionApplicationUpdateInstalled": "Posodobitev aplikacije je bila nameščena",
+ "NotificationOptionAudioPlayback": "Predvajanje zvoka začeto",
+ "NotificationOptionAudioPlaybackStopped": "Predvajanje zvoka zaustavljeno",
+ "NotificationOptionCameraImageUploaded": "Posnetek kamere naložen",
+ "NotificationOptionInstallationFailed": "Napaka pri nameščanju",
+ "NotificationOptionNewLibraryContent": "Nove vsebine dodane",
+ "NotificationOptionPluginError": "Napaka dodatka",
+ "NotificationOptionPluginInstalled": "Dodatek nameščen",
+ "NotificationOptionPluginUninstalled": "Dodatek odstranjen",
+ "NotificationOptionPluginUpdateInstalled": "Posodobitev dodatka nameščena",
+ "NotificationOptionServerRestartRequired": "Potreben je ponovni zagon strežnika",
"NotificationOptionTaskFailed": "Scheduled task failure",
"NotificationOptionUserLockedOut": "User locked out",
"NotificationOptionVideoPlayback": "Video playback started",
diff --git a/Emby.Server.Implementations/Localization/Core/tr.json b/Emby.Server.Implementations/Localization/Core/tr.json
index 495f82db6..9e00eba62 100644
--- a/Emby.Server.Implementations/Localization/Core/tr.json
+++ b/Emby.Server.Implementations/Localization/Core/tr.json
@@ -1,12 +1,12 @@
{
- "Albums": "Albums",
- "AppDeviceValues": "App: {0}, Device: {1}",
- "Application": "Application",
- "Artists": "Artists",
- "AuthenticationSucceededWithUserName": "{0} successfully authenticated",
- "Books": "Books",
+ "Albums": "Albümler",
+ "AppDeviceValues": "Uygulama: {0}, Aygıt: {1}",
+ "Application": "Uygulama",
+ "Artists": "Sanatçılar",
+ "AuthenticationSucceededWithUserName": "{0} başarı ile giriş yaptı",
+ "Books": "Kitaplar",
"CameraImageUploadedFrom": "A new camera image has been uploaded from {0}",
- "Channels": "Channels",
+ "Channels": "Kanallar",
"ChapterNameValue": "Chapter {0}",
"Collections": "Collections",
"DeviceOfflineWithName": "{0} has disconnected",
@@ -17,8 +17,8 @@
"Genres": "Genres",
"HeaderAlbumArtists": "Album Artists",
"HeaderCameraUploads": "Camera Uploads",
- "HeaderContinueWatching": "Continue Watching",
- "HeaderFavoriteAlbums": "Favorite Albums",
+ "HeaderContinueWatching": "İzlemeye Devam Et",
+ "HeaderFavoriteAlbums": "Favori Albümler",
"HeaderFavoriteArtists": "Favorite Artists",
"HeaderFavoriteEpisodes": "Favorite Episodes",
"HeaderFavoriteShows": "Favori Showlar",
@@ -30,21 +30,21 @@
"Inherit": "Inherit",
"ItemAddedWithName": "{0} was added to the library",
"ItemRemovedWithName": "{0} was removed from the library",
- "LabelIpAddressValue": "Ip address: {0}",
- "LabelRunningTimeValue": "Running time: {0}",
+ "LabelIpAddressValue": "Ip adresi: {0}",
+ "LabelRunningTimeValue": "Çalışma süresi: {0}",
"Latest": "Latest",
- "MessageApplicationUpdated": "Jellyfin Server has been updated",
+ "MessageApplicationUpdated": "Jellyfin Sunucusu güncellendi",
"MessageApplicationUpdatedTo": "Jellyfin Server has been updated to {0}",
"MessageNamedServerConfigurationUpdatedWithValue": "Server configuration section {0} has been updated",
"MessageServerConfigurationUpdated": "Server configuration has been updated",
"MixedContent": "Mixed content",
"Movies": "Movies",
- "Music": "Music",
- "MusicVideos": "Music videos",
- "NameInstallFailed": "{0} installation failed",
- "NameSeasonNumber": "Season {0}",
- "NameSeasonUnknown": "Season Unknown",
- "NewVersionIsAvailable": "A new version of Jellyfin Server is available for download.",
+ "Music": "Müzik",
+ "MusicVideos": "Müzik videoları",
+ "NameInstallFailed": "{0} kurulum başarısız",
+ "NameSeasonNumber": "Sezon {0}",
+ "NameSeasonUnknown": "Bilinmeyen Sezon",
+ "NewVersionIsAvailable": "Jellyfin Sunucusunun yeni bir versiyonu indirmek için hazır.",
"NotificationOptionApplicationUpdateAvailable": "Application update available",
"NotificationOptionApplicationUpdateInstalled": "Application update installed",
"NotificationOptionAudioPlayback": "Audio playback started",
diff --git a/Emby.Server.Implementations/Localization/Core/zh-CN.json b/Emby.Server.Implementations/Localization/Core/zh-CN.json
index 8910a6bce..6f7d362d3 100644
--- a/Emby.Server.Implementations/Localization/Core/zh-CN.json
+++ b/Emby.Server.Implementations/Localization/Core/zh-CN.json
@@ -34,14 +34,14 @@
"LabelRunningTimeValue": "运行时间:{0}",
"Latest": "最新",
"MessageApplicationUpdated": "Jellyfin 服务器已更新",
- "MessageApplicationUpdatedTo": "Jellyfin Server has been updated to {0}",
+ "MessageApplicationUpdatedTo": "Jellyfin Server 的版本已更新为 {0}",
"MessageNamedServerConfigurationUpdatedWithValue": "服务器配置 {0} 部分已更新",
"MessageServerConfigurationUpdated": "服务器配置已更新",
"MixedContent": "混合内容",
"Movies": "电影",
"Music": "音乐",
"MusicVideos": "音乐视频",
- "NameInstallFailed": "{0} installation failed",
+ "NameInstallFailed": "{0} 安装失败",
"NameSeasonNumber": "季 {0}",
"NameSeasonUnknown": "未知季",
"NewVersionIsAvailable": "A new version of Jellyfin Server is available for download.",
@@ -70,7 +70,7 @@
"ProviderValue": "提供商:{0}",
"ScheduledTaskFailedWithName": "{0} 已失败",
"ScheduledTaskStartedWithName": "{0} 已开始",
- "ServerNameNeedsToBeRestarted": "{0} needs to be restarted",
+ "ServerNameNeedsToBeRestarted": "{0} 需要重新启动",
"Shows": "节目",
"Songs": "歌曲",
"StartupEmbyServerIsLoading": "Jellyfin 服务器加载中。请稍后再试。",
diff --git a/Emby.Server.Implementations/Localization/LocalizationManager.cs b/Emby.Server.Implementations/Localization/LocalizationManager.cs
index 762649b71..8c49b6405 100644
--- a/Emby.Server.Implementations/Localization/LocalizationManager.cs
+++ b/Emby.Server.Implementations/Localization/LocalizationManager.cs
@@ -11,7 +11,6 @@ using MediaBrowser.Controller.Configuration;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Extensions;
using MediaBrowser.Model.Globalization;
-using MediaBrowser.Model.IO;
using MediaBrowser.Model.Serialization;
using Microsoft.Extensions.Logging;
@@ -35,7 +34,6 @@ namespace Emby.Server.Implementations.Localization
private readonly Dictionary<string, Dictionary<string, ParentalRating>> _allParentalRatings =
new Dictionary<string, Dictionary<string, ParentalRating>>(StringComparer.OrdinalIgnoreCase);
- private readonly IFileSystem _fileSystem;
private readonly IJsonSerializer _jsonSerializer;
private readonly ILogger _logger;
private static readonly Assembly _assembly = typeof(LocalizationManager).Assembly;
@@ -44,40 +42,38 @@ namespace Emby.Server.Implementations.Localization
/// Initializes a new instance of the <see cref="LocalizationManager" /> class.
/// </summary>
/// <param name="configurationManager">The configuration manager.</param>
- /// <param name="fileSystem">The file system.</param>
/// <param name="jsonSerializer">The json serializer.</param>
+ /// <param name="loggerFactory">The logger factory</param>
public LocalizationManager(
IServerConfigurationManager configurationManager,
- IFileSystem fileSystem,
IJsonSerializer jsonSerializer,
ILoggerFactory loggerFactory)
{
_configurationManager = configurationManager;
- _fileSystem = fileSystem;
_jsonSerializer = jsonSerializer;
_logger = loggerFactory.CreateLogger(nameof(LocalizationManager));
}
public async Task LoadAll()
{
- const string ratingsResource = "Emby.Server.Implementations.Localization.Ratings.";
+ const string RatingsResource = "Emby.Server.Implementations.Localization.Ratings.";
// Extract from the assembly
foreach (var resource in _assembly.GetManifestResourceNames())
{
- if (!resource.StartsWith(ratingsResource))
+ if (!resource.StartsWith(RatingsResource, StringComparison.Ordinal))
{
continue;
}
- string countryCode = resource.Substring(ratingsResource.Length, 2);
+ string countryCode = resource.Substring(RatingsResource.Length, 2);
var dict = new Dictionary<string, ParentalRating>(StringComparer.OrdinalIgnoreCase);
using (var str = _assembly.GetManifestResourceStream(resource))
using (var reader = new StreamReader(str))
{
string line;
- while ((line = await reader.ReadLineAsync()) != null)
+ while ((line = await reader.ReadLineAsync().ConfigureAwait(false)) != null)
{
if (string.IsNullOrWhiteSpace(line))
{
@@ -102,7 +98,7 @@ namespace Emby.Server.Implementations.Localization
_allParentalRatings[countryCode] = dict;
}
- await LoadCultures();
+ await LoadCultures().ConfigureAwait(false);
}
public string NormalizeFormKD(string text)
@@ -121,14 +117,14 @@ namespace Emby.Server.Implementations.Localization
{
List<CultureDto> list = new List<CultureDto>();
- const string path = "Emby.Server.Implementations.Localization.iso6392.txt";
+ const string ResourcePath = "Emby.Server.Implementations.Localization.iso6392.txt";
- using (var stream = _assembly.GetManifestResourceStream(path))
+ using (var stream = _assembly.GetManifestResourceStream(ResourcePath))
using (var reader = new StreamReader(stream))
{
while (!reader.EndOfStream)
{
- var line = await reader.ReadLineAsync();
+ var line = await reader.ReadLineAsync().ConfigureAwait(false);
if (string.IsNullOrWhiteSpace(line))
{
@@ -154,11 +150,11 @@ namespace Emby.Server.Implementations.Localization
string[] threeletterNames;
if (string.IsNullOrWhiteSpace(parts[1]))
{
- threeletterNames = new [] { parts[0] };
+ threeletterNames = new[] { parts[0] };
}
else
{
- threeletterNames = new [] { parts[0], parts[1] };
+ threeletterNames = new[] { parts[0], parts[1] };
}
list.Add(new CultureDto
@@ -218,6 +214,7 @@ namespace Emby.Server.Implementations.Localization
/// Gets the ratings.
/// </summary>
/// <param name="countryCode">The country code.</param>
+ /// <returns>The ratings</returns>
private Dictionary<string, ParentalRating> GetRatings(string countryCode)
{
_allParentalRatings.TryGetValue(countryCode, out var value);
@@ -227,9 +224,12 @@ namespace Emby.Server.Implementations.Localization
private static readonly string[] _unratedValues = { "n/a", "unrated", "not rated" };
+ /// <inheritdoc />
/// <summary>
/// Gets the rating level.
/// </summary>
+ /// <param name="rating">Rating field</param>
+ /// <returns>The rating level</returns>&gt;
public int? GetRatingLevel(string rating)
{
if (string.IsNullOrEmpty(rating))
@@ -301,6 +301,7 @@ namespace Emby.Server.Implementations.Localization
{
culture = _configurationManager.Configuration.UICulture;
}
+
if (string.IsNullOrEmpty(culture))
{
culture = DefaultCulture;
@@ -346,8 +347,8 @@ namespace Emby.Server.Implementations.Localization
var namespaceName = GetType().Namespace + "." + prefix;
- await CopyInto(dictionary, namespaceName + "." + baseFilename);
- await CopyInto(dictionary, namespaceName + "." + GetResourceFilename(culture));
+ await CopyInto(dictionary, namespaceName + "." + baseFilename).ConfigureAwait(false);
+ await CopyInto(dictionary, namespaceName + "." + GetResourceFilename(culture)).ConfigureAwait(false);
return dictionary;
}
@@ -359,7 +360,7 @@ namespace Emby.Server.Implementations.Localization
// If a Culture doesn't have a translation the stream will be null and it defaults to en-us further up the chain
if (stream != null)
{
- var dict = await _jsonSerializer.DeserializeFromStreamAsync<Dictionary<string, string>>(stream);
+ var dict = await _jsonSerializer.DeserializeFromStreamAsync<Dictionary<string, string>>(stream).ConfigureAwait(false);
foreach (var key in dict.Keys)
{
diff --git a/Emby.Server.Implementations/Net/DisposableManagedObjectBase.cs b/Emby.Server.Implementations/Net/DisposableManagedObjectBase.cs
deleted file mode 100644
index 304b44565..000000000
--- a/Emby.Server.Implementations/Net/DisposableManagedObjectBase.cs
+++ /dev/null
@@ -1,66 +0,0 @@
-using System;
-
-namespace Emby.Server.Implementations.Net
-{
- /// <summary>
- /// Correclty implements the <see cref="IDisposable"/> interface and pattern for an object containing only managed resources, and adds a few common niceities not on the interface such as an <see cref="IsDisposed"/> property.
- /// </summary>
- public abstract class DisposableManagedObjectBase : IDisposable
- {
-
- #region Public Methods
-
- /// <summary>
- /// Override this method and dispose any objects you own the lifetime of if disposing is true;
- /// </summary>
- /// <param name="disposing">True if managed objects should be disposed, if false, only unmanaged resources should be released.</param>
- protected abstract void Dispose(bool disposing);
-
-
- //TODO Remove and reimplement using the IsDisposed property directly.
- /// <summary>
- /// Throws an <see cref="ObjectDisposedException"/> if the <see cref="IsDisposed"/> property is true.
- /// </summary>
- /// <seealso cref="IsDisposed"/>
- /// <exception cref="ObjectDisposedException">Thrown if the <see cref="IsDisposed"/> property is true.</exception>
- /// <seealso cref="Dispose()"/>
- protected virtual void ThrowIfDisposed()
- {
- if (IsDisposed) throw new ObjectDisposedException(GetType().Name);
- }
-
- #endregion
-
- #region Public Properties
-
- /// <summary>
- /// Sets or returns a boolean indicating whether or not this instance has been disposed.
- /// </summary>
- /// <seealso cref="Dispose()"/>
- public bool IsDisposed
- {
- get;
- private set;
- }
-
- #endregion
-
- #region IDisposable Members
-
- /// <summary>
- /// Disposes this object instance and all internally managed resources.
- /// </summary>
- /// <remarks>
- /// <para>Sets the <see cref="IsDisposed"/> property to true. Does not explicitly throw an exception if called multiple times, but makes no promises about behaviour of derived classes.</para>
- /// </remarks>
- /// <seealso cref="IsDisposed"/>
- public void Dispose()
- {
- IsDisposed = true;
-
- Dispose(true);
- }
-
- #endregion
- }
-}
diff --git a/Emby.Server.Implementations/Net/SocketFactory.cs b/Emby.Server.Implementations/Net/SocketFactory.cs
index 6beb14f55..492f48abe 100644
--- a/Emby.Server.Implementations/Net/SocketFactory.cs
+++ b/Emby.Server.Implementations/Net/SocketFactory.cs
@@ -4,7 +4,6 @@ using System.Net;
using System.Net.Sockets;
using Emby.Server.Implementations.Networking;
using MediaBrowser.Model.Net;
-using Microsoft.Extensions.Logging;
namespace Emby.Server.Implementations.Net
{
@@ -19,7 +18,10 @@ namespace Emby.Server.Implementations.Net
public ISocket CreateTcpSocket(IpAddressInfo remoteAddress, int remotePort)
{
- if (remotePort < 0) throw new ArgumentException("remotePort cannot be less than zero.", nameof(remotePort));
+ if (remotePort < 0)
+ {
+ throw new ArgumentException("remotePort cannot be less than zero.", nameof(remotePort));
+ }
var addressFamily = remoteAddress.AddressFamily == IpAddressFamily.InterNetwork
? AddressFamily.InterNetwork
@@ -42,8 +44,7 @@ namespace Emby.Server.Implementations.Net
}
catch
{
- if (retVal != null)
- retVal.Dispose();
+ retVal?.Dispose();
throw;
}
@@ -55,7 +56,10 @@ namespace Emby.Server.Implementations.Net
/// <param name="localPort">An integer specifying the local port to bind the acceptSocket to.</param>
public ISocket CreateUdpSocket(int localPort)
{
- if (localPort < 0) throw new ArgumentException("localPort cannot be less than zero.", nameof(localPort));
+ if (localPort < 0)
+ {
+ throw new ArgumentException("localPort cannot be less than zero.", nameof(localPort));
+ }
var retVal = new Socket(AddressFamily.InterNetwork, System.Net.Sockets.SocketType.Dgram, System.Net.Sockets.ProtocolType.Udp);
try
@@ -65,8 +69,7 @@ namespace Emby.Server.Implementations.Net
}
catch
{
- if (retVal != null)
- retVal.Dispose();
+ retVal?.Dispose();
throw;
}
@@ -74,7 +77,10 @@ namespace Emby.Server.Implementations.Net
public ISocket CreateUdpBroadcastSocket(int localPort)
{
- if (localPort < 0) throw new ArgumentException("localPort cannot be less than zero.", nameof(localPort));
+ if (localPort < 0)
+ {
+ throw new ArgumentException("localPort cannot be less than zero.", nameof(localPort));
+ }
var retVal = new Socket(AddressFamily.InterNetwork, System.Net.Sockets.SocketType.Dgram, System.Net.Sockets.ProtocolType.Udp);
try
@@ -86,8 +92,7 @@ namespace Emby.Server.Implementations.Net
}
catch
{
- if (retVal != null)
- retVal.Dispose();
+ retVal?.Dispose();
throw;
}
@@ -99,7 +104,10 @@ namespace Emby.Server.Implementations.Net
/// <returns>An implementation of the <see cref="ISocket"/> interface used by RSSDP components to perform acceptSocket operations.</returns>
public ISocket CreateSsdpUdpSocket(IpAddressInfo localIpAddress, int localPort)
{
- if (localPort < 0) throw new ArgumentException("localPort cannot be less than zero.", nameof(localPort));
+ if (localPort < 0)
+ {
+ throw new ArgumentException("localPort cannot be less than zero.", nameof(localPort));
+ }
var retVal = new Socket(AddressFamily.InterNetwork, System.Net.Sockets.SocketType.Dgram, System.Net.Sockets.ProtocolType.Udp);
try
@@ -114,8 +122,7 @@ namespace Emby.Server.Implementations.Net
}
catch
{
- if (retVal != null)
- retVal.Dispose();
+ retVal?.Dispose();
throw;
}
@@ -130,10 +137,25 @@ namespace Emby.Server.Implementations.Net
/// <returns></returns>
public ISocket CreateUdpMulticastSocket(string ipAddress, int multicastTimeToLive, int localPort)
{
- if (ipAddress == null) throw new ArgumentNullException(nameof(ipAddress));
- if (ipAddress.Length == 0) throw new ArgumentException("ipAddress cannot be an empty string.", nameof(ipAddress));
- if (multicastTimeToLive <= 0) throw new ArgumentException("multicastTimeToLive cannot be zero or less.", nameof(multicastTimeToLive));
- if (localPort < 0) throw new ArgumentException("localPort cannot be less than zero.", nameof(localPort));
+ if (ipAddress == null)
+ {
+ throw new ArgumentNullException(nameof(ipAddress));
+ }
+
+ if (ipAddress.Length == 0)
+ {
+ throw new ArgumentException("ipAddress cannot be an empty string.", nameof(ipAddress));
+ }
+
+ if (multicastTimeToLive <= 0)
+ {
+ throw new ArgumentException("multicastTimeToLive cannot be zero or less.", nameof(multicastTimeToLive));
+ }
+
+ if (localPort < 0)
+ {
+ throw new ArgumentException("localPort cannot be less than zero.", nameof(localPort));
+ }
var retVal = new Socket(AddressFamily.InterNetwork, System.Net.Sockets.SocketType.Dgram, System.Net.Sockets.ProtocolType.Udp);
@@ -172,87 +194,13 @@ namespace Emby.Server.Implementations.Net
}
catch
{
- if (retVal != null)
- retVal.Dispose();
+ retVal?.Dispose();
throw;
}
}
public Stream CreateNetworkStream(ISocket socket, bool ownsSocket)
- {
- var netSocket = (UdpSocket)socket;
-
- return new SocketStream(netSocket.Socket, ownsSocket);
- }
+ => new NetworkStream(((UdpSocket)socket).Socket, ownsSocket);
}
-
- public class SocketStream : Stream
- {
- private readonly Socket _socket;
-
- public SocketStream(Socket socket, bool ownsSocket)
- {
- _socket = socket;
- }
-
- public override void Flush()
- {
- }
-
- public override bool CanRead => true;
-
- public override bool CanSeek => false;
-
- public override bool CanWrite => true;
-
- public override long Length => throw new NotImplementedException();
-
- public override long Position
- {
- get => throw new NotImplementedException();
- set => throw new NotImplementedException();
- }
-
- public override void Write(byte[] buffer, int offset, int count)
- {
- _socket.Send(buffer, offset, count, SocketFlags.None);
- }
-
- public override IAsyncResult BeginWrite(byte[] buffer, int offset, int count, AsyncCallback callback, object state)
- {
- return _socket.BeginSend(buffer, offset, count, SocketFlags.None, callback, state);
- }
-
- public override void EndWrite(IAsyncResult asyncResult)
- {
- _socket.EndSend(asyncResult);
- }
-
- public override void SetLength(long value)
- {
- throw new NotImplementedException();
- }
-
- public override long Seek(long offset, SeekOrigin origin)
- {
- throw new NotImplementedException();
- }
-
- public override int Read(byte[] buffer, int offset, int count)
- {
- return _socket.Receive(buffer, offset, count, SocketFlags.None);
- }
-
- public override IAsyncResult BeginRead(byte[] buffer, int offset, int count, AsyncCallback callback, object state)
- {
- return _socket.BeginReceive(buffer, offset, count, SocketFlags.None, callback, state);
- }
-
- public override int EndRead(IAsyncResult asyncResult)
- {
- return _socket.EndReceive(asyncResult);
- }
- }
-
}
diff --git a/Emby.Server.Implementations/Net/UdpSocket.cs b/Emby.Server.Implementations/Net/UdpSocket.cs
index d48855486..6c55085c8 100644
--- a/Emby.Server.Implementations/Net/UdpSocket.cs
+++ b/Emby.Server.Implementations/Net/UdpSocket.cs
@@ -11,12 +11,15 @@ namespace Emby.Server.Implementations.Net
// THIS IS A LINKED FILE - SHARED AMONGST MULTIPLE PLATFORMS
// Be careful to check any changes compile and work for all platform projects it is shared in.
- public sealed class UdpSocket : DisposableManagedObjectBase, ISocket
+ public sealed class UdpSocket : ISocket, IDisposable
{
- private Socket _Socket;
- private int _LocalPort;
+ private Socket _socket;
+ private int _localPort;
+ private bool _disposed = false;
- public Socket Socket => _Socket;
+ public Socket Socket => _socket;
+
+ public IpAddressInfo LocalIPAddress { get; }
private readonly SocketAsyncEventArgs _receiveSocketAsyncEventArgs = new SocketAsyncEventArgs()
{
@@ -35,11 +38,11 @@ namespace Emby.Server.Implementations.Net
{
if (socket == null) throw new ArgumentNullException(nameof(socket));
- _Socket = socket;
- _LocalPort = localPort;
+ _socket = socket;
+ _localPort = localPort;
LocalIPAddress = NetworkManager.ToIpAddressInfo(ip);
- _Socket.Bind(new IPEndPoint(ip, _LocalPort));
+ _socket.Bind(new IPEndPoint(ip, _localPort));
InitReceiveSocketAsyncEventArgs();
}
@@ -101,32 +104,26 @@ namespace Emby.Server.Implementations.Net
{
if (socket == null) throw new ArgumentNullException(nameof(socket));
- _Socket = socket;
- _Socket.Connect(NetworkManager.ToIPEndPoint(endPoint));
+ _socket = socket;
+ _socket.Connect(NetworkManager.ToIPEndPoint(endPoint));
InitReceiveSocketAsyncEventArgs();
}
- public IpAddressInfo LocalIPAddress
- {
- get;
- private set;
- }
-
public IAsyncResult BeginReceive(byte[] buffer, int offset, int count, AsyncCallback callback)
{
ThrowIfDisposed();
EndPoint receivedFromEndPoint = new IPEndPoint(IPAddress.Any, 0);
- return _Socket.BeginReceiveFrom(buffer, offset, count, SocketFlags.None, ref receivedFromEndPoint, callback, buffer);
+ return _socket.BeginReceiveFrom(buffer, offset, count, SocketFlags.None, ref receivedFromEndPoint, callback, buffer);
}
public int Receive(byte[] buffer, int offset, int count)
{
ThrowIfDisposed();
- return _Socket.Receive(buffer, 0, buffer.Length, SocketFlags.None);
+ return _socket.Receive(buffer, 0, buffer.Length, SocketFlags.None);
}
public SocketReceiveResult EndReceive(IAsyncResult result)
@@ -136,7 +133,7 @@ namespace Emby.Server.Implementations.Net
var sender = new IPEndPoint(IPAddress.Any, 0);
var remoteEndPoint = (EndPoint)sender;
- var receivedBytes = _Socket.EndReceiveFrom(result, ref remoteEndPoint);
+ var receivedBytes = _socket.EndReceiveFrom(result, ref remoteEndPoint);
var buffer = (byte[])result.AsyncState;
@@ -236,35 +233,40 @@ namespace Emby.Server.Implementations.Net
var ipEndPoint = NetworkManager.ToIPEndPoint(endPoint);
- return _Socket.BeginSendTo(buffer, offset, size, SocketFlags.None, ipEndPoint, callback, state);
+ return _socket.BeginSendTo(buffer, offset, size, SocketFlags.None, ipEndPoint, callback, state);
}
public int EndSendTo(IAsyncResult result)
{
ThrowIfDisposed();
- return _Socket.EndSendTo(result);
+ return _socket.EndSendTo(result);
}
- protected override void Dispose(bool disposing)
+ private void ThrowIfDisposed()
{
- if (disposing)
+ if (_disposed)
{
- var socket = _Socket;
- if (socket != null)
- socket.Dispose();
+ throw new ObjectDisposedException(nameof(UdpSocket));
+ }
+ }
- var tcs = _currentReceiveTaskCompletionSource;
- if (tcs != null)
- {
- tcs.TrySetCanceled();
- }
- var sendTcs = _currentSendTaskCompletionSource;
- if (sendTcs != null)
- {
- sendTcs.TrySetCanceled();
- }
+ public void Dispose()
+ {
+ if (_disposed)
+ {
+ return;
}
+
+ _socket?.Dispose();
+ _currentReceiveTaskCompletionSource?.TrySetCanceled();
+ _currentSendTaskCompletionSource?.TrySetCanceled();
+
+ _socket = null;
+ _currentReceiveTaskCompletionSource = null;
+ _currentSendTaskCompletionSource = null;
+
+ _disposed = true;
}
private static IpEndPointInfo ToIpEndPointInfo(IPEndPoint endpoint)
diff --git a/Emby.Server.Implementations/Networking/NetworkManager.cs b/Emby.Server.Implementations/Networking/NetworkManager.cs
index ace93ebde..c102f9eb5 100644
--- a/Emby.Server.Implementations/Networking/NetworkManager.cs
+++ b/Emby.Server.Implementations/Networking/NetworkManager.cs
@@ -7,11 +7,11 @@ using System.Net.NetworkInformation;
using System.Net.Sockets;
using System.Threading.Tasks;
using MediaBrowser.Common.Net;
-using MediaBrowser.Model.Extensions;
using MediaBrowser.Model.IO;
using MediaBrowser.Model.Net;
using MediaBrowser.Model.System;
using Microsoft.Extensions.Logging;
+using OperatingSystem = MediaBrowser.Common.System.OperatingSystem;
namespace Emby.Server.Implementations.Networking
{
@@ -22,14 +22,12 @@ namespace Emby.Server.Implementations.Networking
public event EventHandler NetworkChanged;
public Func<string[]> LocalSubnetsFn { get; set; }
- public NetworkManager(
- ILoggerFactory loggerFactory,
- IEnvironmentInfo environment)
+ public NetworkManager(ILoggerFactory loggerFactory)
{
Logger = loggerFactory.CreateLogger(nameof(NetworkManager));
// In FreeBSD these events cause a crash
- if (environment.OperatingSystem != MediaBrowser.Model.System.OperatingSystem.BSD)
+ if (OperatingSystem.Id != OperatingSystemId.BSD)
{
try
{
diff --git a/Emby.Server.Implementations/Properties/AssemblyInfo.cs b/Emby.Server.Implementations/Properties/AssemblyInfo.cs
index 79ba9374c..a1933f66e 100644
--- a/Emby.Server.Implementations/Properties/AssemblyInfo.cs
+++ b/Emby.Server.Implementations/Properties/AssemblyInfo.cs
@@ -10,7 +10,7 @@ using System.Runtime.InteropServices;
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Jellyfin Project")]
[assembly: AssemblyProduct("Jellyfin Server")]
-[assembly: AssemblyCopyright("Copyright © 2019 Jellyfin Contributors. Code released under the GNU General Public License Version 2")]
+[assembly: AssemblyCopyright("Copyright © 2019 Jellyfin Contributors. Code released under the GNU General Public License")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: NeutralResourcesLanguage("en")]
diff --git a/Emby.Server.Implementations/Reflection/AssemblyInfo.cs b/Emby.Server.Implementations/Reflection/AssemblyInfo.cs
deleted file mode 100644
index 9d16fe43f..000000000
--- a/Emby.Server.Implementations/Reflection/AssemblyInfo.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-using System;
-using System.IO;
-using System.Reflection;
-using MediaBrowser.Model.Reflection;
-
-namespace Emby.Server.Implementations.Reflection
-{
- public class AssemblyInfo : IAssemblyInfo
- {
- public Stream GetManifestResourceStream(Type type, string resource)
- {
- return type.Assembly.GetManifestResourceStream(resource);
- }
-
- public string[] GetManifestResourceNames(Type type)
- {
- return type.Assembly.GetManifestResourceNames();
- }
-
- public Assembly[] GetCurrentAssemblies()
- {
- return AppDomain.CurrentDomain.GetAssemblies();
- }
- }
-}
diff --git a/Emby.Server.Implementations/ServerApplicationPaths.cs b/Emby.Server.Implementations/ServerApplicationPaths.cs
index 05f6469ec..adaf23234 100644
--- a/Emby.Server.Implementations/ServerApplicationPaths.cs
+++ b/Emby.Server.Implementations/ServerApplicationPaths.cs
@@ -17,11 +17,13 @@ namespace Emby.Server.Implementations
string programDataPath,
string logDirectoryPath,
string configurationDirectoryPath,
- string cacheDirectoryPath)
+ string cacheDirectoryPath,
+ string webDirectoryPath)
: base(programDataPath,
logDirectoryPath,
configurationDirectoryPath,
- cacheDirectoryPath)
+ cacheDirectoryPath,
+ webDirectoryPath)
{
}
diff --git a/Emby.Server.Implementations/Session/SessionManager.cs b/Emby.Server.Implementations/Session/SessionManager.cs
index 03e7b2654..985748caf 100644
--- a/Emby.Server.Implementations/Session/SessionManager.cs
+++ b/Emby.Server.Implementations/Session/SessionManager.cs
@@ -116,14 +116,14 @@ namespace Emby.Server.Implementations.Session
_authRepo = authRepo;
_deviceManager = deviceManager;
_mediaSourceManager = mediaSourceManager;
- _deviceManager.DeviceOptionsUpdated += _deviceManager_DeviceOptionsUpdated;
+ _deviceManager.DeviceOptionsUpdated += OnDeviceManagerDeviceOptionsUpdated;
}
- private void _deviceManager_DeviceOptionsUpdated(object sender, GenericEventArgs<Tuple<string, DeviceOptions>> e)
+ private void OnDeviceManagerDeviceOptionsUpdated(object sender, GenericEventArgs<Tuple<string, DeviceOptions>> e)
{
foreach (var session in Sessions)
{
- if (string.Equals(session.DeviceId, e.Argument.Item1))
+ if (string.Equals(session.DeviceId, e.Argument.Item1, StringComparison.Ordinal))
{
if (!string.IsNullOrWhiteSpace(e.Argument.Item2.CustomName))
{
@@ -138,11 +138,29 @@ namespace Emby.Server.Implementations.Session
}
}
- private bool _disposed;
+ private bool _disposed = false;
+
public void Dispose()
{
+ Dispose(true);
+ GC.SuppressFinalize(this);
+ }
+
+ protected virtual void Dispose(bool disposing)
+ {
+ if (_disposed)
+ {
+ return;
+ }
+
+ if (disposing)
+ {
+ // TODO: dispose stuff
+ }
+
+ _deviceManager.DeviceOptionsUpdated -= OnDeviceManagerDeviceOptionsUpdated;
+
_disposed = true;
- _deviceManager.DeviceOptionsUpdated -= _deviceManager_DeviceOptionsUpdated;
}
public void CheckDisposed()
@@ -157,7 +175,7 @@ namespace Emby.Server.Implementations.Session
/// Gets all connections.
/// </summary>
/// <value>All connections.</value>
- public IEnumerable<SessionInfo> Sessions => _activeConnections.Values.OrderByDescending(c => c.LastActivityDate).ToList();
+ public IEnumerable<SessionInfo> Sessions => _activeConnections.Values.OrderByDescending(c => c.LastActivityDate);
private void OnSessionStarted(SessionInfo info)
{
@@ -171,20 +189,27 @@ namespace Emby.Server.Implementations.Session
}
}
- EventHelper.QueueEventIfNotNull(SessionStarted, this, new SessionEventArgs
- {
- SessionInfo = info
-
- }, _logger);
+ EventHelper.QueueEventIfNotNull(
+ SessionStarted,
+ this,
+ new SessionEventArgs
+ {
+ SessionInfo = info
+ },
+ _logger);
}
private void OnSessionEnded(SessionInfo info)
{
- EventHelper.QueueEventIfNotNull(SessionEnded, this, new SessionEventArgs
- {
- SessionInfo = info
+ EventHelper.QueueEventIfNotNull(
+ SessionEnded,
+ this,
+ new SessionEventArgs
+ {
+ SessionInfo = info
- }, _logger);
+ },
+ _logger);
info.Dispose();
}
@@ -192,9 +217,6 @@ namespace Emby.Server.Implementations.Session
public void UpdateDeviceName(string sessionId, string deviceName)
{
var session = GetSession(sessionId);
-
- var key = GetSessionKey(session.Client, session.DeviceId);
-
if (session != null)
{
session.DeviceName = deviceName;
@@ -210,10 +232,10 @@ namespace Emby.Server.Implementations.Session
/// <param name="deviceName">Name of the device.</param>
/// <param name="remoteEndPoint">The remote end point.</param>
/// <param name="user">The user.</param>
- /// <returns>Task.</returns>
+ /// <returns>SessionInfo.</returns>
/// <exception cref="ArgumentNullException">user</exception>
- /// <exception cref="UnauthorizedAccessException"></exception>
- public SessionInfo LogSessionActivity(string appName,
+ public SessionInfo LogSessionActivity(
+ string appName,
string appVersion,
string deviceId,
string deviceName,
@@ -226,10 +248,12 @@ namespace Emby.Server.Implementations.Session
{
throw new ArgumentNullException(nameof(appName));
}
+
if (string.IsNullOrEmpty(appVersion))
{
throw new ArgumentNullException(nameof(appVersion));
}
+
if (string.IsNullOrEmpty(deviceId))
{
throw new ArgumentNullException(nameof(deviceId));
@@ -260,10 +284,12 @@ namespace Emby.Server.Implementations.Session
if ((activityDate - lastActivityDate).TotalSeconds > 10)
{
- SessionActivity?.Invoke(this, new SessionEventArgs
- {
- SessionInfo = session
- });
+ SessionActivity?.Invoke(
+ this,
+ new SessionEventArgs
+ {
+ SessionInfo = session
+ });
}
return session;
@@ -304,6 +330,7 @@ namespace Emby.Server.Implementations.Session
/// <summary>
/// Updates the now playing item id.
/// </summary>
+ /// <returns>Task.</returns>
private async Task UpdateNowPlayingItem(SessionInfo session, PlaybackProgressInfo info, BaseItem libraryItem, bool updateLastCheckInTime)
{
if (string.IsNullOrEmpty(info.MediaSourceId))
@@ -418,7 +445,7 @@ namespace Emby.Server.Implementations.Session
});
sessionInfo.UserId = user == null ? Guid.Empty : user.Id;
- sessionInfo.UserName = user == null ? null : user.Name;
+ sessionInfo.UserName = user?.Name;
sessionInfo.UserPrimaryImageTag = user == null ? null : GetImageCacheTag(user, ImageType.Primary);
sessionInfo.RemoteEndPoint = remoteEndPoint;
sessionInfo.Client = appName;
@@ -432,7 +459,7 @@ namespace Emby.Server.Implementations.Session
if (user == null)
{
- sessionInfo.AdditionalUsers = new SessionUserInfo[] { };
+ sessionInfo.AdditionalUsers = Array.Empty<SessionUserInfo>();
}
return sessionInfo;
@@ -449,9 +476,9 @@ namespace Emby.Server.Implementations.Session
ServerId = _appHost.SystemId
};
- var username = user == null ? null : user.Name;
+ var username = user?.Name;
- sessionInfo.UserId = user == null ? Guid.Empty : user.Id;
+ sessionInfo.UserId = user?.Id ?? Guid.Empty;
sessionInfo.UserName = username;
sessionInfo.UserPrimaryImageTag = user == null ? null : GetImageCacheTag(user, ImageType.Primary);
sessionInfo.RemoteEndPoint = remoteEndPoint;
@@ -508,6 +535,7 @@ namespace Emby.Server.Implementations.Session
_idleTimer = new Timer(CheckForIdlePlayback, null, TimeSpan.FromMinutes(5), TimeSpan.FromMinutes(5));
}
}
+
private void StopIdleCheckTimer()
{
if (_idleTimer != null)
@@ -539,9 +567,9 @@ namespace Emby.Server.Implementations.Session
Item = session.NowPlayingItem,
ItemId = session.NowPlayingItem == null ? Guid.Empty : session.NowPlayingItem.Id,
SessionId = session.Id,
- MediaSourceId = session.PlayState == null ? null : session.PlayState.MediaSourceId,
- PositionTicks = session.PlayState == null ? null : session.PlayState.PositionTicks
- });
+ MediaSourceId = session.PlayState?.MediaSourceId,
+ PositionTicks = session.PlayState?.PositionTicks
+ }).ConfigureAwait(false);
}
catch (Exception ex)
{
@@ -616,18 +644,22 @@ namespace Emby.Server.Implementations.Session
// Nothing to save here
// Fire events to inform plugins
- EventHelper.QueueEventIfNotNull(PlaybackStart, this, new PlaybackProgressEventArgs
- {
- Item = libraryItem,
- Users = users,
- MediaSourceId = info.MediaSourceId,
- MediaInfo = info.Item,
- DeviceName = session.DeviceName,
- ClientName = session.Client,
- DeviceId = session.DeviceId,
- Session = session
-
- }, _logger);
+ EventHelper.QueueEventIfNotNull(
+ PlaybackStart,
+ this,
+ new PlaybackProgressEventArgs
+ {
+ Item = libraryItem,
+ Users = users,
+ MediaSourceId = info.MediaSourceId,
+ MediaInfo = info.Item,
+ DeviceName = session.DeviceName,
+ ClientName = session.Client,
+ DeviceId = session.DeviceId,
+ Session = session
+
+ },
+ _logger);
StartIdleCheckTimer();
}
@@ -667,6 +699,7 @@ namespace Emby.Server.Implementations.Session
/// <summary>
/// Used to report playback progress for an item
/// </summary>
+ /// <returns>Task.</returns>
public async Task OnPlaybackProgress(PlaybackProgressInfo info, bool isAutomated)
{
CheckDisposed();
@@ -695,21 +728,23 @@ namespace Emby.Server.Implementations.Session
}
}
- PlaybackProgress?.Invoke(this, new PlaybackProgressEventArgs
- {
- Item = libraryItem,
- Users = users,
- PlaybackPositionTicks = session.PlayState.PositionTicks,
- MediaSourceId = session.PlayState.MediaSourceId,
- MediaInfo = info.Item,
- DeviceName = session.DeviceName,
- ClientName = session.Client,
- DeviceId = session.DeviceId,
- IsPaused = info.IsPaused,
- PlaySessionId = info.PlaySessionId,
- IsAutomated = isAutomated,
- Session = session
- });
+ PlaybackProgress?.Invoke(
+ this,
+ new PlaybackProgressEventArgs
+ {
+ Item = libraryItem,
+ Users = users,
+ PlaybackPositionTicks = session.PlayState.PositionTicks,
+ MediaSourceId = session.PlayState.MediaSourceId,
+ MediaInfo = info.Item,
+ DeviceName = session.DeviceName,
+ ClientName = session.Client,
+ DeviceId = session.DeviceId,
+ IsPaused = info.IsPaused,
+ PlaySessionId = info.PlaySessionId,
+ IsAutomated = isAutomated,
+ Session = session
+ });
if (!isAutomated)
{
@@ -830,8 +865,7 @@ namespace Emby.Server.Implementations.Session
{
MediaSourceInfo mediaSource = null;
- var hasMediaSources = libraryItem as IHasMediaSources;
- if (hasMediaSources != null)
+ if (libraryItem is IHasMediaSources hasMediaSources)
{
mediaSource = await GetMediaSource(libraryItem, info.MediaSourceId, info.LiveStreamId).ConfigureAwait(false);
}
@@ -848,7 +882,8 @@ namespace Emby.Server.Implementations.Session
{
var msString = info.PositionTicks.HasValue ? (info.PositionTicks.Value / 10000).ToString(CultureInfo.InvariantCulture) : "unknown";
- _logger.LogInformation("Playback stopped reported by app {0} {1} playing {2}. Stopped at {3} ms",
+ _logger.LogInformation(
+ "Playback stopped reported by app {0} {1} playing {2}. Stopped at {3} ms",
session.Client,
session.ApplicationVersion,
info.Item.Name,
@@ -887,20 +922,24 @@ namespace Emby.Server.Implementations.Session
}
}
- EventHelper.QueueEventIfNotNull(PlaybackStopped, this, new PlaybackStopEventArgs
- {
- Item = libraryItem,
- Users = users,
- PlaybackPositionTicks = info.PositionTicks,
- PlayedToCompletion = playedToCompletion,
- MediaSourceId = info.MediaSourceId,
- MediaInfo = info.Item,
- DeviceName = session.DeviceName,
- ClientName = session.Client,
- DeviceId = session.DeviceId,
- Session = session
+ EventHelper.QueueEventIfNotNull(
+ PlaybackStopped,
+ this,
+ new PlaybackStopEventArgs
+ {
+ Item = libraryItem,
+ Users = users,
+ PlaybackPositionTicks = info.PositionTicks,
+ PlayedToCompletion = playedToCompletion,
+ MediaSourceId = info.MediaSourceId,
+ MediaInfo = info.Item,
+ DeviceName = session.DeviceName,
+ ClientName = session.Client,
+ DeviceId = session.DeviceId,
+ Session = session
- }, _logger);
+ },
+ _logger);
}
private bool OnPlaybackStopped(User user, BaseItem item, long? positionTicks, bool playbackFailed)
@@ -936,11 +975,10 @@ namespace Emby.Server.Implementations.Session
/// <param name="sessionId">The session identifier.</param>
/// <param name="throwOnMissing">if set to <c>true</c> [throw on missing].</param>
/// <returns>SessionInfo.</returns>
- /// <exception cref="ResourceNotFoundException"></exception>
+ /// <exception cref="ResourceNotFoundException">sessionId</exception>
private SessionInfo GetSession(string sessionId, bool throwOnMissing = true)
{
- var session = Sessions.FirstOrDefault(i => string.Equals(i.Id, sessionId));
-
+ var session = Sessions.FirstOrDefault(i => string.Equals(i.Id, sessionId, StringComparison.Ordinal));
if (session == null && throwOnMissing)
{
throw new ResourceNotFoundException(string.Format("Session {0} not found.", sessionId));
@@ -952,7 +990,7 @@ namespace Emby.Server.Implementations.Session
private SessionInfo GetSessionToRemoteControl(string sessionId)
{
// Accept either device id or session id
- var session = Sessions.FirstOrDefault(i => string.Equals(i.Id, sessionId));
+ var session = Sessions.FirstOrDefault(i => string.Equals(i.Id, sessionId, StringComparison.Ordinal));
if (session == null)
{
@@ -1061,10 +1099,12 @@ namespace Emby.Server.Implementations.Session
var series = episode.Series;
if (series != null)
{
- var episodes = series.GetEpisodes(user, new DtoOptions(false)
- {
- EnableImages = false
- })
+ var episodes = series.GetEpisodes(
+ user,
+ new DtoOptions(false)
+ {
+ EnableImages = false
+ })
.Where(i => !i.IsVirtualItem)
.SkipWhile(i => i.Id != episode.Id)
.ToList();
@@ -1100,9 +1140,7 @@ namespace Emby.Server.Implementations.Session
return new List<BaseItem>();
}
- var byName = item as IItemByName;
-
- if (byName != null)
+ if (item is IItemByName byName)
{
return byName.GetTaggedItems(new InternalItemsQuery(user)
{
@@ -1152,7 +1190,7 @@ namespace Emby.Server.Implementations.Session
if (item == null)
{
- _logger.LogError("A non-existant item Id {0} was passed into TranslateItemForInstantMix", id);
+ _logger.LogError("A non-existent item Id {0} was passed into TranslateItemForInstantMix", id);
return new List<BaseItem>();
}
@@ -1163,13 +1201,15 @@ namespace Emby.Server.Implementations.Session
{
var generalCommand = new GeneralCommand
{
- Name = GeneralCommandType.DisplayContent.ToString()
+ Name = GeneralCommandType.DisplayContent.ToString(),
+ Arguments =
+ {
+ ["ItemId"] = command.ItemId,
+ ["ItemName"] = command.ItemName,
+ ["ItemType"] = command.ItemType
+ }
};
- generalCommand.Arguments["ItemId"] = command.ItemId;
- generalCommand.Arguments["ItemName"] = command.ItemName;
- generalCommand.Arguments["ItemType"] = command.ItemType;
-
return SendGeneralCommand(controllingSessionId, sessionId, generalCommand, cancellationToken);
}
@@ -1410,7 +1450,8 @@ namespace Emby.Server.Implementations.Session
var token = GetAuthorizationToken(user, request.DeviceId, request.App, request.AppVersion, request.DeviceName);
- var session = LogSessionActivity(request.App,
+ var session = LogSessionActivity(
+ request.App,
request.AppVersion,
request.DeviceId,
request.DeviceName,
@@ -1454,9 +1495,9 @@ namespace Emby.Server.Implementations.Session
{
Logout(auth);
}
- catch
+ catch (Exception ex)
{
-
+ _logger.LogError(ex, "Error while logging out.");
}
}
}
@@ -1572,7 +1613,8 @@ namespace Emby.Server.Implementations.Session
ReportCapabilities(session, capabilities, true);
}
- private void ReportCapabilities(SessionInfo session,
+ private void ReportCapabilities(
+ SessionInfo session,
ClientCapabilities capabilities,
bool saveCapabilities)
{
@@ -1580,10 +1622,12 @@ namespace Emby.Server.Implementations.Session
if (saveCapabilities)
{
- CapabilitiesChanged?.Invoke(this, new SessionEventArgs
- {
- SessionInfo = session
- });
+ CapabilitiesChanged?.Invoke(
+ this,
+ new SessionEventArgs
+ {
+ SessionInfo = session
+ });
try
{
diff --git a/Emby.Server.Implementations/SocketSharp/HttpPostedFile.cs b/Emby.Server.Implementations/SocketSharp/HttpPostedFile.cs
index f38ed848e..95b7912fb 100644
--- a/Emby.Server.Implementations/SocketSharp/HttpPostedFile.cs
+++ b/Emby.Server.Implementations/SocketSharp/HttpPostedFile.cs
@@ -63,6 +63,28 @@ public sealed class HttpPostedFile : IDisposable
_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()
{
}
@@ -178,27 +200,5 @@ public sealed class HttpPostedFile : IDisposable
{
throw new NotSupportedException();
}
-
- 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);
- }
- }
}
}
diff --git a/Emby.Server.Implementations/Sorting/AlbumArtistComparer.cs b/Emby.Server.Implementations/Sorting/AlbumArtistComparer.cs
index 535f123f9..0804b01fc 100644
--- a/Emby.Server.Implementations/Sorting/AlbumArtistComparer.cs
+++ b/Emby.Server.Implementations/Sorting/AlbumArtistComparer.cs
@@ -32,7 +32,7 @@ namespace Emby.Server.Implementations.Sorting
{
var audio = x as IHasAlbumArtist;
- return audio != null ? audio.AlbumArtists.FirstOrDefault() : null;
+ return audio?.AlbumArtists.FirstOrDefault();
}
/// <summary>
diff --git a/Emby.Server.Implementations/Sorting/SeriesSortNameComparer.cs b/Emby.Server.Implementations/Sorting/SeriesSortNameComparer.cs
index 46e0dd918..504b6d283 100644
--- a/Emby.Server.Implementations/Sorting/SeriesSortNameComparer.cs
+++ b/Emby.Server.Implementations/Sorting/SeriesSortNameComparer.cs
@@ -18,17 +18,17 @@ namespace Emby.Server.Implementations.Sorting
return string.Compare(GetValue(x), GetValue(y), StringComparison.CurrentCultureIgnoreCase);
}
- private static string GetValue(BaseItem item)
- {
- var hasSeries = item as IHasSeries;
-
- return hasSeries != null ? hasSeries.FindSeriesSortName() : null;
- }
-
/// <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;
+
+ return hasSeries?.FindSeriesSortName();
+ }
}
}
diff --git a/Emby.Server.Implementations/Updates/InstallationManager.cs b/Emby.Server.Implementations/Updates/InstallationManager.cs
index 301802b8a..7310de55d 100644
--- a/Emby.Server.Implementations/Updates/InstallationManager.cs
+++ b/Emby.Server.Implementations/Updates/InstallationManager.cs
@@ -12,7 +12,6 @@ using MediaBrowser.Common.Plugins;
using MediaBrowser.Common.Progress;
using MediaBrowser.Common.Updates;
using MediaBrowser.Controller.Configuration;
-using MediaBrowser.Model.Cryptography;
using MediaBrowser.Model.Events;
using MediaBrowser.Model.IO;
using MediaBrowser.Model.Serialization;
@@ -39,11 +38,10 @@ namespace Emby.Server.Implementations.Updates
/// <summary>
/// The completed installations
/// </summary>
- private ConcurrentBag<InstallationInfo> CompletedInstallationsInternal { get; set; }
+ private ConcurrentBag<InstallationInfo> _completedInstallationsInternal;
- public IEnumerable<InstallationInfo> CompletedInstallations => CompletedInstallationsInternal;
+ public IEnumerable<InstallationInfo> CompletedInstallations => _completedInstallationsInternal;
- #region PluginUninstalled Event
/// <summary>
/// Occurs when [plugin uninstalled].
/// </summary>
@@ -57,9 +55,7 @@ namespace Emby.Server.Implementations.Updates
{
PluginUninstalled?.Invoke(this, new GenericEventArgs<IPlugin> { Argument = plugin });
}
- #endregion
- #region PluginUpdated Event
/// <summary>
/// Occurs when [plugin updated].
/// </summary>
@@ -77,9 +73,7 @@ namespace Emby.Server.Implementations.Updates
_applicationHost.NotifyPendingRestart();
}
- #endregion
- #region PluginInstalled Event
/// <summary>
/// Occurs when [plugin updated].
/// </summary>
@@ -96,7 +90,6 @@ namespace Emby.Server.Implementations.Updates
_applicationHost.NotifyPendingRestart();
}
- #endregion
/// <summary>
/// The _logger
@@ -115,12 +108,8 @@ namespace Emby.Server.Implementations.Updates
/// <value>The application host.</value>
private readonly IApplicationHost _applicationHost;
- private readonly ICryptoProvider _cryptographyProvider;
private readonly IZipClient _zipClient;
- // netframework or netcore
- private readonly string _packageRuntime;
-
public InstallationManager(
ILoggerFactory loggerFactory,
IApplicationHost appHost,
@@ -129,9 +118,7 @@ namespace Emby.Server.Implementations.Updates
IJsonSerializer jsonSerializer,
IServerConfigurationManager config,
IFileSystem fileSystem,
- ICryptoProvider cryptographyProvider,
- IZipClient zipClient,
- string packageRuntime)
+ IZipClient zipClient)
{
if (loggerFactory == null)
{
@@ -139,18 +126,16 @@ namespace Emby.Server.Implementations.Updates
}
CurrentInstallations = new List<Tuple<InstallationInfo, CancellationTokenSource>>();
- CompletedInstallationsInternal = new ConcurrentBag<InstallationInfo>();
+ _completedInstallationsInternal = new ConcurrentBag<InstallationInfo>();
+ _logger = loggerFactory.CreateLogger(nameof(InstallationManager));
_applicationHost = appHost;
_appPaths = appPaths;
_httpClient = httpClient;
_jsonSerializer = jsonSerializer;
_config = config;
_fileSystem = fileSystem;
- _cryptographyProvider = cryptographyProvider;
_zipClient = zipClient;
- _packageRuntime = packageRuntime;
- _logger = loggerFactory.CreateLogger(nameof(InstallationManager));
}
private static Version GetPackageVersion(PackageVersionInfo version)
@@ -222,11 +207,6 @@ namespace Emby.Server.Implementations.Updates
continue;
}
- if (string.IsNullOrEmpty(version.runtimes) || version.runtimes.IndexOf(_packageRuntime, StringComparison.OrdinalIgnoreCase) == -1)
- {
- continue;
- }
-
versions.Add(version);
}
@@ -448,7 +428,7 @@ namespace Emby.Server.Implementations.Updates
CurrentInstallations.Remove(tuple);
}
- CompletedInstallationsInternal.Add(installationInfo);
+ _completedInstallationsInternal.Add(installationInfo);
PackageInstallationCompleted?.Invoke(this, installationEventArgs);
}
diff --git a/Emby.Server.Implementations/Xml/XmlReaderSettingsFactory.cs b/Emby.Server.Implementations/Xml/XmlReaderSettingsFactory.cs
deleted file mode 100644
index 308922e6d..000000000
--- a/Emby.Server.Implementations/Xml/XmlReaderSettingsFactory.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-using System.Xml;
-using MediaBrowser.Model.Xml;
-
-namespace Emby.Server.Implementations.Xml
-{
- public class XmlReaderSettingsFactory : IXmlReaderSettingsFactory
- {
- public XmlReaderSettings Create(bool enableValidation)
- {
- var settings = new XmlReaderSettings();
-
- if (!enableValidation)
- {
- settings.ValidationType = ValidationType.None;
- }
-
- return settings;
- }
- }
-}
diff --git a/Emby.XmlTv/Emby.XmlTv/Properties/AssemblyInfo.cs b/Emby.XmlTv/Emby.XmlTv/Properties/AssemblyInfo.cs
index ff2efb078..7beec09cb 100644
--- a/Emby.XmlTv/Emby.XmlTv/Properties/AssemblyInfo.cs
+++ b/Emby.XmlTv/Emby.XmlTv/Properties/AssemblyInfo.cs
@@ -9,8 +9,8 @@ using System.Runtime.InteropServices;
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Jellyfin Project")]
-[assembly: AssemblyProduct("Jellyfin: The Free Software Media System")]
-[assembly: AssemblyCopyright("Copyright © 2019 Jellyfin Contributors. Code released under the GNU General Public License Version 2")]
+[assembly: AssemblyProduct("Jellyfin Server")]
+[assembly: AssemblyCopyright("Copyright © 2019 Jellyfin Contributors. Code released under the GNU General Public License")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: NeutralResourcesLanguage("en")]
diff --git a/Jellyfin.Drawing.Skia/Properties/AssemblyInfo.cs b/Jellyfin.Drawing.Skia/Properties/AssemblyInfo.cs
index ea1c457f6..e7db09449 100644
--- a/Jellyfin.Drawing.Skia/Properties/AssemblyInfo.cs
+++ b/Jellyfin.Drawing.Skia/Properties/AssemblyInfo.cs
@@ -9,8 +9,8 @@ using System.Runtime.InteropServices;
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Jellyfin Project")]
-[assembly: AssemblyProduct("Jellyfin: The Free Software Media System")]
-[assembly: AssemblyCopyright("Copyright © 2019 Jellyfin Contributors. Code released under the GNU General Public License Version 2")]
+[assembly: AssemblyProduct("Jellyfin Server")]
+[assembly: AssemblyCopyright("Copyright © 2019 Jellyfin Contributors. Code released under the GNU General Public License")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: NeutralResourcesLanguage("en")]
diff --git a/Jellyfin.Drawing.Skia/StripCollageBuilder.cs b/Jellyfin.Drawing.Skia/StripCollageBuilder.cs
index dfdf39871..7d404ce64 100644
--- a/Jellyfin.Drawing.Skia/StripCollageBuilder.cs
+++ b/Jellyfin.Drawing.Skia/StripCollageBuilder.cs
@@ -77,21 +77,18 @@ namespace Jellyfin.Drawing.Skia
{
canvas.Clear(SKColors.Black);
+ // number of images used in the thumbnail
+ var iCount = 3;
+
// determine sizes for each image that will composited into the final image
- var iSlice = Convert.ToInt32(width * 0.23475);
- int iTrans = Convert.ToInt32(height * .25);
- int iHeight = Convert.ToInt32(height * .70);
- var horizontalImagePadding = Convert.ToInt32(width * 0.0125);
- var verticalSpacing = Convert.ToInt32(height * 0.01111111111111111111111111111111);
+ var iSlice = Convert.ToInt32(width / iCount);
+ int iHeight = Convert.ToInt32(height * 1.00);
int imageIndex = 0;
-
- for (int i = 0; i < 4; i++)
+ for (int i = 0; i < iCount; i++)
{
-
using (var currentBitmap = GetNextValidImage(paths, imageIndex, out int newIndex))
{
imageIndex = newIndex;
-
if (currentBitmap == null)
{
continue;
@@ -108,44 +105,7 @@ namespace Jellyfin.Drawing.Skia
using (var subset = image.Subset(SKRectI.Create(ix, 0, iSlice, iHeight)))
{
// draw image onto canvas
- canvas.DrawImage(subset ?? image, (horizontalImagePadding * (i + 1)) + (iSlice * i), verticalSpacing);
-
- if (subset == null)
- {
- continue;
- }
- // create reflection of image below the drawn image
- using (var croppedBitmap = SKBitmap.FromImage(subset))
- using (var reflectionBitmap = new SKBitmap(croppedBitmap.Width, croppedBitmap.Height / 2, croppedBitmap.ColorType, croppedBitmap.AlphaType))
- {
- // resize to half height
- currentBitmap.ScalePixels(reflectionBitmap, SKFilterQuality.High);
-
- using (var flippedBitmap = new SKBitmap(reflectionBitmap.Width, reflectionBitmap.Height, reflectionBitmap.ColorType, reflectionBitmap.AlphaType))
- using (var flippedCanvas = new SKCanvas(flippedBitmap))
- {
- // flip image vertically
- var matrix = SKMatrix.MakeScale(1, -1);
- matrix.SetScaleTranslate(1, -1, 0, flippedBitmap.Height);
- flippedCanvas.SetMatrix(matrix);
- flippedCanvas.DrawBitmap(reflectionBitmap, 0, 0);
- flippedCanvas.ResetMatrix();
-
- // create gradient to make image appear as a reflection
- var remainingHeight = height - (iHeight + (2 * verticalSpacing));
- flippedCanvas.ClipRect(SKRect.Create(reflectionBitmap.Width, remainingHeight));
- using (var gradient = new SKPaint())
- {
- gradient.IsAntialias = true;
- gradient.BlendMode = SKBlendMode.SrcOver;
- gradient.Shader = SKShader.CreateLinearGradient(new SKPoint(0, 0), new SKPoint(0, remainingHeight), new[] { new SKColor(0, 0, 0, 128), new SKColor(0, 0, 0, 208), new SKColor(0, 0, 0, 240), new SKColor(0, 0, 0, 255) }, null, SKShaderTileMode.Clamp);
- flippedCanvas.DrawPaint(gradient);
- }
-
- // finally draw reflection onto canvas
- canvas.DrawBitmap(flippedBitmap, (horizontalImagePadding * (i + 1)) + (iSlice * i), iHeight + (2 * verticalSpacing));
- }
- }
+ canvas.DrawImage(subset ?? image, iSlice * i, 0);
}
}
}
diff --git a/Jellyfin.Server/CoreAppHost.cs b/Jellyfin.Server/CoreAppHost.cs
index 17259c737..8e6ed7a7e 100644
--- a/Jellyfin.Server/CoreAppHost.cs
+++ b/Jellyfin.Server/CoreAppHost.cs
@@ -3,7 +3,6 @@ using System.Reflection;
using Emby.Server.Implementations;
using Emby.Server.Implementations.HttpServer;
using MediaBrowser.Model.IO;
-using MediaBrowser.Model.System;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
@@ -16,7 +15,6 @@ namespace Jellyfin.Server
ILoggerFactory loggerFactory,
StartupOptions options,
IFileSystem fileSystem,
- IEnvironmentInfo environmentInfo,
MediaBrowser.Controller.Drawing.IImageEncoder imageEncoder,
MediaBrowser.Common.Net.INetworkManager networkManager,
IConfiguration configuration)
@@ -25,7 +23,6 @@ namespace Jellyfin.Server
loggerFactory,
options,
fileSystem,
- environmentInfo,
imageEncoder,
networkManager,
configuration)
diff --git a/Jellyfin.Server/Jellyfin.Server.csproj b/Jellyfin.Server/Jellyfin.Server.csproj
index bd670df52..9346a2d25 100644
--- a/Jellyfin.Server/Jellyfin.Server.csproj
+++ b/Jellyfin.Server/Jellyfin.Server.csproj
@@ -12,7 +12,8 @@
<!-- We need C# 7.1 for async main-->
<LangVersion>latest</LangVersion>
<!-- Disable documentation warnings (for now) -->
- <NoWarn>SA1600;CS1591</NoWarn>
+ <NoWarn>SA1600;SA1601;CS1591</NoWarn>
+ <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<ItemGroup>
@@ -23,10 +24,6 @@
<EmbeddedResource Include="Resources/Configuration/*" />
</ItemGroup>
- <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
- <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
- </PropertyGroup>
-
<!-- Code analysers-->
<ItemGroup Condition=" '$(Configuration)' == 'Debug' ">
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.6.3" />
diff --git a/Jellyfin.Server/Program.cs b/Jellyfin.Server/Program.cs
index 0ef1711d4..d4b10c8c8 100644
--- a/Jellyfin.Server/Program.cs
+++ b/Jellyfin.Server/Program.cs
@@ -12,7 +12,6 @@ using System.Threading.Tasks;
using CommandLine;
using Emby.Drawing;
using Emby.Server.Implementations;
-using Emby.Server.Implementations.EnvironmentInfo;
using Emby.Server.Implementations.IO;
using Emby.Server.Implementations.Networking;
using Jellyfin.Drawing.Skia;
@@ -20,7 +19,6 @@ using MediaBrowser.Common.Configuration;
using MediaBrowser.Controller.Drawing;
using MediaBrowser.Model.Globalization;
using MediaBrowser.Model.IO;
-using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
@@ -46,7 +44,6 @@ namespace Jellyfin.Server
const string pattern = @"^(-[^-\s]{2})"; // Match -xx, not -x, not --xx, not xx
const string substitution = @"-$1"; // Prepend with additional single-hyphen
var regex = new Regex(pattern);
-
for (var i = 0; i < args.Length; i++)
{
args[i] = regex.Replace(args[i], substitution);
@@ -54,9 +51,7 @@ namespace Jellyfin.Server
// Parse the command line arguments and either start the app or exit indicating error
await Parser.Default.ParseArguments<StartupOptions>(args)
- .MapResult(
- options => StartApp(options),
- errs => Task.FromResult(0)).ConfigureAwait(false);
+ .MapResult(StartApp, _ => Task.CompletedTask).ConfigureAwait(false);
}
public static void Shutdown()
@@ -119,31 +114,29 @@ namespace Jellyfin.Server
_logger.LogInformation("Jellyfin version: {Version}", Assembly.GetEntryAssembly().GetName().Version);
- EnvironmentInfo environmentInfo = new EnvironmentInfo(GetOperatingSystem());
- ApplicationHost.LogEnvironmentInfo(_logger, appPaths, environmentInfo);
+ ApplicationHost.LogEnvironmentInfo(_logger, appPaths);
SQLitePCL.Batteries_V2.Init();
// Allow all https requests
ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(delegate { return true; });
- var fileSystem = new ManagedFileSystem(_loggerFactory, environmentInfo, appPaths);
+ var fileSystem = new ManagedFileSystem(_loggerFactory, appPaths);
using (var appHost = new CoreAppHost(
appPaths,
_loggerFactory,
options,
fileSystem,
- environmentInfo,
new NullImageEncoder(),
- new NetworkManager(_loggerFactory, environmentInfo),
+ new NetworkManager(_loggerFactory),
appConfig))
{
- await appHost.Init(new ServiceCollection()).ConfigureAwait(false);
+ await appHost.InitAsync(new ServiceCollection()).ConfigureAwait(false);
appHost.ImageProcessor.ImageEncoder = GetImageEncoder(fileSystem, appPaths, appHost.LocalizationManager);
- await appHost.RunStartupTasks().ConfigureAwait(false);
+ await appHost.RunStartupTasksAsync().ConfigureAwait(false);
try
{
@@ -174,15 +167,14 @@ namespace Jellyfin.Server
{
// dataDir
// IF --datadir
- // ELSE IF $JELLYFIN_DATA_PATH
+ // ELSE IF $JELLYFIN_DATA_DIR
// ELSE IF windows, use <%APPDATA%>/jellyfin
// ELSE IF $XDG_DATA_HOME then use $XDG_DATA_HOME/jellyfin
// ELSE use $HOME/.local/share/jellyfin
var dataDir = options.DataDir;
-
if (string.IsNullOrEmpty(dataDir))
{
- dataDir = Environment.GetEnvironmentVariable("JELLYFIN_DATA_PATH");
+ dataDir = Environment.GetEnvironmentVariable("JELLYFIN_DATA_DIR");
if (string.IsNullOrEmpty(dataDir))
{
@@ -191,8 +183,6 @@ namespace Jellyfin.Server
}
}
- Directory.CreateDirectory(dataDir);
-
// configDir
// IF --configdir
// ELSE IF $JELLYFIN_CONFIG_DIR
@@ -236,7 +226,6 @@ namespace Jellyfin.Server
// ELSE IF XDG_CACHE_HOME, use $XDG_CACHE_HOME/jellyfin
// ELSE HOME/.cache/jellyfin
var cacheDir = options.CacheDir;
-
if (string.IsNullOrEmpty(cacheDir))
{
cacheDir = Environment.GetEnvironmentVariable("JELLYFIN_CACHE_DIR");
@@ -264,13 +253,29 @@ namespace Jellyfin.Server
}
}
+ // webDir
+ // IF --webdir
+ // ELSE IF $JELLYFIN_WEB_DIR
+ // ELSE use <bindir>/jellyfin-web
+ var webDir = options.WebDir;
+
+ if (string.IsNullOrEmpty(webDir))
+ {
+ webDir = Environment.GetEnvironmentVariable("JELLYFIN_WEB_DIR");
+
+ if (string.IsNullOrEmpty(webDir))
+ {
+ // Use default location under ResourcesPath
+ webDir = Path.Combine(AppContext.BaseDirectory, "jellyfin-web", "src");
+ }
+ }
+
// logDir
// IF --logdir
// ELSE IF $JELLYFIN_LOG_DIR
// ELSE IF --datadir, use <datadir>/log (assume portable run)
// ELSE <datadir>/log
var logDir = options.LogDir;
-
if (string.IsNullOrEmpty(logDir))
{
logDir = Environment.GetEnvironmentVariable("JELLYFIN_LOG_DIR");
@@ -285,6 +290,7 @@ namespace Jellyfin.Server
// Ensure the main folders exist before we continue
try
{
+ Directory.CreateDirectory(dataDir);
Directory.CreateDirectory(logDir);
Directory.CreateDirectory(configDir);
Directory.CreateDirectory(cacheDir);
@@ -296,7 +302,7 @@ namespace Jellyfin.Server
Environment.Exit(1);
}
- return new ServerApplicationPaths(dataDir, logDir, configDir, cacheDir);
+ return new ServerApplicationPaths(dataDir, logDir, configDir, cacheDir, webDir);
}
private static async Task<IConfiguration> CreateConfiguration(IApplicationPaths appPaths)
@@ -364,36 +370,6 @@ namespace Jellyfin.Server
return new NullImageEncoder();
}
- private static MediaBrowser.Model.System.OperatingSystem GetOperatingSystem()
- {
- switch (Environment.OSVersion.Platform)
- {
- case PlatformID.MacOSX:
- return MediaBrowser.Model.System.OperatingSystem.OSX;
- case PlatformID.Win32NT:
- return MediaBrowser.Model.System.OperatingSystem.Windows;
- case PlatformID.Unix:
- default:
- {
- string osDescription = RuntimeInformation.OSDescription;
- if (osDescription.Contains("linux", StringComparison.OrdinalIgnoreCase))
- {
- return MediaBrowser.Model.System.OperatingSystem.Linux;
- }
- else if (osDescription.Contains("darwin", StringComparison.OrdinalIgnoreCase))
- {
- return MediaBrowser.Model.System.OperatingSystem.OSX;
- }
- else if (osDescription.Contains("bsd", StringComparison.OrdinalIgnoreCase))
- {
- return MediaBrowser.Model.System.OperatingSystem.BSD;
- }
-
- throw new Exception($"Can't resolve OS with description: '{osDescription}'");
- }
- }
- }
-
private static void StartNewInstance(StartupOptions options)
{
_logger.LogInformation("Starting new instance");
diff --git a/Jellyfin.Server/Properties/AssemblyInfo.cs b/Jellyfin.Server/Properties/AssemblyInfo.cs
index 2959cdf1f..5de1e653d 100644
--- a/Jellyfin.Server/Properties/AssemblyInfo.cs
+++ b/Jellyfin.Server/Properties/AssemblyInfo.cs
@@ -9,8 +9,8 @@ using System.Runtime.InteropServices;
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Jellyfin Project")]
-[assembly: AssemblyProduct("Jellyfin: The Free Software Media System")]
-[assembly: AssemblyCopyright("Copyright © 2019 Jellyfin Contributors. Code released under the GNU General Public License Version 2")]
+[assembly: AssemblyProduct("Jellyfin Server")]
+[assembly: AssemblyCopyright("Copyright © 2019 Jellyfin Contributors. Code released under the GNU General Public License")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: NeutralResourcesLanguage("en")]
diff --git a/Jellyfin.Server/StartupOptions.cs b/Jellyfin.Server/StartupOptions.cs
index c8cdb984d..8296d414e 100644
--- a/Jellyfin.Server/StartupOptions.cs
+++ b/Jellyfin.Server/StartupOptions.cs
@@ -11,6 +11,9 @@ namespace Jellyfin.Server
[Option('d', "datadir", Required = false, HelpText = "Path to use for the data folder (database files, etc.).")]
public string DataDir { get; set; }
+ [Option('w', "webdir", Required = false, HelpText = "Path to the Jellyfin web UI resources.")]
+ public string WebDir { get; set; }
+
[Option('C', "cachedir", Required = false, HelpText = "Path to use for caching.")]
public string CacheDir { get; set; }
@@ -23,9 +26,6 @@ namespace Jellyfin.Server
[Option("ffmpeg", Required = false, HelpText = "Path to external FFmpeg executable to use in place of default found in PATH.")]
public string FFmpegPath { get; set; }
- [Option("ffprobe", Required = false, HelpText = "(deprecated) Option has no effect and shall be removed in next release.")]
- public string FFprobePath { get; set; }
-
[Option("service", Required = false, HelpText = "Run as headless service.")]
public bool IsService { get; set; }
diff --git a/MediaBrowser.Api/BaseApiService.cs b/MediaBrowser.Api/BaseApiService.cs
index 69673a49c..49f8c6ace 100644
--- a/MediaBrowser.Api/BaseApiService.cs
+++ b/MediaBrowser.Api/BaseApiService.cs
@@ -165,6 +165,7 @@ namespace MediaBrowser.Api
{
options.ImageTypeLimit = hasDtoOptions.ImageTypeLimit.Value;
}
+
if (hasDtoOptions.EnableUserData.HasValue)
{
options.EnableUserData = hasDtoOptions.EnableUserData.Value;
@@ -307,7 +308,7 @@ namespace MediaBrowser.Api
return pathInfo[index];
}
- private string[] Parse(string pathUri)
+ private static string[] Parse(string pathUri)
{
var actionParts = pathUri.Split(new[] { "://" }, StringSplitOptions.None);
@@ -329,38 +330,32 @@ namespace MediaBrowser.Api
/// </summary>
protected BaseItem GetItemByName(string name, string type, ILibraryManager libraryManager, DtoOptions dtoOptions)
{
- BaseItem item;
-
- if (type.IndexOf("Person", StringComparison.OrdinalIgnoreCase) == 0)
- {
- item = GetPerson(name, libraryManager, dtoOptions);
- }
- else if (type.IndexOf("Artist", StringComparison.OrdinalIgnoreCase) == 0)
+ if (type.Equals("Person", StringComparison.OrdinalIgnoreCase))
{
- item = GetArtist(name, libraryManager, dtoOptions);
+ return GetPerson(name, libraryManager, dtoOptions);
}
- else if (type.IndexOf("Genre", StringComparison.OrdinalIgnoreCase) == 0)
+ else if (type.Equals("Artist", StringComparison.OrdinalIgnoreCase))
{
- item = GetGenre(name, libraryManager, dtoOptions);
+ return GetArtist(name, libraryManager, dtoOptions);
}
- else if (type.IndexOf("MusicGenre", StringComparison.OrdinalIgnoreCase) == 0)
+ else if (type.Equals("Genre", StringComparison.OrdinalIgnoreCase))
{
- item = GetMusicGenre(name, libraryManager, dtoOptions);
+ return GetGenre(name, libraryManager, dtoOptions);
}
- else if (type.IndexOf("Studio", StringComparison.OrdinalIgnoreCase) == 0)
+ else if (type.Equals("MusicGenre", StringComparison.OrdinalIgnoreCase))
{
- item = GetStudio(name, libraryManager, dtoOptions);
+ return GetMusicGenre(name, libraryManager, dtoOptions);
}
- else if (type.IndexOf("Year", StringComparison.OrdinalIgnoreCase) == 0)
+ else if (type.Equals("Studio", StringComparison.OrdinalIgnoreCase))
{
- item = libraryManager.GetYear(int.Parse(name));
+ return GetStudio(name, libraryManager, dtoOptions);
}
- else
+ else if (type.Equals("Year", StringComparison.OrdinalIgnoreCase))
{
- throw new ArgumentException();
+ return libraryManager.GetYear(int.Parse(name));
}
- return item;
+ throw new ArgumentException("Invalid type", nameof(type));
}
}
}
diff --git a/MediaBrowser.Api/LiveTv/LiveTvService.cs b/MediaBrowser.Api/LiveTv/LiveTvService.cs
index 88ed73456..e41ad540a 100644
--- a/MediaBrowser.Api/LiveTv/LiveTvService.cs
+++ b/MediaBrowser.Api/LiveTv/LiveTvService.cs
@@ -23,7 +23,6 @@ using MediaBrowser.Model.IO;
using MediaBrowser.Model.LiveTv;
using MediaBrowser.Model.Querying;
using MediaBrowser.Model.Services;
-using MediaBrowser.Model.System;
using Microsoft.Net.Http.Headers;
namespace MediaBrowser.Api.LiveTv
@@ -695,29 +694,36 @@ namespace MediaBrowser.Api.LiveTv
private readonly IHttpClient _httpClient;
private readonly ILibraryManager _libraryManager;
private readonly IDtoService _dtoService;
- private readonly IFileSystem _fileSystem;
private readonly IAuthorizationContext _authContext;
private readonly ISessionContext _sessionContext;
- private readonly IEnvironmentInfo _environment;
- private ICryptoProvider _cryptographyProvider;
- private IStreamHelper _streamHelper;
- private IMediaSourceManager _mediaSourceManager;
-
- public LiveTvService(ICryptoProvider crypto, IMediaSourceManager mediaSourceManager, IStreamHelper streamHelper, ILiveTvManager liveTvManager, IUserManager userManager, IServerConfigurationManager config, IHttpClient httpClient, ILibraryManager libraryManager, IDtoService dtoService, IFileSystem fileSystem, IAuthorizationContext authContext, ISessionContext sessionContext, IEnvironmentInfo environment)
+ private readonly ICryptoProvider _cryptographyProvider;
+ private readonly IStreamHelper _streamHelper;
+ private readonly IMediaSourceManager _mediaSourceManager;
+
+ public LiveTvService(
+ ICryptoProvider crypto,
+ IMediaSourceManager mediaSourceManager,
+ IStreamHelper streamHelper,
+ ILiveTvManager liveTvManager,
+ IUserManager userManager,
+ IServerConfigurationManager config,
+ IHttpClient httpClient,
+ ILibraryManager libraryManager,
+ IDtoService dtoService,
+ IAuthorizationContext authContext,
+ ISessionContext sessionContext)
{
+ _cryptographyProvider = crypto;
+ _mediaSourceManager = mediaSourceManager;
+ _streamHelper = streamHelper;
_liveTvManager = liveTvManager;
_userManager = userManager;
_config = config;
_httpClient = httpClient;
_libraryManager = libraryManager;
_dtoService = dtoService;
- _fileSystem = fileSystem;
_authContext = authContext;
_sessionContext = sessionContext;
- _environment = environment;
- _cryptographyProvider = crypto;
- _streamHelper = streamHelper;
- _mediaSourceManager = mediaSourceManager;
}
public object Get(GetTunerHostTypes request)
@@ -731,7 +737,7 @@ namespace MediaBrowser.Api.LiveTv
var user = request.UserId.Equals(Guid.Empty) ? null : _userManager.GetUserById(request.UserId);
var folders = _liveTvManager.GetRecordingFolders(user);
- var returnArray = _dtoService.GetBaseItemDtos(folders.ToArray(), new DtoOptions(), user);
+ var returnArray = _dtoService.GetBaseItemDtos(folders, new DtoOptions(), user);
var result = new QueryResult<BaseItemDto>
{
@@ -756,7 +762,7 @@ namespace MediaBrowser.Api.LiveTv
[HeaderNames.ContentType] = Model.Net.MimeTypes.GetMimeType(path)
};
- return new ProgressiveFileCopier(_fileSystem, _streamHelper, path, outputHeaders, Logger, _environment)
+ return new ProgressiveFileCopier(_streamHelper, path, outputHeaders, Logger)
{
AllowEndOfFile = false
};
@@ -779,7 +785,7 @@ namespace MediaBrowser.Api.LiveTv
[HeaderNames.ContentType] = Model.Net.MimeTypes.GetMimeType("file." + request.Container)
};
- return new ProgressiveFileCopier(directStreamProvider, _streamHelper, outputHeaders, Logger, _environment)
+ return new ProgressiveFileCopier(directStreamProvider, _streamHelper, outputHeaders, Logger)
{
AllowEndOfFile = false
};
diff --git a/MediaBrowser.Api/LiveTv/ProgressiveFileCopier.cs b/MediaBrowser.Api/LiveTv/ProgressiveFileCopier.cs
index 8412bf66b..4c608d9a3 100644
--- a/MediaBrowser.Api/LiveTv/ProgressiveFileCopier.cs
+++ b/MediaBrowser.Api/LiveTv/ProgressiveFileCopier.cs
@@ -1,3 +1,4 @@
+using System;
using System.Collections.Generic;
using System.IO;
using System.Threading;
@@ -5,60 +6,39 @@ using System.Threading.Tasks;
using MediaBrowser.Controller.Library;
using MediaBrowser.Model.IO;
using MediaBrowser.Model.Services;
-using MediaBrowser.Model.System;
using Microsoft.Extensions.Logging;
namespace MediaBrowser.Api.LiveTv
{
public class ProgressiveFileCopier : IAsyncStreamWriter, IHasHeaders
{
- private readonly IFileSystem _fileSystem;
private readonly ILogger _logger;
private readonly string _path;
private readonly Dictionary<string, string> _outputHeaders;
- const int StreamCopyToBufferSize = 81920;
-
- public long StartPosition { get; set; }
public bool AllowEndOfFile = true;
private readonly IDirectStreamProvider _directStreamProvider;
- private readonly IEnvironmentInfo _environment;
private IStreamHelper _streamHelper;
- public ProgressiveFileCopier(IFileSystem fileSystem, IStreamHelper streamHelper, string path, Dictionary<string, string> outputHeaders, ILogger logger, IEnvironmentInfo environment)
+ public ProgressiveFileCopier(IStreamHelper streamHelper, string path, Dictionary<string, string> outputHeaders, ILogger logger)
{
- _fileSystem = fileSystem;
_path = path;
_outputHeaders = outputHeaders;
_logger = logger;
- _environment = environment;
_streamHelper = streamHelper;
}
- public ProgressiveFileCopier(IDirectStreamProvider directStreamProvider, IStreamHelper streamHelper, Dictionary<string, string> outputHeaders, ILogger logger, IEnvironmentInfo environment)
+ public ProgressiveFileCopier(IDirectStreamProvider directStreamProvider, IStreamHelper streamHelper, Dictionary<string, string> outputHeaders, ILogger logger)
{
_directStreamProvider = directStreamProvider;
_outputHeaders = outputHeaders;
_logger = logger;
- _environment = environment;
_streamHelper = streamHelper;
}
public IDictionary<string, string> Headers => _outputHeaders;
- private Stream GetInputStream(bool allowAsyncFileRead)
- {
- var fileOpenOptions = FileOpenOptions.SequentialScan;
-
- if (allowAsyncFileRead)
- {
- fileOpenOptions |= FileOpenOptions.Asynchronous;
- }
-
- return _fileSystem.GetFileStream(_path, FileOpenMode.Open, FileAccessMode.Read, FileShareMode.ReadWrite, fileOpenOptions);
- }
-
public async Task WriteToAsync(Stream outputStream, CancellationToken cancellationToken)
{
if (_directStreamProvider != null)
@@ -67,28 +47,23 @@ namespace MediaBrowser.Api.LiveTv
return;
}
- var eofCount = 0;
+ var fileOptions = FileOptions.SequentialScan;
// use non-async filestream along with read due to https://github.com/dotnet/corefx/issues/6039
- var allowAsyncFileRead = true;
-
- using (var inputStream = GetInputStream(allowAsyncFileRead))
+ if (Environment.OSVersion.Platform != PlatformID.Win32NT)
{
- if (StartPosition > 0)
- {
- inputStream.Position = StartPosition;
- }
+ fileOptions |= FileOptions.Asynchronous;
+ }
+ using (var inputStream = new FileStream(_path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite, 4096, fileOptions))
+ {
var emptyReadLimit = AllowEndOfFile ? 20 : 100;
-
+ var eofCount = 0;
while (eofCount < emptyReadLimit)
{
int bytesRead;
bytesRead = await _streamHelper.CopyToAsync(inputStream, outputStream, cancellationToken).ConfigureAwait(false);
- //var position = fs.Position;
- //_logger.LogDebug("Streamed {0} bytes to position {1} from file {2}", bytesRead, position, path);
-
if (bytesRead == 0)
{
eofCount++;
diff --git a/MediaBrowser.Api/Playback/Progressive/AudioService.cs b/MediaBrowser.Api/Playback/Progressive/AudioService.cs
index 48b4e2f24..dfe4b2b8e 100644
--- a/MediaBrowser.Api/Playback/Progressive/AudioService.cs
+++ b/MediaBrowser.Api/Playback/Progressive/AudioService.cs
@@ -3,7 +3,6 @@ using MediaBrowser.Common.Net;
using MediaBrowser.Controller.Configuration;
using MediaBrowser.Controller.Devices;
using MediaBrowser.Controller.Dlna;
-using MediaBrowser.Controller.Drawing;
using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.MediaEncoding;
using MediaBrowser.Controller.Net;
@@ -11,7 +10,6 @@ using MediaBrowser.Model.Configuration;
using MediaBrowser.Model.IO;
using MediaBrowser.Model.Serialization;
using MediaBrowser.Model.Services;
-using MediaBrowser.Model.System;
namespace MediaBrowser.Api.Playback.Progressive
{
@@ -46,8 +44,7 @@ namespace MediaBrowser.Api.Playback.Progressive
IDeviceManager deviceManager,
IMediaSourceManager mediaSourceManager,
IJsonSerializer jsonSerializer,
- IAuthorizationContext authorizationContext,
- IEnvironmentInfo environmentInfo)
+ IAuthorizationContext authorizationContext)
: base(httpClient,
serverConfig,
userManager,
@@ -60,8 +57,7 @@ namespace MediaBrowser.Api.Playback.Progressive
deviceManager,
mediaSourceManager,
jsonSerializer,
- authorizationContext,
- environmentInfo)
+ authorizationContext)
{
}
diff --git a/MediaBrowser.Api/Playback/Progressive/BaseProgressiveStreamingService.cs b/MediaBrowser.Api/Playback/Progressive/BaseProgressiveStreamingService.cs
index f43f26b2f..a2c20e38f 100644
--- a/MediaBrowser.Api/Playback/Progressive/BaseProgressiveStreamingService.cs
+++ b/MediaBrowser.Api/Playback/Progressive/BaseProgressiveStreamingService.cs
@@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
-using System.Globalization;
using System.IO;
using System.Threading;
using System.Threading.Tasks;
@@ -8,15 +7,12 @@ using MediaBrowser.Common.Net;
using MediaBrowser.Controller.Configuration;
using MediaBrowser.Controller.Devices;
using MediaBrowser.Controller.Dlna;
-using MediaBrowser.Controller.Drawing;
using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.MediaEncoding;
using MediaBrowser.Controller.Net;
using MediaBrowser.Model.IO;
using MediaBrowser.Model.MediaInfo;
using MediaBrowser.Model.Serialization;
-using MediaBrowser.Model.Services;
-using MediaBrowser.Model.System;
using Microsoft.Net.Http.Headers;
namespace MediaBrowser.Api.Playback.Progressive
@@ -26,7 +22,6 @@ namespace MediaBrowser.Api.Playback.Progressive
/// </summary>
public abstract class BaseProgressiveStreamingService : BaseStreamingService
{
- protected readonly IEnvironmentInfo EnvironmentInfo;
protected IHttpClient HttpClient { get; private set; }
public BaseProgressiveStreamingService(
@@ -42,8 +37,7 @@ namespace MediaBrowser.Api.Playback.Progressive
IDeviceManager deviceManager,
IMediaSourceManager mediaSourceManager,
IJsonSerializer jsonSerializer,
- IAuthorizationContext authorizationContext,
- IEnvironmentInfo environmentInfo)
+ IAuthorizationContext authorizationContext)
: base(serverConfig,
userManager,
libraryManager,
@@ -57,7 +51,6 @@ namespace MediaBrowser.Api.Playback.Progressive
jsonSerializer,
authorizationContext)
{
- EnvironmentInfo = environmentInfo;
HttpClient = httpClient;
}
@@ -157,7 +150,7 @@ namespace MediaBrowser.Api.Playback.Progressive
// TODO: Don't hardcode this
outputHeaders[HeaderNames.ContentType] = Model.Net.MimeTypes.GetMimeType("file.ts");
- return new ProgressiveFileCopier(state.DirectStreamProvider, outputHeaders, null, Logger, EnvironmentInfo, CancellationToken.None)
+ return new ProgressiveFileCopier(state.DirectStreamProvider, outputHeaders, null, Logger, CancellationToken.None)
{
AllowEndOfFile = false
};
@@ -203,7 +196,7 @@ namespace MediaBrowser.Api.Playback.Progressive
};
- return new ProgressiveFileCopier(FileSystem, state.MediaPath, outputHeaders, null, Logger, EnvironmentInfo, CancellationToken.None)
+ return new ProgressiveFileCopier(FileSystem, state.MediaPath, outputHeaders, null, Logger, CancellationToken.None)
{
AllowEndOfFile = false
};
@@ -397,7 +390,7 @@ namespace MediaBrowser.Api.Playback.Progressive
outputHeaders[item.Key] = item.Value;
}
- return new ProgressiveFileCopier(FileSystem, outputPath, outputHeaders, job, Logger, EnvironmentInfo, CancellationToken.None);
+ return new ProgressiveFileCopier(FileSystem, outputPath, outputHeaders, job, Logger, CancellationToken.None);
}
finally
{
diff --git a/MediaBrowser.Api/Playback/Progressive/ProgressiveStreamWriter.cs b/MediaBrowser.Api/Playback/Progressive/ProgressiveStreamWriter.cs
index 3dd9de2a1..660912065 100644
--- a/MediaBrowser.Api/Playback/Progressive/ProgressiveStreamWriter.cs
+++ b/MediaBrowser.Api/Playback/Progressive/ProgressiveStreamWriter.cs
@@ -8,6 +8,7 @@ using MediaBrowser.Model.IO;
using MediaBrowser.Model.Services;
using MediaBrowser.Model.System;
using Microsoft.Extensions.Logging;
+using OperatingSystem = MediaBrowser.Common.System.OperatingSystem;
namespace MediaBrowser.Api.Playback.Progressive
{
@@ -27,9 +28,8 @@ namespace MediaBrowser.Api.Playback.Progressive
public bool AllowEndOfFile = true;
private readonly IDirectStreamProvider _directStreamProvider;
- private readonly IEnvironmentInfo _environment;
- public ProgressiveFileCopier(IFileSystem fileSystem, string path, Dictionary<string, string> outputHeaders, TranscodingJob job, ILogger logger, IEnvironmentInfo environment, CancellationToken cancellationToken)
+ public ProgressiveFileCopier(IFileSystem fileSystem, string path, Dictionary<string, string> outputHeaders, TranscodingJob job, ILogger logger, CancellationToken cancellationToken)
{
_fileSystem = fileSystem;
_path = path;
@@ -37,17 +37,15 @@ namespace MediaBrowser.Api.Playback.Progressive
_job = job;
_logger = logger;
_cancellationToken = cancellationToken;
- _environment = environment;
}
- public ProgressiveFileCopier(IDirectStreamProvider directStreamProvider, Dictionary<string, string> outputHeaders, TranscodingJob job, ILogger logger, IEnvironmentInfo environment, CancellationToken cancellationToken)
+ public ProgressiveFileCopier(IDirectStreamProvider directStreamProvider, Dictionary<string, string> outputHeaders, TranscodingJob job, ILogger logger, CancellationToken cancellationToken)
{
_directStreamProvider = directStreamProvider;
_outputHeaders = outputHeaders;
_job = job;
_logger = logger;
_cancellationToken = cancellationToken;
- _environment = environment;
}
public IDictionary<string, string> Headers => _outputHeaders;
@@ -79,7 +77,7 @@ namespace MediaBrowser.Api.Playback.Progressive
var eofCount = 0;
// use non-async filestream along with read due to https://github.com/dotnet/corefx/issues/6039
- var allowAsyncFileRead = _environment.OperatingSystem != Model.System.OperatingSystem.Windows;
+ var allowAsyncFileRead = OperatingSystem.Id != OperatingSystemId.Windows;
using (var inputStream = GetInputStream(allowAsyncFileRead))
{
diff --git a/MediaBrowser.Api/Playback/Progressive/VideoService.cs b/MediaBrowser.Api/Playback/Progressive/VideoService.cs
index bf15cc756..ab19fdc26 100644
--- a/MediaBrowser.Api/Playback/Progressive/VideoService.cs
+++ b/MediaBrowser.Api/Playback/Progressive/VideoService.cs
@@ -3,7 +3,6 @@ using MediaBrowser.Common.Net;
using MediaBrowser.Controller.Configuration;
using MediaBrowser.Controller.Devices;
using MediaBrowser.Controller.Dlna;
-using MediaBrowser.Controller.Drawing;
using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.MediaEncoding;
using MediaBrowser.Controller.Net;
@@ -11,7 +10,6 @@ using MediaBrowser.Model.Configuration;
using MediaBrowser.Model.IO;
using MediaBrowser.Model.Serialization;
using MediaBrowser.Model.Services;
-using MediaBrowser.Model.System;
namespace MediaBrowser.Api.Playback.Progressive
{
@@ -83,8 +81,7 @@ namespace MediaBrowser.Api.Playback.Progressive
IDeviceManager deviceManager,
IMediaSourceManager mediaSourceManager,
IJsonSerializer jsonSerializer,
- IAuthorizationContext authorizationContext,
- IEnvironmentInfo environmentInfo)
+ IAuthorizationContext authorizationContext)
: base(httpClient,
serverConfig,
userManager,
@@ -97,8 +94,7 @@ namespace MediaBrowser.Api.Playback.Progressive
deviceManager,
mediaSourceManager,
jsonSerializer,
- authorizationContext,
- environmentInfo)
+ authorizationContext)
{
}
diff --git a/MediaBrowser.Api/Playback/UniversalAudioService.cs b/MediaBrowser.Api/Playback/UniversalAudioService.cs
index f97e88e98..b3d8bfe59 100644
--- a/MediaBrowser.Api/Playback/UniversalAudioService.cs
+++ b/MediaBrowser.Api/Playback/UniversalAudioService.cs
@@ -18,7 +18,6 @@ using MediaBrowser.Model.IO;
using MediaBrowser.Model.MediaInfo;
using MediaBrowser.Model.Serialization;
using MediaBrowser.Model.Services;
-using MediaBrowser.Model.System;
using Microsoft.Extensions.Logging;
namespace MediaBrowser.Api.Playback
@@ -93,7 +92,6 @@ namespace MediaBrowser.Api.Playback
IAuthorizationContext authorizationContext,
IImageProcessor imageProcessor,
INetworkManager networkManager,
- IEnvironmentInfo environmentInfo,
ILoggerFactory loggerFactory)
{
HttpClient = httpClient;
@@ -112,7 +110,6 @@ namespace MediaBrowser.Api.Playback
AuthorizationContext = authorizationContext;
ImageProcessor = imageProcessor;
NetworkManager = networkManager;
- EnvironmentInfo = environmentInfo;
_loggerFactory = loggerFactory;
_logger = loggerFactory.CreateLogger(nameof(UniversalAudioService));
}
@@ -133,7 +130,6 @@ namespace MediaBrowser.Api.Playback
protected IAuthorizationContext AuthorizationContext { get; private set; }
protected IImageProcessor ImageProcessor { get; private set; }
protected INetworkManager NetworkManager { get; private set; }
- protected IEnvironmentInfo EnvironmentInfo { get; private set; }
private ILoggerFactory _loggerFactory;
private ILogger _logger;
@@ -338,8 +334,7 @@ namespace MediaBrowser.Api.Playback
DeviceManager,
MediaSourceManager,
JsonSerializer,
- AuthorizationContext,
- EnvironmentInfo)
+ AuthorizationContext)
{
Request = Request
};
diff --git a/MediaBrowser.Api/Properties/AssemblyInfo.cs b/MediaBrowser.Api/Properties/AssemblyInfo.cs
index f86723031..35bcbea5c 100644
--- a/MediaBrowser.Api/Properties/AssemblyInfo.cs
+++ b/MediaBrowser.Api/Properties/AssemblyInfo.cs
@@ -9,8 +9,8 @@ using System.Runtime.InteropServices;
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Jellyfin Project")]
-[assembly: AssemblyProduct("Jellyfin: The Free Software Media System")]
-[assembly: AssemblyCopyright("Copyright © 2019 Jellyfin Contributors. Code released under the GNU General Public License Version 2")]
+[assembly: AssemblyProduct("Jellyfin Server")]
+[assembly: AssemblyCopyright("Copyright © 2019 Jellyfin Contributors. Code released under the GNU General Public License")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: NeutralResourcesLanguage("en")]
diff --git a/MediaBrowser.Api/UserLibrary/ArtistsService.cs b/MediaBrowser.Api/UserLibrary/ArtistsService.cs
index 7a8455ff2..a30f8adfe 100644
--- a/MediaBrowser.Api/UserLibrary/ArtistsService.cs
+++ b/MediaBrowser.Api/UserLibrary/ArtistsService.cs
@@ -87,11 +87,6 @@ namespace MediaBrowser.Api.UserLibrary
/// <returns>System.Object.</returns>
public object Get(GetArtists request)
{
- if (string.IsNullOrWhiteSpace(request.IncludeItemTypes))
- {
- //request.IncludeItemTypes = "Audio,MusicVideo";
- }
-
return GetResultSlim(request);
}
@@ -102,11 +97,6 @@ namespace MediaBrowser.Api.UserLibrary
/// <returns>System.Object.</returns>
public object Get(GetAlbumArtists request)
{
- if (string.IsNullOrWhiteSpace(request.IncludeItemTypes))
- {
- //request.IncludeItemTypes = "Audio,MusicVideo";
- }
-
var result = GetResultSlim(request);
return ToOptimizedResult(result);
diff --git a/MediaBrowser.Common/Configuration/IApplicationPaths.cs b/MediaBrowser.Common/Configuration/IApplicationPaths.cs
index cb4e8bf5f..fd11bf904 100644
--- a/MediaBrowser.Common/Configuration/IApplicationPaths.cs
+++ b/MediaBrowser.Common/Configuration/IApplicationPaths.cs
@@ -12,6 +12,12 @@ namespace MediaBrowser.Common.Configuration
string ProgramDataPath { get; }
/// <summary>
+ /// Gets the path to the web UI resources folder
+ /// </summary>
+ /// <value>The web UI resources path.</value>
+ string WebPath { get; }
+
+ /// <summary>
/// Gets the path to the program system folder
/// </summary>
/// <value>The program data path.</value>
diff --git a/MediaBrowser.Common/Extensions/BaseExtensions.cs b/MediaBrowser.Common/Extensions/BaseExtensions.cs
index db0514bb1..40c16b957 100644
--- a/MediaBrowser.Common/Extensions/BaseExtensions.cs
+++ b/MediaBrowser.Common/Extensions/BaseExtensions.cs
@@ -1,6 +1,7 @@
using System;
+using System.Text;
using System.Text.RegularExpressions;
-using MediaBrowser.Model.Cryptography;
+using System.Security.Cryptography;
namespace MediaBrowser.Common.Extensions
{
@@ -9,8 +10,6 @@ namespace MediaBrowser.Common.Extensions
/// </summary>
public static class BaseExtensions
{
- public static ICryptoProvider CryptographyProvider { get; set; }
-
/// <summary>
/// Strips the HTML.
/// </summary>
@@ -31,7 +30,10 @@ namespace MediaBrowser.Common.Extensions
/// <returns>Guid.</returns>
public static Guid GetMD5(this string str)
{
- return CryptographyProvider.GetMD5(str);
+ using (var provider = MD5.Create())
+ {
+ return new Guid(provider.ComputeHash(Encoding.Unicode.GetBytes(str)));
+ }
}
}
}
diff --git a/MediaBrowser.Common/IApplicationHost.cs b/MediaBrowser.Common/IApplicationHost.cs
index 3a4098612..2925a3efd 100644
--- a/MediaBrowser.Common/IApplicationHost.cs
+++ b/MediaBrowser.Common/IApplicationHost.cs
@@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
-using System.Threading;
using System.Threading.Tasks;
using MediaBrowser.Common.Plugins;
using MediaBrowser.Model.Events;
@@ -73,6 +72,12 @@ namespace MediaBrowser.Common
string ApplicationUserAgent { get; }
/// <summary>
+ /// Gets the email address for use within a comment section of a user agent field.
+ /// Presently used to provide contact information to MusicBrainz service.
+ /// </summary>
+ string ApplicationUserAgentAddress { get; }
+
+ /// <summary>
/// Gets the exports.
/// </summary>
/// <typeparam name="T"></typeparam>
@@ -107,7 +112,7 @@ namespace MediaBrowser.Common
/// <summary>
/// Inits this instance.
/// </summary>
- Task Init(IServiceCollection serviceCollection);
+ Task InitAsync(IServiceCollection serviceCollection);
/// <summary>
/// Creates the instance.
diff --git a/MediaBrowser.Common/Properties/AssemblyInfo.cs b/MediaBrowser.Common/Properties/AssemblyInfo.cs
index 1a8fdb618..538e89fd1 100644
--- a/MediaBrowser.Common/Properties/AssemblyInfo.cs
+++ b/MediaBrowser.Common/Properties/AssemblyInfo.cs
@@ -9,8 +9,8 @@ using System.Runtime.InteropServices;
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Jellyfin Project")]
-[assembly: AssemblyProduct("Jellyfin: The Free Software Media System")]
-[assembly: AssemblyCopyright("Copyright © 2019 Jellyfin Contributors. Code released under the GNU General Public License Version 2")]
+[assembly: AssemblyProduct("Jellyfin Server")]
+[assembly: AssemblyCopyright("Copyright © 2019 Jellyfin Contributors. Code released under the GNU General Public License")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: NeutralResourcesLanguage("en")]
diff --git a/MediaBrowser.Common/Providers/SubtitleConfigurationFactory.cs b/MediaBrowser.Common/Providers/SubtitleConfigurationFactory.cs
new file mode 100644
index 000000000..09d974db6
--- /dev/null
+++ b/MediaBrowser.Common/Providers/SubtitleConfigurationFactory.cs
@@ -0,0 +1,18 @@
+using System.Collections.Generic;
+using MediaBrowser.Common.Configuration;
+using MediaBrowser.Model.Providers;
+
+namespace MediaBrowser.Common.Providers
+{
+ public class SubtitleConfigurationFactory : IConfigurationFactory
+ {
+ public IEnumerable<ConfigurationStore> GetConfigurations()
+ {
+ yield return new ConfigurationStore()
+ {
+ Key = "subtitles",
+ ConfigurationType = typeof(SubtitleOptions)
+ };
+ }
+ }
+}
diff --git a/MediaBrowser.Common/System/OperatingSystem.cs b/MediaBrowser.Common/System/OperatingSystem.cs
new file mode 100644
index 000000000..640821d4d
--- /dev/null
+++ b/MediaBrowser.Common/System/OperatingSystem.cs
@@ -0,0 +1,72 @@
+using System;
+using System.Runtime.InteropServices;
+using System.Threading;
+using MediaBrowser.Model.System;
+
+namespace MediaBrowser.Common.System
+{
+ public static class OperatingSystem
+ {
+ // We can't use Interlocked.CompareExchange for enums
+ private static int _id = int.MaxValue;
+
+ public static OperatingSystemId Id
+ {
+ get
+ {
+ if (_id == int.MaxValue)
+ {
+ Interlocked.CompareExchange(ref _id, (int)GetId(), int.MaxValue);
+ }
+
+ return (OperatingSystemId)_id;
+ }
+ }
+
+ public static string Name
+ {
+ get
+ {
+ switch (Id)
+ {
+ case OperatingSystemId.BSD: return "BSD";
+ case OperatingSystemId.Linux: return "Linux";
+ case OperatingSystemId.Darwin: return "macOS";
+ case OperatingSystemId.Windows: return "Windows";
+ default: throw new Exception($"Unknown OS {Id}");
+ }
+ }
+ }
+
+ private static OperatingSystemId GetId()
+ {
+ switch (Environment.OSVersion.Platform)
+ {
+ // On .NET Core `MacOSX` got replaced by `Unix`, this case should never be hit.
+ case PlatformID.MacOSX:
+ return OperatingSystemId.Darwin;
+ case PlatformID.Win32NT:
+ return OperatingSystemId.Windows;
+ case PlatformID.Unix:
+ default:
+ {
+ string osDescription = RuntimeInformation.OSDescription;
+ if (osDescription.IndexOf("linux", StringComparison.OrdinalIgnoreCase) != -1)
+ {
+ return OperatingSystemId.Linux;
+ }
+ else if (osDescription.IndexOf("darwin", StringComparison.OrdinalIgnoreCase) != -1)
+ {
+ return OperatingSystemId.Darwin;
+ }
+ else if (osDescription.IndexOf("bsd", StringComparison.OrdinalIgnoreCase) != -1)
+ {
+ return OperatingSystemId.BSD;
+ }
+
+ throw new Exception($"Can't resolve OS with description: '{osDescription}'");
+ }
+ }
+ }
+ }
+}
diff --git a/MediaBrowser.Controller/IServerApplicationHost.cs b/MediaBrowser.Controller/IServerApplicationHost.cs
index 22797aa0d..81b9ff0a5 100644
--- a/MediaBrowser.Controller/IServerApplicationHost.cs
+++ b/MediaBrowser.Controller/IServerApplicationHost.cs
@@ -83,8 +83,6 @@ namespace MediaBrowser.Controller
void EnableLoopback(string appName);
- string PackageRuntime { get; }
-
WakeOnLanInfo[] GetWakeOnLanInfo();
string ExpandVirtualPath(string path);
diff --git a/MediaBrowser.Controller/MediaEncoding/JobLogger.cs b/MediaBrowser.Controller/MediaEncoding/JobLogger.cs
index 46593fb2f..2755bf581 100644
--- a/MediaBrowser.Controller/MediaEncoding/JobLogger.cs
+++ b/MediaBrowser.Controller/MediaEncoding/JobLogger.cs
@@ -10,7 +10,7 @@ namespace MediaBrowser.Controller.MediaEncoding
{
public class JobLogger
{
- private readonly CultureInfo _usCulture = new CultureInfo("en-US");
+ private static readonly CultureInfo _usCulture = CultureInfo.ReadOnly(new CultureInfo("en-US"));
private readonly ILogger _logger;
public JobLogger(ILogger logger)
@@ -24,7 +24,7 @@ namespace MediaBrowser.Controller.MediaEncoding
{
using (var reader = new StreamReader(source))
{
- while (!reader.EndOfStream)
+ while (!reader.EndOfStream && reader.BaseStream.CanRead)
{
var line = await reader.ReadLineAsync().ConfigureAwait(false);
@@ -39,6 +39,13 @@ namespace MediaBrowser.Controller.MediaEncoding
}
await target.WriteAsync(bytes, 0, bytes.Length).ConfigureAwait(false);
+
+ // Check again, the stream could have been closed
+ if (!target.CanWrite)
+ {
+ break;
+ }
+
await target.FlushAsync().ConfigureAwait(false);
}
}
diff --git a/MediaBrowser.Controller/Properties/AssemblyInfo.cs b/MediaBrowser.Controller/Properties/AssemblyInfo.cs
index 007a1d739..60e792309 100644
--- a/MediaBrowser.Controller/Properties/AssemblyInfo.cs
+++ b/MediaBrowser.Controller/Properties/AssemblyInfo.cs
@@ -9,8 +9,8 @@ using System.Runtime.InteropServices;
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Jellyfin Project")]
-[assembly: AssemblyProduct("Jellyfin: The Free Software Media System")]
-[assembly: AssemblyCopyright("Copyright © 2019 Jellyfin Contributors. Code released under the GNU General Public License Version 2")]
+[assembly: AssemblyProduct("Jellyfin Server")]
+[assembly: AssemblyCopyright("Copyright © 2019 Jellyfin Contributors. Code released under the GNU General Public License")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: NeutralResourcesLanguage("en")]
diff --git a/MediaBrowser.LocalMetadata/Parsers/BaseItemXmlParser.cs b/MediaBrowser.LocalMetadata/Parsers/BaseItemXmlParser.cs
index 38458e34c..59c8f4da5 100644
--- a/MediaBrowser.LocalMetadata/Parsers/BaseItemXmlParser.cs
+++ b/MediaBrowser.LocalMetadata/Parsers/BaseItemXmlParser.cs
@@ -10,7 +10,6 @@ using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Providers;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.IO;
-using MediaBrowser.Model.Xml;
using Microsoft.Extensions.Logging;
namespace MediaBrowser.LocalMetadata.Parsers
@@ -30,19 +29,14 @@ namespace MediaBrowser.LocalMetadata.Parsers
private Dictionary<string, string> _validProviderIds;
- protected IXmlReaderSettingsFactory XmlReaderSettingsFactory { get; private set; }
- protected IFileSystem FileSystem { get; private set; }
-
/// <summary>
/// Initializes a new instance of the <see cref="BaseItemXmlParser{T}" /> class.
/// </summary>
/// <param name="logger">The logger.</param>
- public BaseItemXmlParser(ILogger logger, IProviderManager providerManager, IXmlReaderSettingsFactory xmlReaderSettingsFactory, IFileSystem fileSystem)
+ public BaseItemXmlParser(ILogger logger, IProviderManager providerManager)
{
Logger = logger;
ProviderManager = providerManager;
- XmlReaderSettingsFactory = xmlReaderSettingsFactory;
- FileSystem = fileSystem;
}
/// <summary>
@@ -64,11 +58,13 @@ namespace MediaBrowser.LocalMetadata.Parsers
throw new ArgumentException("The metadata file was empty or null.", nameof(metadataFile));
}
- var settings = XmlReaderSettingsFactory.Create(false);
-
- settings.CheckCharacters = false;
- settings.IgnoreProcessingInstructions = true;
- settings.IgnoreComments = true;
+ var settings = new XmlReaderSettings()
+ {
+ ValidationType = ValidationType.None,
+ CheckCharacters = false,
+ IgnoreProcessingInstructions = true,
+ IgnoreComments = true
+ };
_validProviderIds = _validProviderIds = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
@@ -103,29 +99,24 @@ namespace MediaBrowser.LocalMetadata.Parsers
item.ResetPeople();
using (var fileStream = File.OpenRead(metadataFile))
+ using (var streamReader = new StreamReader(fileStream, encoding))
+ using (var reader = XmlReader.Create(streamReader, settings))
{
- using (var streamReader = new StreamReader(fileStream, encoding))
+ reader.MoveToContent();
+ reader.Read();
+
+ // Loop through each element
+ while (!reader.EOF && reader.ReadState == ReadState.Interactive)
{
- // Use XmlReader for best performance
- using (var reader = XmlReader.Create(streamReader, settings))
+ cancellationToken.ThrowIfCancellationRequested();
+
+ if (reader.NodeType == XmlNodeType.Element)
+ {
+ FetchDataFromXmlNode(reader, item);
+ }
+ else
{
- reader.MoveToContent();
reader.Read();
-
- // Loop through each element
- while (!reader.EOF && reader.ReadState == ReadState.Interactive)
- {
- cancellationToken.ThrowIfCancellationRequested();
-
- if (reader.NodeType == XmlNodeType.Element)
- {
- FetchDataFromXmlNode(reader, item);
- }
- else
- {
- reader.Read();
- }
- }
}
}
}
diff --git a/MediaBrowser.LocalMetadata/Parsers/BoxSetXmlParser.cs b/MediaBrowser.LocalMetadata/Parsers/BoxSetXmlParser.cs
index e595e9d06..127334625 100644
--- a/MediaBrowser.LocalMetadata/Parsers/BoxSetXmlParser.cs
+++ b/MediaBrowser.LocalMetadata/Parsers/BoxSetXmlParser.cs
@@ -3,8 +3,6 @@ using System.Xml;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Entities.Movies;
using MediaBrowser.Controller.Providers;
-using MediaBrowser.Model.IO;
-using MediaBrowser.Model.Xml;
using Microsoft.Extensions.Logging;
namespace MediaBrowser.LocalMetadata.Parsers
@@ -87,7 +85,8 @@ namespace MediaBrowser.LocalMetadata.Parsers
item.Item.LinkedChildren = list.ToArray();
}
- public BoxSetXmlParser(ILogger logger, IProviderManager providerManager, IXmlReaderSettingsFactory xmlReaderSettingsFactory, IFileSystem fileSystem) : base(logger, providerManager, xmlReaderSettingsFactory, fileSystem)
+ public BoxSetXmlParser(ILogger logger, IProviderManager providerManager)
+ : base(logger, providerManager)
{
}
}
diff --git a/MediaBrowser.LocalMetadata/Parsers/PlaylistXmlParser.cs b/MediaBrowser.LocalMetadata/Parsers/PlaylistXmlParser.cs
index ff69cb023..5608a0be9 100644
--- a/MediaBrowser.LocalMetadata/Parsers/PlaylistXmlParser.cs
+++ b/MediaBrowser.LocalMetadata/Parsers/PlaylistXmlParser.cs
@@ -3,8 +3,6 @@ using System.Xml;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Playlists;
using MediaBrowser.Controller.Providers;
-using MediaBrowser.Model.IO;
-using MediaBrowser.Model.Xml;
using Microsoft.Extensions.Logging;
namespace MediaBrowser.LocalMetadata.Parsers
@@ -95,7 +93,8 @@ namespace MediaBrowser.LocalMetadata.Parsers
item.LinkedChildren = list.ToArray();
}
- public PlaylistXmlParser(ILogger logger, IProviderManager providerManager, IXmlReaderSettingsFactory xmlReaderSettingsFactory, IFileSystem fileSystem) : base(logger, providerManager, xmlReaderSettingsFactory, fileSystem)
+ public PlaylistXmlParser(ILogger logger, IProviderManager providerManager)
+ : base(logger, providerManager)
{
}
}
diff --git a/MediaBrowser.LocalMetadata/Properties/AssemblyInfo.cs b/MediaBrowser.LocalMetadata/Properties/AssemblyInfo.cs
index 3eac83708..580cef9da 100644
--- a/MediaBrowser.LocalMetadata/Properties/AssemblyInfo.cs
+++ b/MediaBrowser.LocalMetadata/Properties/AssemblyInfo.cs
@@ -9,8 +9,8 @@ using System.Runtime.InteropServices;
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Jellyfin Project")]
-[assembly: AssemblyProduct("Jellyfin: The Free Software Media System")]
-[assembly: AssemblyCopyright("Copyright © 2019 Jellyfin Contributors. Code released under the GNU General Public License Version 2")]
+[assembly: AssemblyProduct("Jellyfin Server")]
+[assembly: AssemblyCopyright("Copyright © 2019 Jellyfin Contributors. Code released under the GNU General Public License")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: NeutralResourcesLanguage("en")]
diff --git a/MediaBrowser.LocalMetadata/Providers/BoxSetXmlProvider.cs b/MediaBrowser.LocalMetadata/Providers/BoxSetXmlProvider.cs
index 539f818c6..2e303efab 100644
--- a/MediaBrowser.LocalMetadata/Providers/BoxSetXmlProvider.cs
+++ b/MediaBrowser.LocalMetadata/Providers/BoxSetXmlProvider.cs
@@ -4,7 +4,6 @@ using MediaBrowser.Controller.Entities.Movies;
using MediaBrowser.Controller.Providers;
using MediaBrowser.LocalMetadata.Parsers;
using MediaBrowser.Model.IO;
-using MediaBrowser.Model.Xml;
using Microsoft.Extensions.Logging;
namespace MediaBrowser.LocalMetadata.Providers
@@ -16,19 +15,17 @@ namespace MediaBrowser.LocalMetadata.Providers
{
private readonly ILogger _logger;
private readonly IProviderManager _providerManager;
- protected IXmlReaderSettingsFactory XmlReaderSettingsFactory { get; private set; }
- public BoxSetXmlProvider(IFileSystem fileSystem, ILogger logger, IProviderManager providerManager, IXmlReaderSettingsFactory xmlReaderSettingsFactory)
+ public BoxSetXmlProvider(IFileSystem fileSystem, ILogger logger, IProviderManager providerManager)
: base(fileSystem)
{
_logger = logger;
_providerManager = providerManager;
- XmlReaderSettingsFactory = xmlReaderSettingsFactory;
}
protected override void Fetch(MetadataResult<BoxSet> result, string path, CancellationToken cancellationToken)
{
- new BoxSetXmlParser(_logger, _providerManager, XmlReaderSettingsFactory, FileSystem).Fetch(result, path, cancellationToken);
+ new BoxSetXmlParser(_logger, _providerManager).Fetch(result, path, cancellationToken);
}
protected override FileSystemMetadata GetXmlFile(ItemInfo info, IDirectoryService directoryService)
diff --git a/MediaBrowser.LocalMetadata/Providers/PlaylistXmlProvider.cs b/MediaBrowser.LocalMetadata/Providers/PlaylistXmlProvider.cs
index 442a18cb9..d111ae9ba 100644
--- a/MediaBrowser.LocalMetadata/Providers/PlaylistXmlProvider.cs
+++ b/MediaBrowser.LocalMetadata/Providers/PlaylistXmlProvider.cs
@@ -4,7 +4,6 @@ using MediaBrowser.Controller.Providers;
using MediaBrowser.LocalMetadata.Parsers;
using MediaBrowser.LocalMetadata.Savers;
using MediaBrowser.Model.IO;
-using MediaBrowser.Model.Xml;
using Microsoft.Extensions.Logging;
namespace MediaBrowser.LocalMetadata.Providers
@@ -13,19 +12,17 @@ namespace MediaBrowser.LocalMetadata.Providers
{
private readonly ILogger _logger;
private readonly IProviderManager _providerManager;
- protected IXmlReaderSettingsFactory XmlReaderSettingsFactory { get; private set; }
- public PlaylistXmlProvider(IFileSystem fileSystem, ILogger logger, IProviderManager providerManager, IXmlReaderSettingsFactory xmlReaderSettingsFactory)
+ public PlaylistXmlProvider(IFileSystem fileSystem, ILogger logger, IProviderManager providerManager)
: base(fileSystem)
{
_logger = logger;
_providerManager = providerManager;
- XmlReaderSettingsFactory = xmlReaderSettingsFactory;
}
protected override void Fetch(MetadataResult<Playlist> result, string path, CancellationToken cancellationToken)
{
- new PlaylistXmlParser(_logger, _providerManager, XmlReaderSettingsFactory, FileSystem).Fetch(result, path, cancellationToken);
+ new PlaylistXmlParser(_logger, _providerManager).Fetch(result, path, cancellationToken);
}
protected override FileSystemMetadata GetXmlFile(ItemInfo info, IDirectoryService directoryService)
diff --git a/MediaBrowser.LocalMetadata/Savers/BaseXmlSaver.cs b/MediaBrowser.LocalMetadata/Savers/BaseXmlSaver.cs
index 438b84252..30a33b729 100644
--- a/MediaBrowser.LocalMetadata/Savers/BaseXmlSaver.cs
+++ b/MediaBrowser.LocalMetadata/Savers/BaseXmlSaver.cs
@@ -14,7 +14,6 @@ using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.Playlists;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.IO;
-using MediaBrowser.Model.Xml;
using Microsoft.Extensions.Logging;
namespace MediaBrowser.LocalMetadata.Savers
@@ -23,7 +22,7 @@ namespace MediaBrowser.LocalMetadata.Savers
{
private static readonly CultureInfo UsCulture = new CultureInfo("en-US");
- public BaseXmlSaver(IFileSystem fileSystem, IServerConfigurationManager configurationManager, ILibraryManager libraryManager, IUserManager userManager, IUserDataManager userDataManager, ILogger logger, IXmlReaderSettingsFactory xmlReaderSettingsFactory)
+ public BaseXmlSaver(IFileSystem fileSystem, IServerConfigurationManager configurationManager, ILibraryManager libraryManager, IUserManager userManager, IUserDataManager userDataManager, ILogger logger)
{
FileSystem = fileSystem;
ConfigurationManager = configurationManager;
@@ -31,7 +30,6 @@ namespace MediaBrowser.LocalMetadata.Savers
UserManager = userManager;
UserDataManager = userDataManager;
Logger = logger;
- XmlReaderSettingsFactory = xmlReaderSettingsFactory;
}
protected IFileSystem FileSystem { get; private set; }
@@ -40,9 +38,6 @@ namespace MediaBrowser.LocalMetadata.Savers
protected IUserManager UserManager { get; private set; }
protected IUserDataManager UserDataManager { get; private set; }
protected ILogger Logger { get; private set; }
- protected IXmlReaderSettingsFactory XmlReaderSettingsFactory { get; private set; }
-
- protected ItemUpdateType MinimumUpdateType => ItemUpdateType.MetadataDownload;
public string Name => XmlProviderUtils.Name;
diff --git a/MediaBrowser.LocalMetadata/Savers/BoxSetXmlSaver.cs b/MediaBrowser.LocalMetadata/Savers/BoxSetXmlSaver.cs
index b4d5440a5..ea939e33b 100644
--- a/MediaBrowser.LocalMetadata/Savers/BoxSetXmlSaver.cs
+++ b/MediaBrowser.LocalMetadata/Savers/BoxSetXmlSaver.cs
@@ -5,7 +5,6 @@ using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Entities.Movies;
using MediaBrowser.Controller.Library;
using MediaBrowser.Model.IO;
-using MediaBrowser.Model.Xml;
using Microsoft.Extensions.Logging;
namespace MediaBrowser.LocalMetadata.Savers
@@ -31,7 +30,8 @@ namespace MediaBrowser.LocalMetadata.Savers
return Path.Combine(item.Path, "collection.xml");
}
- public BoxSetXmlSaver(IFileSystem fileSystem, IServerConfigurationManager configurationManager, ILibraryManager libraryManager, IUserManager userManager, IUserDataManager userDataManager, ILogger logger, IXmlReaderSettingsFactory xmlReaderSettingsFactory) : base(fileSystem, configurationManager, libraryManager, userManager, userDataManager, logger, xmlReaderSettingsFactory)
+ public BoxSetXmlSaver(IFileSystem fileSystem, IServerConfigurationManager configurationManager, ILibraryManager libraryManager, IUserManager userManager, IUserDataManager userDataManager, ILogger logger)
+ : base(fileSystem, configurationManager, libraryManager, userManager, userDataManager, logger)
{
}
}
diff --git a/MediaBrowser.LocalMetadata/Savers/PlaylistXmlSaver.cs b/MediaBrowser.LocalMetadata/Savers/PlaylistXmlSaver.cs
index 09bb6d8f7..35a431fa4 100644
--- a/MediaBrowser.LocalMetadata/Savers/PlaylistXmlSaver.cs
+++ b/MediaBrowser.LocalMetadata/Savers/PlaylistXmlSaver.cs
@@ -5,7 +5,6 @@ using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.Playlists;
using MediaBrowser.Model.IO;
-using MediaBrowser.Model.Xml;
using Microsoft.Extensions.Logging;
namespace MediaBrowser.LocalMetadata.Savers
@@ -49,7 +48,8 @@ namespace MediaBrowser.LocalMetadata.Savers
return Path.Combine(path, "playlist.xml");
}
- public PlaylistXmlSaver(IFileSystem fileSystem, IServerConfigurationManager configurationManager, ILibraryManager libraryManager, IUserManager userManager, IUserDataManager userDataManager, ILogger logger, IXmlReaderSettingsFactory xmlReaderSettingsFactory) : base(fileSystem, configurationManager, libraryManager, userManager, userDataManager, logger, xmlReaderSettingsFactory)
+ public PlaylistXmlSaver(IFileSystem fileSystem, IServerConfigurationManager configurationManager, ILibraryManager libraryManager, IUserManager userManager, IUserDataManager userDataManager, ILogger logger)
+ : base(fileSystem, configurationManager, libraryManager, userManager, userDataManager, logger)
{
}
}
diff --git a/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs b/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs
index 94beda3db..4867c0f85 100644
--- a/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs
+++ b/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs
@@ -16,6 +16,7 @@ using MediaBrowser.Model.Configuration;
using MediaBrowser.Model.Diagnostics;
using MediaBrowser.Model.Dlna;
using MediaBrowser.Model.Entities;
+using MediaBrowser.Model.Globalization;
using MediaBrowser.Model.IO;
using MediaBrowser.Model.MediaInfo;
using MediaBrowser.Model.Serialization;
@@ -51,32 +52,32 @@ namespace MediaBrowser.MediaEncoding.Encoder
private readonly IProcessFactory _processFactory;
private readonly int DefaultImageExtractionTimeoutMs;
private readonly string StartupOptionFFmpegPath;
- private readonly string StartupOptionFFprobePath;
private readonly SemaphoreSlim _thumbnailResourcePool = new SemaphoreSlim(1, 1);
private readonly List<ProcessWrapper> _runningProcesses = new List<ProcessWrapper>();
+ private readonly ILocalizationManager _localization;
public MediaEncoder(
ILoggerFactory loggerFactory,
IJsonSerializer jsonSerializer,
string startupOptionsFFmpegPath,
- string startupOptionsFFprobePath,
IServerConfigurationManager configurationManager,
IFileSystem fileSystem,
Func<ISubtitleEncoder> subtitleEncoder,
Func<IMediaSourceManager> mediaSourceManager,
IProcessFactory processFactory,
- int defaultImageExtractionTimeoutMs)
+ int defaultImageExtractionTimeoutMs,
+ ILocalizationManager localization)
{
_logger = loggerFactory.CreateLogger(nameof(MediaEncoder));
_jsonSerializer = jsonSerializer;
StartupOptionFFmpegPath = startupOptionsFFmpegPath;
- StartupOptionFFprobePath = startupOptionsFFprobePath;
ConfigurationManager = configurationManager;
FileSystem = fileSystem;
SubtitleEncoder = subtitleEncoder;
_processFactory = processFactory;
DefaultImageExtractionTimeoutMs = defaultImageExtractionTimeoutMs;
+ _localization = localization;
}
/// <summary>
@@ -86,12 +87,6 @@ namespace MediaBrowser.MediaEncoding.Encoder
/// </summary>
public void SetFFmpegPath()
{
- // ToDo - Finalise removal of the --ffprobe switch
- if (!string.IsNullOrEmpty(StartupOptionFFprobePath))
- {
- _logger.LogWarning("--ffprobe switch is deprecated and shall be removed in the next release");
- }
-
// 1) Custom path stored in config/encoding xml file under tag <EncoderAppPath> takes precedence
if (!ValidatePath(ConfigurationManager.GetConfiguration<EncodingOptions>("encoding").EncoderAppPath, FFmpegLocation.Custom))
{
@@ -422,7 +417,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
}
}
- return new ProbeResultNormalizer(_logger, FileSystem).GetMediaInfo(result, videoType, isAudio, primaryPath, protocol);
+ return new ProbeResultNormalizer(_logger, FileSystem, _localization).GetMediaInfo(result, videoType, isAudio, primaryPath, protocol);
}
}
diff --git a/MediaBrowser.MediaEncoding/MediaBrowser.MediaEncoding.csproj b/MediaBrowser.MediaEncoding/MediaBrowser.MediaEncoding.csproj
index 68b8bd4fa..e4757543e 100644
--- a/MediaBrowser.MediaEncoding/MediaBrowser.MediaEncoding.csproj
+++ b/MediaBrowser.MediaEncoding/MediaBrowser.MediaEncoding.csproj
@@ -14,7 +14,6 @@
<ProjectReference Include="..\MediaBrowser.Common\MediaBrowser.Common.csproj" />
<ProjectReference Include="..\MediaBrowser.Controller\MediaBrowser.Controller.csproj" />
<ProjectReference Include="..\MediaBrowser.Model\MediaBrowser.Model.csproj" />
- <ProjectReference Include="..\OpenSubtitlesHandler\OpenSubtitlesHandler.csproj" />
</ItemGroup>
<ItemGroup>
diff --git a/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs b/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs
index 5099ccb2a..54d02fc9f 100644
--- a/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs
+++ b/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs
@@ -9,6 +9,7 @@ using MediaBrowser.Controller.Library;
using MediaBrowser.Model.Dto;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Extensions;
+using MediaBrowser.Model.Globalization;
using MediaBrowser.Model.IO;
using MediaBrowser.Model.MediaInfo;
using Microsoft.Extensions.Logging;
@@ -20,11 +21,13 @@ namespace MediaBrowser.MediaEncoding.Probing
private readonly CultureInfo _usCulture = new CultureInfo("en-US");
private readonly ILogger _logger;
private readonly IFileSystem _fileSystem;
+ private readonly ILocalizationManager _localization;
- public ProbeResultNormalizer(ILogger logger, IFileSystem fileSystem)
+ public ProbeResultNormalizer(ILogger logger, IFileSystem fileSystem, ILocalizationManager localization)
{
_logger = logger;
_fileSystem = fileSystem;
+ _localization = localization;
}
public MediaInfo GetMediaInfo(InternalMediaInfoResult data, VideoType? videoType, bool isAudio, string path, MediaProtocol protocol)
@@ -246,52 +249,49 @@ namespace MediaBrowser.MediaEncoding.Probing
// <?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>cast</key>\n\t<array>\n\t\t<dict>\n\t\t\t<key>name</key>\n\t\t\t<string>Blender Foundation</string>\n\t\t</dict>\n\t\t<dict>\n\t\t\t<key>name</key>\n\t\t\t<string>Janus Bager Kristensen</string>\n\t\t</dict>\n\t</array>\n\t<key>directors</key>\n\t<array>\n\t\t<dict>\n\t\t\t<key>name</key>\n\t\t\t<string>Sacha Goedegebure</string>\n\t\t</dict>\n\t</array>\n\t<key>studio</key>\n\t<string>Blender Foundation</string>\n</dict>\n</plist>\n
using (var stream = new MemoryStream(Encoding.UTF8.GetBytes(xml)))
+ using (var streamReader = new StreamReader(stream))
{
- using (var streamReader = new StreamReader(stream))
+ try
{
- try
+ using (var reader = XmlReader.Create(streamReader))
{
- // Use XmlReader for best performance
- using (var reader = XmlReader.Create(streamReader))
- {
- reader.MoveToContent();
- reader.Read();
+ reader.MoveToContent();
+ reader.Read();
- // Loop through each element
- while (!reader.EOF && reader.ReadState == ReadState.Interactive)
+ // Loop through each element
+ while (!reader.EOF && reader.ReadState == ReadState.Interactive)
+ {
+ if (reader.NodeType == XmlNodeType.Element)
{
- if (reader.NodeType == XmlNodeType.Element)
+ switch (reader.Name)
{
- switch (reader.Name)
- {
- case "dict":
- if (reader.IsEmptyElement)
- {
- reader.Read();
- continue;
- }
- using (var subtree = reader.ReadSubtree())
- {
- ReadFromDictNode(subtree, info);
- }
- break;
- default:
- reader.Skip();
- break;
- }
- }
- else
- {
- reader.Read();
+ case "dict":
+ if (reader.IsEmptyElement)
+ {
+ reader.Read();
+ continue;
+ }
+ using (var subtree = reader.ReadSubtree())
+ {
+ ReadFromDictNode(subtree, info);
+ }
+ break;
+ default:
+ reader.Skip();
+ break;
}
}
+ else
+ {
+ reader.Read();
+ }
}
}
- catch (XmlException)
- {
- // I've seen probe examples where the iTunMOVI value is just "<"
- // So we should not allow this to fail the entire probing operation
- }
+ }
+ catch (XmlException)
+ {
+ // I've seen probe examples where the iTunMOVI value is just "<"
+ // So we should not allow this to fail the entire probing operation
}
}
}
@@ -599,6 +599,9 @@ namespace MediaBrowser.MediaEncoding.Probing
{
stream.Type = MediaStreamType.Subtitle;
stream.Codec = NormalizeSubtitleCodec(stream.Codec);
+ stream.localizedUndefined = _localization.GetLocalizedString("Undefined");
+ stream.localizedDefault = _localization.GetLocalizedString("Default");
+ stream.localizedForced = _localization.GetLocalizedString("Forced");
}
else if (string.Equals(streamInfo.codec_type, "video", StringComparison.OrdinalIgnoreCase))
{
diff --git a/MediaBrowser.MediaEncoding/Properties/AssemblyInfo.cs b/MediaBrowser.MediaEncoding/Properties/AssemblyInfo.cs
index 6ecdf89bc..a9491374b 100644
--- a/MediaBrowser.MediaEncoding/Properties/AssemblyInfo.cs
+++ b/MediaBrowser.MediaEncoding/Properties/AssemblyInfo.cs
@@ -9,8 +9,8 @@ using System.Runtime.InteropServices;
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Jellyfin Project")]
-[assembly: AssemblyProduct("Jellyfin: The Free Software Media System")]
-[assembly: AssemblyCopyright("Copyright © 2019 Jellyfin Contributors. Code released under the GNU General Public License Version 2")]
+[assembly: AssemblyProduct("Jellyfin Server")]
+[assembly: AssemblyCopyright("Copyright © 2019 Jellyfin Contributors. Code released under the GNU General Public License")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: NeutralResourcesLanguage("en")]
diff --git a/MediaBrowser.MediaEncoding/Subtitles/ConfigurationExtension.cs b/MediaBrowser.MediaEncoding/Subtitles/ConfigurationExtension.cs
deleted file mode 100644
index 92544f4f6..000000000
--- a/MediaBrowser.MediaEncoding/Subtitles/ConfigurationExtension.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-using System.Collections.Generic;
-using MediaBrowser.Common.Configuration;
-using MediaBrowser.Model.Providers;
-
-namespace MediaBrowser.MediaEncoding.Subtitles
-{
- public static class ConfigurationExtension
- {
- public static SubtitleOptions GetSubtitleConfiguration(this IConfigurationManager manager)
- {
- return manager.GetConfiguration<SubtitleOptions>("subtitles");
- }
- }
-
- public class SubtitleConfigurationFactory : IConfigurationFactory
- {
- public IEnumerable<ConfigurationStore> GetConfigurations()
- {
- return new List<ConfigurationStore>
- {
- new ConfigurationStore
- {
- Key = "subtitles",
- ConfigurationType = typeof (SubtitleOptions)
- }
- };
- }
- }
-}
diff --git a/MediaBrowser.MediaEncoding/Subtitles/OpenSubtitleDownloader.cs b/MediaBrowser.MediaEncoding/Subtitles/OpenSubtitleDownloader.cs
deleted file mode 100644
index a7e3f6197..000000000
--- a/MediaBrowser.MediaEncoding/Subtitles/OpenSubtitleDownloader.cs
+++ /dev/null
@@ -1,347 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Globalization;
-using System.IO;
-using System.Linq;
-using System.Text;
-using System.Threading;
-using System.Threading.Tasks;
-using MediaBrowser.Common.Configuration;
-using MediaBrowser.Common.Extensions;
-using MediaBrowser.Common.Net;
-using MediaBrowser.Controller.Configuration;
-using MediaBrowser.Controller.Providers;
-using MediaBrowser.Controller.Security;
-using MediaBrowser.Controller.Subtitles;
-using MediaBrowser.Model.Dto;
-using MediaBrowser.Model.Entities;
-using MediaBrowser.Model.IO;
-using MediaBrowser.Model.Providers;
-using MediaBrowser.Model.Serialization;
-using Microsoft.Extensions.Logging;
-using OpenSubtitlesHandler;
-
-namespace MediaBrowser.MediaEncoding.Subtitles
-{
- public class OpenSubtitleDownloader : ISubtitleProvider, IDisposable
- {
- private readonly ILogger _logger;
- private readonly IHttpClient _httpClient;
- private readonly CultureInfo _usCulture = new CultureInfo("en-US");
-
- private readonly IServerConfigurationManager _config;
-
- private readonly IJsonSerializer _json;
- private readonly IFileSystem _fileSystem;
-
- public OpenSubtitleDownloader(ILoggerFactory loggerFactory, IHttpClient httpClient, IServerConfigurationManager config, IJsonSerializer json, IFileSystem fileSystem)
- {
- _logger = loggerFactory.CreateLogger(GetType().Name);
- _httpClient = httpClient;
- _config = config;
- _json = json;
- _fileSystem = fileSystem;
-
- _config.NamedConfigurationUpdating += _config_NamedConfigurationUpdating;
-
- Utilities.HttpClient = httpClient;
- OpenSubtitles.SetUserAgent("jellyfin");
- }
-
- private const string PasswordHashPrefix = "h:";
- void _config_NamedConfigurationUpdating(object sender, ConfigurationUpdateEventArgs e)
- {
- if (!string.Equals(e.Key, "subtitles", StringComparison.OrdinalIgnoreCase))
- {
- return;
- }
-
- var options = (SubtitleOptions)e.NewConfiguration;
-
- if (options != null &&
- !string.IsNullOrWhiteSpace(options.OpenSubtitlesPasswordHash) &&
- !options.OpenSubtitlesPasswordHash.StartsWith(PasswordHashPrefix, StringComparison.OrdinalIgnoreCase))
- {
- options.OpenSubtitlesPasswordHash = EncodePassword(options.OpenSubtitlesPasswordHash);
- }
- }
-
- private static string EncodePassword(string password)
- {
- var bytes = Encoding.UTF8.GetBytes(password);
- return PasswordHashPrefix + Convert.ToBase64String(bytes);
- }
-
- private static string DecodePassword(string password)
- {
- if (password == null ||
- !password.StartsWith(PasswordHashPrefix, StringComparison.OrdinalIgnoreCase))
- {
- return string.Empty;
- }
-
- var bytes = Convert.FromBase64String(password.Substring(2));
- return Encoding.UTF8.GetString(bytes, 0, bytes.Length);
- }
-
- public string Name => "Open Subtitles";
-
- private SubtitleOptions GetOptions()
- {
- return _config.GetSubtitleConfiguration();
- }
-
- public IEnumerable<VideoContentType> SupportedMediaTypes
- {
- get
- {
- var options = GetOptions();
-
- if (string.IsNullOrWhiteSpace(options.OpenSubtitlesUsername) ||
- string.IsNullOrWhiteSpace(options.OpenSubtitlesPasswordHash))
- {
- return new VideoContentType[] { };
- }
-
- return new[] { VideoContentType.Episode, VideoContentType.Movie };
- }
- }
-
- public Task<SubtitleResponse> GetSubtitles(string id, CancellationToken cancellationToken)
- {
- return GetSubtitlesInternal(id, GetOptions(), cancellationToken);
- }
-
- private DateTime _lastRateLimitException;
- private async Task<SubtitleResponse> GetSubtitlesInternal(string id,
- SubtitleOptions options,
- CancellationToken cancellationToken)
- {
- if (string.IsNullOrWhiteSpace(id))
- {
- throw new ArgumentNullException(nameof(id));
- }
-
- var idParts = id.Split(new[] { '-' }, 3);
-
- var format = idParts[0];
- var language = idParts[1];
- var ossId = idParts[2];
-
- var downloadsList = new[] { int.Parse(ossId, _usCulture) };
-
- await Login(cancellationToken).ConfigureAwait(false);
-
- if ((DateTime.UtcNow - _lastRateLimitException).TotalHours < 1)
- {
- throw new RateLimitExceededException("OpenSubtitles rate limit reached");
- }
-
- var resultDownLoad = await OpenSubtitles.DownloadSubtitlesAsync(downloadsList, cancellationToken).ConfigureAwait(false);
-
- if ((resultDownLoad.Status ?? string.Empty).IndexOf("407", StringComparison.OrdinalIgnoreCase) != -1)
- {
- _lastRateLimitException = DateTime.UtcNow;
- throw new RateLimitExceededException("OpenSubtitles rate limit reached");
- }
-
- if (!(resultDownLoad is MethodResponseSubtitleDownload))
- {
- throw new Exception("Invalid response type");
- }
-
- var results = ((MethodResponseSubtitleDownload)resultDownLoad).Results;
-
- _lastRateLimitException = DateTime.MinValue;
-
- if (results.Count == 0)
- {
- var msg = string.Format("Subtitle with Id {0} was not found. Name: {1}. Status: {2}. Message: {3}",
- ossId,
- resultDownLoad.Name ?? string.Empty,
- resultDownLoad.Status ?? string.Empty,
- resultDownLoad.Message ?? string.Empty);
-
- throw new ResourceNotFoundException(msg);
- }
-
- var data = Convert.FromBase64String(results.First().Data);
-
- return new SubtitleResponse
- {
- Format = format,
- Language = language,
-
- Stream = new MemoryStream(Utilities.Decompress(new MemoryStream(data)))
- };
- }
-
- private DateTime _lastLogin;
- private async Task Login(CancellationToken cancellationToken)
- {
- if ((DateTime.UtcNow - _lastLogin).TotalSeconds < 60)
- {
- return;
- }
-
- var options = GetOptions();
-
- var user = options.OpenSubtitlesUsername ?? string.Empty;
- var password = DecodePassword(options.OpenSubtitlesPasswordHash);
-
- var loginResponse = await OpenSubtitles.LogInAsync(user, password, "en", cancellationToken).ConfigureAwait(false);
-
- if (!(loginResponse is MethodResponseLogIn))
- {
- throw new Exception("Authentication to OpenSubtitles failed.");
- }
-
- _lastLogin = DateTime.UtcNow;
- }
-
- public async Task<IEnumerable<NameIdPair>> GetSupportedLanguages(CancellationToken cancellationToken)
- {
- await Login(cancellationToken).ConfigureAwait(false);
-
- var result = OpenSubtitles.GetSubLanguages("en");
- if (!(result is MethodResponseGetSubLanguages))
- {
- _logger.LogError("Invalid response type");
- return new List<NameIdPair>();
- }
-
- var results = ((MethodResponseGetSubLanguages)result).Languages;
-
- return results.Select(i => new NameIdPair
- {
- Name = i.LanguageName,
- Id = i.SubLanguageID
- });
- }
-
- private string NormalizeLanguage(string language)
- {
- // Problem with Greek subtitle download #1349
- if (string.Equals(language, "gre", StringComparison.OrdinalIgnoreCase))
- {
-
- return "ell";
- }
-
- return language;
- }
-
- public async Task<IEnumerable<RemoteSubtitleInfo>> Search(SubtitleSearchRequest request, CancellationToken cancellationToken)
- {
- var imdbIdText = request.GetProviderId(MetadataProviders.Imdb);
- long imdbId = 0;
-
- switch (request.ContentType)
- {
- case VideoContentType.Episode:
- if (!request.IndexNumber.HasValue || !request.ParentIndexNumber.HasValue || string.IsNullOrEmpty(request.SeriesName))
- {
- _logger.LogDebug("Episode information missing");
- return new List<RemoteSubtitleInfo>();
- }
- break;
- case VideoContentType.Movie:
- if (string.IsNullOrEmpty(request.Name))
- {
- _logger.LogDebug("Movie name missing");
- return new List<RemoteSubtitleInfo>();
- }
- if (string.IsNullOrWhiteSpace(imdbIdText) || !long.TryParse(imdbIdText.TrimStart('t'), NumberStyles.Any, _usCulture, out imdbId))
- {
- _logger.LogDebug("Imdb id missing");
- return new List<RemoteSubtitleInfo>();
- }
- break;
- }
-
- if (string.IsNullOrEmpty(request.MediaPath))
- {
- _logger.LogDebug("Path Missing");
- return new List<RemoteSubtitleInfo>();
- }
-
- await Login(cancellationToken).ConfigureAwait(false);
-
- var subLanguageId = NormalizeLanguage(request.Language);
- string hash;
-
- using (var fileStream = File.OpenRead(request.MediaPath))
- {
- hash = Utilities.ComputeHash(fileStream);
- }
- var fileInfo = _fileSystem.GetFileInfo(request.MediaPath);
- var movieByteSize = fileInfo.Length;
- var searchImdbId = request.ContentType == VideoContentType.Movie ? imdbId.ToString(_usCulture) : "";
- var subtitleSearchParameters = request.ContentType == VideoContentType.Episode
- ? new List<SubtitleSearchParameters> {
- new SubtitleSearchParameters(subLanguageId,
- query: request.SeriesName,
- season: request.ParentIndexNumber.Value.ToString(_usCulture),
- episode: request.IndexNumber.Value.ToString(_usCulture))
- }
- : new List<SubtitleSearchParameters> {
- new SubtitleSearchParameters(subLanguageId, imdbid: searchImdbId),
- new SubtitleSearchParameters(subLanguageId, query: request.Name, imdbid: searchImdbId)
- };
- var parms = new List<SubtitleSearchParameters> {
- new SubtitleSearchParameters( subLanguageId,
- movieHash: hash,
- movieByteSize: movieByteSize,
- imdbid: searchImdbId ),
- };
- parms.AddRange(subtitleSearchParameters);
- var result = await OpenSubtitles.SearchSubtitlesAsync(parms.ToArray(), cancellationToken).ConfigureAwait(false);
- if (!(result is MethodResponseSubtitleSearch))
- {
- _logger.LogError("Invalid response type");
- return new List<RemoteSubtitleInfo>();
- }
-
- Predicate<SubtitleSearchResult> mediaFilter =
- x =>
- request.ContentType == VideoContentType.Episode
- ? !string.IsNullOrEmpty(x.SeriesSeason) && !string.IsNullOrEmpty(x.SeriesEpisode) &&
- int.Parse(x.SeriesSeason, _usCulture) == request.ParentIndexNumber &&
- int.Parse(x.SeriesEpisode, _usCulture) == request.IndexNumber
- : !string.IsNullOrEmpty(x.IDMovieImdb) && long.Parse(x.IDMovieImdb, _usCulture) == imdbId;
-
- var results = ((MethodResponseSubtitleSearch)result).Results;
-
- // Avoid implicitly captured closure
- var hasCopy = hash;
-
- return results.Where(x => x.SubBad == "0" && mediaFilter(x) && (!request.IsPerfectMatch || string.Equals(x.MovieHash, hash, StringComparison.OrdinalIgnoreCase)))
- .OrderBy(x => (string.Equals(x.MovieHash, hash, StringComparison.OrdinalIgnoreCase) ? 0 : 1))
- .ThenBy(x => Math.Abs(long.Parse(x.MovieByteSize, _usCulture) - movieByteSize))
- .ThenByDescending(x => int.Parse(x.SubDownloadsCnt, _usCulture))
- .ThenByDescending(x => double.Parse(x.SubRating, _usCulture))
- .Select(i => new RemoteSubtitleInfo
- {
- Author = i.UserNickName,
- Comment = i.SubAuthorComment,
- CommunityRating = float.Parse(i.SubRating, _usCulture),
- DownloadCount = int.Parse(i.SubDownloadsCnt, _usCulture),
- Format = i.SubFormat,
- ProviderName = Name,
- ThreeLetterISOLanguageName = i.SubLanguageID,
-
- Id = i.SubFormat + "-" + i.SubLanguageID + "-" + i.IDSubtitleFile,
-
- Name = i.SubFileName,
- DateCreated = DateTime.Parse(i.SubAddDate, _usCulture),
- IsHashMatch = i.MovieHash == hasCopy
-
- }).Where(i => !string.Equals(i.Format, "sub", StringComparison.OrdinalIgnoreCase) && !string.Equals(i.Format, "idx", StringComparison.OrdinalIgnoreCase));
- }
-
- public void Dispose()
- {
- _config.NamedConfigurationUpdating -= _config_NamedConfigurationUpdating;
- }
- }
-}
diff --git a/MediaBrowser.Model/Entities/MediaStream.cs b/MediaBrowser.Model/Entities/MediaStream.cs
index fc346df37..5652962da 100644
--- a/MediaBrowser.Model/Entities/MediaStream.cs
+++ b/MediaBrowser.Model/Entities/MediaStream.cs
@@ -1,6 +1,8 @@
using System;
using System.Collections.Generic;
using System.Globalization;
+using System.Linq;
+using System.Text;
using MediaBrowser.Model.Dlna;
using MediaBrowser.Model.Extensions;
using MediaBrowser.Model.MediaInfo;
@@ -65,6 +67,10 @@ namespace MediaBrowser.Model.Entities
}
}
+ public string localizedUndefined { get; set; }
+ public string localizedDefault { get; set; }
+ public string localizedForced { get; set; }
+
public string DisplayTitle
{
get
@@ -128,10 +134,6 @@ namespace MediaBrowser.Model.Entities
if (Type == MediaStreamType.Subtitle)
{
- //if (!string.IsNullOrEmpty(Title))
- //{
- // return AddLanguageIfNeeded(Title);
- //}
var attributes = new List<string>();
@@ -141,22 +143,30 @@ namespace MediaBrowser.Model.Entities
}
else
{
- attributes.Add("Und");
+ attributes.Add(string.IsNullOrEmpty(localizedUndefined) ? "Und" : localizedUndefined);
}
if (IsDefault)
{
- attributes.Add("Default");
+ attributes.Add(string.IsNullOrEmpty(localizedDefault) ? "Default" : localizedDefault);
}
if (IsForced)
{
- attributes.Add("Forced");
+ attributes.Add(string.IsNullOrEmpty(localizedForced) ? "Forced" : localizedForced);
}
- string name = string.Join(" ", attributes.ToArray());
+ if (!string.IsNullOrEmpty(Title))
+ {
+ return attributes.AsEnumerable()
+ // keep Tags that are not already in Title
+ .Where(tag => Title.IndexOf(tag, StringComparison.OrdinalIgnoreCase) == -1)
+ // attributes concatenation, starting with Title
+ .Aggregate(new StringBuilder(Title), (builder, attr) => builder.Append(" - ").Append(attr))
+ .ToString();
+ }
- return name;
+ return string.Join(" - ", attributes.ToArray());
}
if (Type == MediaStreamType.Video)
@@ -220,28 +230,6 @@ namespace MediaBrowser.Model.Entities
return null;
}
- private string AddLanguageIfNeeded(string title)
- {
- if (!string.IsNullOrEmpty(Language) &&
- !string.Equals(Language, "und", StringComparison.OrdinalIgnoreCase) &&
- !IsLanguageInTitle(title, Language))
- {
- title = StringHelper.FirstToUpper(Language) + " " + title;
- }
-
- return title;
- }
-
- private bool IsLanguageInTitle(string title, string language)
- {
- if (title.IndexOf(Language, StringComparison.OrdinalIgnoreCase) != -1)
- {
- return true;
- }
-
- return false;
- }
-
public string NalLengthSize { get; set; }
/// <summary>
diff --git a/MediaBrowser.Model/Net/HttpResponse.cs b/MediaBrowser.Model/Net/HttpResponse.cs
deleted file mode 100644
index 286b1c0af..000000000
--- a/MediaBrowser.Model/Net/HttpResponse.cs
+++ /dev/null
@@ -1,64 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Net;
-
-namespace MediaBrowser.Model.Net
-{
- public class HttpResponse : IDisposable
- {
- /// <summary>
- /// Gets or sets the type of the content.
- /// </summary>
- /// <value>The type of the content.</value>
- public string ContentType { get; set; }
-
- /// <summary>
- /// Gets or sets the response URL.
- /// </summary>
- /// <value>The response URL.</value>
- public string ResponseUrl { get; set; }
-
- /// <summary>
- /// Gets or sets the content.
- /// </summary>
- /// <value>The content.</value>
- public Stream Content { get; set; }
-
- /// <summary>
- /// Gets or sets the status code.
- /// </summary>
- /// <value>The status code.</value>
- public HttpStatusCode StatusCode { get; set; }
-
- /// <summary>
- /// Gets or sets the length of the content.
- /// </summary>
- /// <value>The length of the content.</value>
- public long? ContentLength { get; set; }
-
- /// <summary>
- /// Gets or sets the headers.
- /// </summary>
- /// <value>The headers.</value>
- public Dictionary<string, string> Headers { get; set; }
-
- private readonly IDisposable _disposable;
-
- public HttpResponse(IDisposable disposable)
- {
- _disposable = disposable;
- }
- public HttpResponse()
- {
- }
-
- public void Dispose()
- {
- if (_disposable != null)
- {
- _disposable.Dispose();
- }
- }
- }
-}
diff --git a/MediaBrowser.Model/Net/IAcceptSocket.cs b/MediaBrowser.Model/Net/IAcceptSocket.cs
deleted file mode 100644
index 2b21d3e66..000000000
--- a/MediaBrowser.Model/Net/IAcceptSocket.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-using System;
-
-namespace MediaBrowser.Model.Net
-{
- public class SocketCreateException : Exception
- {
- public SocketCreateException(string errorCode, Exception originalException)
- : base(errorCode, originalException)
- {
- ErrorCode = errorCode;
- }
-
- public string ErrorCode { get; private set; }
- }
-}
diff --git a/MediaBrowser.Model/Properties/AssemblyInfo.cs b/MediaBrowser.Model/Properties/AssemblyInfo.cs
index e78719e35..f99e9ece9 100644
--- a/MediaBrowser.Model/Properties/AssemblyInfo.cs
+++ b/MediaBrowser.Model/Properties/AssemblyInfo.cs
@@ -9,8 +9,8 @@ using System.Runtime.InteropServices;
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Jellyfin Project")]
-[assembly: AssemblyProduct("Jellyfin: The Free Software Media System")]
-[assembly: AssemblyCopyright("Copyright © 2019 Jellyfin Contributors. Code released under the GNU General Public License Version 2")]
+[assembly: AssemblyProduct("Jellyfin Server")]
+[assembly: AssemblyCopyright("Copyright © 2019 Jellyfin Contributors. Code released under the GNU General Public License")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: NeutralResourcesLanguage("en")]
diff --git a/MediaBrowser.Model/Reflection/IAssemblyInfo.cs b/MediaBrowser.Model/Reflection/IAssemblyInfo.cs
deleted file mode 100644
index 5c4536c1c..000000000
--- a/MediaBrowser.Model/Reflection/IAssemblyInfo.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-using System;
-using System.IO;
-using System.Reflection;
-
-namespace MediaBrowser.Model.Reflection
-{
- public interface IAssemblyInfo
- {
- Stream GetManifestResourceStream(Type type, string resource);
- string[] GetManifestResourceNames(Type type);
-
- Assembly[] GetCurrentAssemblies();
- }
-}
diff --git a/MediaBrowser.Model/System/IEnvironmentInfo.cs b/MediaBrowser.Model/System/IEnvironmentInfo.cs
deleted file mode 100644
index 3ffcc7de1..000000000
--- a/MediaBrowser.Model/System/IEnvironmentInfo.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-using System.Runtime.InteropServices;
-
-namespace MediaBrowser.Model.System
-{
- public interface IEnvironmentInfo
- {
- OperatingSystem OperatingSystem { get; }
- string OperatingSystemName { get; }
- string OperatingSystemVersion { get; }
- Architecture SystemArchitecture { get; }
- }
-
- public enum OperatingSystem
- {
- Windows,
- Linux,
- OSX,
- BSD,
- Android
- }
-}
diff --git a/MediaBrowser.Model/System/OperatingSystemId.cs b/MediaBrowser.Model/System/OperatingSystemId.cs
new file mode 100644
index 000000000..e81dd4213
--- /dev/null
+++ b/MediaBrowser.Model/System/OperatingSystemId.cs
@@ -0,0 +1,10 @@
+namespace MediaBrowser.Model.System
+{
+ public enum OperatingSystemId
+ {
+ Windows,
+ Linux,
+ Darwin,
+ BSD
+ }
+}
diff --git a/MediaBrowser.Model/System/SystemInfo.cs b/MediaBrowser.Model/System/SystemInfo.cs
index 6482f2c84..222c10798 100644
--- a/MediaBrowser.Model/System/SystemInfo.cs
+++ b/MediaBrowser.Model/System/SystemInfo.cs
@@ -84,6 +84,12 @@ namespace MediaBrowser.Model.System
public string ProgramDataPath { get; set; }
/// <summary>
+ /// Gets or sets the web UI resources path.
+ /// </summary>
+ /// <value>The web UI resources path.</value>
+ public string WebPath { get; set; }
+
+ /// <summary>
/// Gets or sets the items by name path.
/// </summary>
/// <value>The items by name path.</value>
diff --git a/MediaBrowser.Model/Users/UserPolicy.cs b/MediaBrowser.Model/Users/UserPolicy.cs
index 27ce23778..5415fd5e8 100644
--- a/MediaBrowser.Model/Users/UserPolicy.cs
+++ b/MediaBrowser.Model/Users/UserPolicy.cs
@@ -66,6 +66,7 @@ namespace MediaBrowser.Model.Users
public bool EnableAllFolders { get; set; }
public int InvalidLoginAttemptCount { get; set; }
+ public int? LoginAttemptsBeforeLockout { get; set; }
public bool EnablePublicSharing { get; set; }
@@ -104,6 +105,8 @@ namespace MediaBrowser.Model.Users
AccessSchedules = Array.Empty<AccessSchedule>();
+ LoginAttemptsBeforeLockout = -1;
+
EnableAllChannels = true;
EnabledChannels = Array.Empty<string>();
diff --git a/MediaBrowser.Model/Xml/IXmlReaderSettingsFactory.cs b/MediaBrowser.Model/Xml/IXmlReaderSettingsFactory.cs
deleted file mode 100644
index b39325958..000000000
--- a/MediaBrowser.Model/Xml/IXmlReaderSettingsFactory.cs
+++ /dev/null
@@ -1,9 +0,0 @@
-using System.Xml;
-
-namespace MediaBrowser.Model.Xml
-{
- public interface IXmlReaderSettingsFactory
- {
- XmlReaderSettings Create(bool enableValidation);
- }
-}
diff --git a/MediaBrowser.Providers/Manager/ProviderManager.cs b/MediaBrowser.Providers/Manager/ProviderManager.cs
index f26087fda..860ea13cf 100644
--- a/MediaBrowser.Providers/Manager/ProviderManager.cs
+++ b/MediaBrowser.Providers/Manager/ProviderManager.cs
@@ -942,10 +942,7 @@ namespace MediaBrowser.Providers.Manager
_activeRefreshes[id] = 0;
}
- if (RefreshStarted != null)
- {
- RefreshStarted(this, new GenericEventArgs<BaseItem>(item));
- }
+ RefreshStarted?.Invoke(this, new GenericEventArgs<BaseItem>(item));
}
public void OnRefreshComplete(BaseItem item)
@@ -956,10 +953,7 @@ namespace MediaBrowser.Providers.Manager
_activeRefreshes.Remove(item.Id);
}
- if (RefreshCompleted != null)
- {
- RefreshCompleted(this, new GenericEventArgs<BaseItem>(item));
- }
+ RefreshCompleted?.Invoke(this, new GenericEventArgs<BaseItem>(item));
}
public double? GetRefreshProgress(Guid id)
@@ -986,10 +980,7 @@ namespace MediaBrowser.Providers.Manager
{
_activeRefreshes[id] = progress;
- if (RefreshProgress != null)
- {
- RefreshProgress(this, new GenericEventArgs<Tuple<BaseItem, double>>(new Tuple<BaseItem, double>(item, progress)));
- }
+ RefreshProgress?.Invoke(this, new GenericEventArgs<Tuple<BaseItem, double>>(new Tuple<BaseItem, double>(item, progress)));
}
else
{
@@ -1079,17 +1070,14 @@ namespace MediaBrowser.Providers.Manager
await item.RefreshMetadata(options, cancellationToken).ConfigureAwait(false);
// Collection folders don't validate their children so we'll have to simulate that here
- var collectionFolder = item as CollectionFolder;
- if (collectionFolder != null)
+ if (item is CollectionFolder collectionFolder)
{
await RefreshCollectionFolderChildren(options, collectionFolder, cancellationToken).ConfigureAwait(false);
}
else
{
- var folder = item as Folder;
-
- if (folder != null)
+ if (item is Folder folder)
{
await folder.ValidateChildren(new SimpleProgress<double>(), cancellationToken, options).ConfigureAwait(false);
}
@@ -1098,16 +1086,11 @@ namespace MediaBrowser.Providers.Manager
private async Task RefreshCollectionFolderChildren(MetadataRefreshOptions options, CollectionFolder collectionFolder, CancellationToken cancellationToken)
{
- foreach (var child in collectionFolder.GetPhysicalFolders().ToList())
+ foreach (var child in collectionFolder.GetPhysicalFolders())
{
await child.RefreshMetadata(options, cancellationToken).ConfigureAwait(false);
- if (child.IsFolder)
- {
- var folder = (Folder)child;
-
- await folder.ValidateChildren(new SimpleProgress<double>(), cancellationToken, options, true).ConfigureAwait(false);
- }
+ await child.ValidateChildren(new SimpleProgress<double>(), cancellationToken, options, true).ConfigureAwait(false);
}
}
@@ -1116,20 +1099,18 @@ namespace MediaBrowser.Providers.Manager
var albums = _libraryManagerFactory()
.GetItemList(new InternalItemsQuery
{
- IncludeItemTypes = new[] { typeof(MusicAlbum).Name },
+ IncludeItemTypes = new[] { nameof(MusicAlbum) },
ArtistIds = new[] { item.Id },
DtoOptions = new DtoOptions(false)
{
EnableImages = false
}
})
- .OfType<MusicAlbum>()
- .ToList();
+ .OfType<MusicAlbum>();
var musicArtists = albums
.Select(i => i.MusicArtist)
- .Where(i => i != null)
- .ToList();
+ .Where(i => i != null);
var musicArtistRefreshTasks = musicArtists.Select(i => i.ValidateChildren(new SimpleProgress<double>(), cancellationToken, options, true));
diff --git a/MediaBrowser.Providers/MediaBrowser.Providers.csproj b/MediaBrowser.Providers/MediaBrowser.Providers.csproj
index 52a52efdc..cfbb85ea6 100644
--- a/MediaBrowser.Providers/MediaBrowser.Providers.csproj
+++ b/MediaBrowser.Providers/MediaBrowser.Providers.csproj
@@ -11,6 +11,7 @@
</ItemGroup>
<ItemGroup>
+ <PackageReference Include="Microsoft.Extensions.Configuration" Version="2.2.0" />
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="2.2.0" />
<PackageReference Include="OptimizedPriorityQueue" Version="4.2.0" />
<PackageReference Include="PlaylistsNET" Version="1.0.2" />
diff --git a/MediaBrowser.Providers/Music/MusicBrainzAlbumProvider.cs b/MediaBrowser.Providers/Music/MusicBrainzAlbumProvider.cs
index e4bb52217..3797f9039 100644
--- a/MediaBrowser.Providers/Music/MusicBrainzAlbumProvider.cs
+++ b/MediaBrowser.Providers/Music/MusicBrainzAlbumProvider.cs
@@ -1,6 +1,6 @@
using System;
using System.Collections.Generic;
-using System.Globalization;
+using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Net;
@@ -15,7 +15,7 @@ using MediaBrowser.Controller.Providers;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Providers;
using MediaBrowser.Model.Serialization;
-using MediaBrowser.Model.Xml;
+using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
namespace MediaBrowser.Providers.Music
@@ -28,17 +28,42 @@ namespace MediaBrowser.Providers.Music
private readonly IApplicationHost _appHost;
private readonly ILogger _logger;
private readonly IJsonSerializer _json;
- private readonly IXmlReaderSettingsFactory _xmlSettings;
+ private Stopwatch _stopWatchMusicBrainz = new Stopwatch();
- public static string MusicBrainzBaseUrl = "https://www.musicbrainz.org";
+ public readonly string MusicBrainzBaseUrl;
- public MusicBrainzAlbumProvider(IHttpClient httpClient, IApplicationHost appHost, ILogger logger, IJsonSerializer json, IXmlReaderSettingsFactory xmlSettings)
+ /// <summary>
+ /// The Jellyfin user-agent is unrestricted but source IP must not exceed
+ /// one request per second, therefore we rate limit to avoid throttling.
+ /// Be prudent, use a value slightly above the minimun required.
+ /// https://musicbrainz.org/doc/XML_Web_Service/Rate_Limiting
+ /// </summary>
+ private const long MusicBrainzQueryIntervalMs = 1050u;
+
+ /// <summary>
+ /// For each single MB lookup/search, this is the maximum number of
+ /// attempts that shall be made whilst receiving a 503 Server
+ /// Unavailable (indicating throttled) response.
+ /// </summary>
+ private const uint MusicBrainzQueryAttempts = 5u;
+
+ public MusicBrainzAlbumProvider(
+ IHttpClient httpClient,
+ IApplicationHost appHost,
+ ILogger logger,
+ IJsonSerializer json,
+ IConfiguration configuration)
{
_httpClient = httpClient;
_appHost = appHost;
_logger = logger;
_json = json;
- _xmlSettings = xmlSettings;
+
+ MusicBrainzBaseUrl = configuration["MusicBrainz:BaseUrl"];
+
+ // Use a stopwatch to ensure we don't exceed the MusicBrainz rate limit
+ _stopWatchMusicBrainz.Start();
+
Current = this;
}
@@ -47,9 +72,7 @@ namespace MediaBrowser.Providers.Music
var releaseId = searchInfo.GetReleaseId();
var releaseGroupId = searchInfo.GetReleaseGroupId();
- string url = null;
- var isNameSearch = false;
- bool forceMusicBrainzProper = false;
+ string url;
if (!string.IsNullOrEmpty(releaseId))
{
@@ -58,7 +81,6 @@ namespace MediaBrowser.Providers.Music
else if (!string.IsNullOrEmpty(releaseGroupId))
{
url = string.Format("/ws/2/release?release-group={0}", releaseGroupId);
- forceMusicBrainzProper = true;
}
else
{
@@ -72,8 +94,6 @@ namespace MediaBrowser.Providers.Music
}
else
{
- isNameSearch = true;
-
// I'm sure there is a better way but for now it resolves search for 12" Mixes
var queryName = searchInfo.Name.Replace("\"", string.Empty);
@@ -85,7 +105,7 @@ namespace MediaBrowser.Providers.Music
if (!string.IsNullOrWhiteSpace(url))
{
- using (var response = await GetMusicBrainzResponse(url, isNameSearch, forceMusicBrainzProper, cancellationToken).ConfigureAwait(false))
+ using (var response = await GetMusicBrainzResponse(url, cancellationToken).ConfigureAwait(false))
{
using (var stream = response.Content)
{
@@ -94,18 +114,20 @@ namespace MediaBrowser.Providers.Music
}
}
- return new List<RemoteSearchResult>();
+ return Enumerable.Empty<RemoteSearchResult>();
}
- private List<RemoteSearchResult> GetResultsFromResponse(Stream stream)
+ private IEnumerable<RemoteSearchResult> GetResultsFromResponse(Stream stream)
{
using (var oReader = new StreamReader(stream, Encoding.UTF8))
{
- var settings = _xmlSettings.Create(false);
-
- settings.CheckCharacters = false;
- settings.IgnoreProcessingInstructions = true;
- settings.IgnoreComments = true;
+ var settings = new XmlReaderSettings()
+ {
+ ValidationType = ValidationType.None,
+ CheckCharacters = false,
+ IgnoreProcessingInstructions = true,
+ IgnoreComments = true
+ };
using (var reader = XmlReader.Create(oReader, settings))
{
@@ -141,7 +163,7 @@ namespace MediaBrowser.Providers.Music
return result;
- }).ToList();
+ });
}
}
}
@@ -239,23 +261,21 @@ namespace MediaBrowser.Providers.Music
WebUtility.UrlEncode(albumName),
artistId);
- using (var response = await GetMusicBrainzResponse(url, true, cancellationToken).ConfigureAwait(false))
+ using (var response = await GetMusicBrainzResponse(url, cancellationToken).ConfigureAwait(false))
+ using (var stream = response.Content)
+ using (var oReader = new StreamReader(stream, Encoding.UTF8))
{
- using (var stream = response.Content)
+ var settings = new XmlReaderSettings()
{
- using (var oReader = new StreamReader(stream, Encoding.UTF8))
- {
- var settings = _xmlSettings.Create(false);
-
- settings.CheckCharacters = false;
- settings.IgnoreProcessingInstructions = true;
- settings.IgnoreComments = true;
+ ValidationType = ValidationType.None,
+ CheckCharacters = false,
+ IgnoreProcessingInstructions = true,
+ IgnoreComments = true
+ };
- using (var reader = XmlReader.Create(oReader, settings))
- {
- return ReleaseResult.Parse(reader).FirstOrDefault();
- }
- }
+ using (var reader = XmlReader.Create(oReader, settings))
+ {
+ return ReleaseResult.Parse(reader).FirstOrDefault();
}
}
}
@@ -266,23 +286,21 @@ namespace MediaBrowser.Providers.Music
WebUtility.UrlEncode(albumName),
WebUtility.UrlEncode(artistName));
- using (var response = await GetMusicBrainzResponse(url, true, cancellationToken).ConfigureAwait(false))
+ using (var response = await GetMusicBrainzResponse(url, cancellationToken).ConfigureAwait(false))
+ using (var stream = response.Content)
+ using (var oReader = new StreamReader(stream, Encoding.UTF8))
{
- using (var stream = response.Content)
+ var settings = new XmlReaderSettings()
{
- using (var oReader = new StreamReader(stream, Encoding.UTF8))
- {
- var settings = _xmlSettings.Create(false);
-
- settings.CheckCharacters = false;
- settings.IgnoreProcessingInstructions = true;
- settings.IgnoreComments = true;
+ ValidationType = ValidationType.None,
+ CheckCharacters = false,
+ IgnoreProcessingInstructions = true,
+ IgnoreComments = true
+ };
- using (var reader = XmlReader.Create(oReader, settings))
- {
- return ReleaseResult.Parse(reader).FirstOrDefault();
- }
- }
+ using (var reader = XmlReader.Create(oReader, settings))
+ {
+ return ReleaseResult.Parse(reader).FirstOrDefault();
}
}
}
@@ -297,7 +315,7 @@ namespace MediaBrowser.Providers.Music
public List<ValueTuple<string, string>> Artists = new List<ValueTuple<string, string>>();
- public static List<ReleaseResult> Parse(XmlReader reader)
+ public static IEnumerable<ReleaseResult> Parse(XmlReader reader)
{
reader.MoveToContent();
reader.Read();
@@ -334,13 +352,11 @@ namespace MediaBrowser.Providers.Music
}
}
- return new List<ReleaseResult>();
+ return Enumerable.Empty<ReleaseResult>();
}
- private static List<ReleaseResult> ParseReleaseList(XmlReader reader)
+ private static IEnumerable<ReleaseResult> ParseReleaseList(XmlReader reader)
{
- var list = new List<ReleaseResult>();
-
reader.MoveToContent();
reader.Read();
@@ -365,7 +381,7 @@ namespace MediaBrowser.Providers.Music
var release = ParseRelease(subReader, releaseId);
if (release != null)
{
- list.Add(release);
+ yield return release;
}
}
break;
@@ -382,8 +398,6 @@ namespace MediaBrowser.Providers.Music
reader.Read();
}
}
-
- return list;
}
private static ReleaseResult ParseRelease(XmlReader reader, string releaseId)
@@ -548,7 +562,7 @@ namespace MediaBrowser.Providers.Music
return (null, null);
}
- private static ValueTuple<string, string> ParseArtistArtistCredit(XmlReader reader, string artistId)
+ private static (string name, string id) ParseArtistArtistCredit(XmlReader reader, string artistId)
{
reader.MoveToContent();
reader.Read();
@@ -582,34 +596,32 @@ namespace MediaBrowser.Providers.Music
}
}
- return new ValueTuple<string, string>(name, artistId);
+ return (name, artistId);
}
private async Task<string> GetReleaseIdFromReleaseGroupId(string releaseGroupId, CancellationToken cancellationToken)
{
var url = string.Format("/ws/2/release?release-group={0}", releaseGroupId);
- using (var response = await GetMusicBrainzResponse(url, true, true, cancellationToken).ConfigureAwait(false))
+ using (var response = await GetMusicBrainzResponse(url, cancellationToken).ConfigureAwait(false))
+ using (var stream = response.Content)
+ using (var oReader = new StreamReader(stream, Encoding.UTF8))
{
- using (var stream = response.Content)
+ var settings = new XmlReaderSettings()
{
- using (var oReader = new StreamReader(stream, Encoding.UTF8))
- {
- var settings = _xmlSettings.Create(false);
-
- settings.CheckCharacters = false;
- settings.IgnoreProcessingInstructions = true;
- settings.IgnoreComments = true;
+ ValidationType = ValidationType.None,
+ CheckCharacters = false,
+ IgnoreProcessingInstructions = true,
+ IgnoreComments = true
+ };
- using (var reader = XmlReader.Create(oReader, settings))
- {
- var result = ReleaseResult.Parse(reader).FirstOrDefault();
+ using (var reader = XmlReader.Create(oReader, settings))
+ {
+ var result = ReleaseResult.Parse(reader).FirstOrDefault();
- if (result != null)
- {
- return result.ReleaseId;
- }
- }
+ if (result != null)
+ {
+ return result.ReleaseId;
}
}
}
@@ -627,57 +639,55 @@ namespace MediaBrowser.Providers.Music
{
var url = string.Format("/ws/2/release-group/?query=reid:{0}", releaseEntryId);
- using (var response = await GetMusicBrainzResponse(url, false, cancellationToken).ConfigureAwait(false))
+ using (var response = await GetMusicBrainzResponse(url, cancellationToken).ConfigureAwait(false))
+ using (var stream = response.Content)
+ using (var oReader = new StreamReader(stream, Encoding.UTF8))
{
- using (var stream = response.Content)
+ var settings = new XmlReaderSettings()
{
- using (var oReader = new StreamReader(stream, Encoding.UTF8))
- {
- var settings = _xmlSettings.Create(false);
+ ValidationType = ValidationType.None,
+ CheckCharacters = false,
+ IgnoreProcessingInstructions = true,
+ IgnoreComments = true
+ };
- settings.CheckCharacters = false;
- settings.IgnoreProcessingInstructions = true;
- settings.IgnoreComments = true;
+ using (var reader = XmlReader.Create(oReader, settings))
+ {
+ reader.MoveToContent();
+ reader.Read();
- using (var reader = XmlReader.Create(oReader, settings))
+ // Loop through each element
+ while (!reader.EOF && reader.ReadState == ReadState.Interactive)
+ {
+ if (reader.NodeType == XmlNodeType.Element)
{
- reader.MoveToContent();
- reader.Read();
-
- // Loop through each element
- while (!reader.EOF && reader.ReadState == ReadState.Interactive)
+ switch (reader.Name)
{
- if (reader.NodeType == XmlNodeType.Element)
- {
- switch (reader.Name)
+ case "release-group-list":
{
- case "release-group-list":
- {
- if (reader.IsEmptyElement)
- {
- reader.Read();
- continue;
- }
- using (var subReader = reader.ReadSubtree())
- {
- return GetFirstReleaseGroupId(subReader);
- }
- }
- default:
- {
- reader.Skip();
- break;
- }
+ if (reader.IsEmptyElement)
+ {
+ reader.Read();
+ continue;
+ }
+ using (var subReader = reader.ReadSubtree())
+ {
+ return GetFirstReleaseGroupId(subReader);
+ }
+ }
+ default:
+ {
+ reader.Skip();
+ break;
}
- }
- else
- {
- reader.Read();
- }
}
- return null;
+ }
+ else
+ {
+ reader.Read();
}
}
+ return null;
}
}
}
@@ -714,37 +724,56 @@ namespace MediaBrowser.Providers.Music
return null;
}
- internal Task<HttpResponseInfo> GetMusicBrainzResponse(string url, bool isSearch, CancellationToken cancellationToken)
- {
- return GetMusicBrainzResponse(url, isSearch, false, cancellationToken);
- }
-
/// <summary>
- /// Gets the music brainz response.
+ /// Makes request to MusicBrainz server and awaits a response.
+ /// A 503 Service Unavailable response indicates throttling to maintain a rate limit.
+ /// A number of retries shall be made in order to try and satisfy the request before
+ /// giving up and returning null.
/// </summary>
- internal async Task<HttpResponseInfo> GetMusicBrainzResponse(string url, bool isSearch, bool forceMusicBrainzProper, CancellationToken cancellationToken)
+ internal async Task<HttpResponseInfo> GetMusicBrainzResponse(string url, CancellationToken cancellationToken)
{
- var urlInfo = new MbzUrl(MusicBrainzBaseUrl, 1000);
- var throttleMs = urlInfo.throttleMs;
+ var options = new HttpRequestOptions
+ {
+ Url = MusicBrainzBaseUrl.TrimEnd('/') + url,
+ CancellationToken = cancellationToken,
+ // MusicBrainz request a contact email address is supplied, as comment, in user agent field:
+ // https://musicbrainz.org/doc/XML_Web_Service/Rate_Limiting#User-Agent
+ UserAgent = string.Format("{0} ( {1} )", _appHost.ApplicationUserAgent, _appHost.ApplicationUserAgentAddress),
+ BufferContent = false
+ };
+
+ HttpResponseInfo response;
+ var attempts = 0u;
- if (throttleMs > 0)
+ do
{
- // MusicBrainz is extremely adamant about limiting to one request per second
- _logger.LogDebug("Throttling MusicBrainz by {0}ms", throttleMs.ToString(CultureInfo.InvariantCulture));
- await Task.Delay(throttleMs, cancellationToken).ConfigureAwait(false);
- }
+ attempts++;
- url = urlInfo.url.TrimEnd('/') + url;
+ if (_stopWatchMusicBrainz.ElapsedMilliseconds < MusicBrainzQueryIntervalMs)
+ {
+ // MusicBrainz is extremely adamant about limiting to one request per second
+ var delayMs = MusicBrainzQueryIntervalMs - _stopWatchMusicBrainz.ElapsedMilliseconds;
+ await Task.Delay((int)delayMs, cancellationToken).ConfigureAwait(false);
+ }
- var options = new HttpRequestOptions
+ // Write time since last request to debug log as evidence we're meeting rate limit
+ // requirement, before resetting stopwatch back to zero.
+ _logger.LogDebug("GetMusicBrainzResponse: Time since previous request: {0} ms", _stopWatchMusicBrainz.ElapsedMilliseconds);
+ _stopWatchMusicBrainz.Restart();
+
+ response = await _httpClient.SendAsync(options, "GET").ConfigureAwait(false);
+
+ // We retry a finite number of times, and only whilst MB is indcating 503 (throttling)
+ }
+ while (attempts < MusicBrainzQueryAttempts && response.StatusCode == HttpStatusCode.ServiceUnavailable);
+
+ // Log error if unable to query MB database due to throttling
+ if (attempts == MusicBrainzQueryAttempts && response.StatusCode == HttpStatusCode.ServiceUnavailable )
{
- Url = url,
- CancellationToken = cancellationToken,
- UserAgent = _appHost.ApplicationUserAgent,
- BufferContent = throttleMs > 0
- };
+ _logger.LogError("GetMusicBrainzResponse: 503 Service Unavailable (throttled) response received {0} times whilst requesting {1}", attempts, options.Url);
+ }
- return await _httpClient.SendAsync(options, "GET").ConfigureAwait(false);
+ return response;
}
public int Order => 0;
@@ -753,17 +782,5 @@ namespace MediaBrowser.Providers.Music
{
throw new NotImplementedException();
}
-
- internal class MbzUrl
- {
- internal MbzUrl(string url, int throttleMs)
- {
- this.url = url;
- this.throttleMs = throttleMs;
- }
-
- public string url { get; set; }
- public int throttleMs { get; set; }
- }
}
}
diff --git a/MediaBrowser.Providers/Music/MusicBrainzArtistProvider.cs b/MediaBrowser.Providers/Music/MusicBrainzArtistProvider.cs
index 8d10834c3..59280df89 100644
--- a/MediaBrowser.Providers/Music/MusicBrainzArtistProvider.cs
+++ b/MediaBrowser.Providers/Music/MusicBrainzArtistProvider.cs
@@ -13,17 +13,14 @@ using MediaBrowser.Controller.Extensions;
using MediaBrowser.Controller.Providers;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Providers;
-using MediaBrowser.Model.Xml;
namespace MediaBrowser.Providers.Music
{
public class MusicBrainzArtistProvider : IRemoteMetadataProvider<MusicArtist, ArtistInfo>
{
- private readonly IXmlReaderSettingsFactory _xmlSettings;
-
- public MusicBrainzArtistProvider(IXmlReaderSettingsFactory xmlSettings)
+ public MusicBrainzArtistProvider()
{
- _xmlSettings = xmlSettings;
+
}
public async Task<IEnumerable<RemoteSearchResult>> GetSearchResults(ArtistInfo searchInfo, CancellationToken cancellationToken)
@@ -34,7 +31,7 @@ namespace MediaBrowser.Providers.Music
{
var url = string.Format("/ws/2/artist/?query=arid:{0}", musicBrainzId);
- using (var response = await MusicBrainzAlbumProvider.Current.GetMusicBrainzResponse(url, false, cancellationToken).ConfigureAwait(false))
+ using (var response = await MusicBrainzAlbumProvider.Current.GetMusicBrainzResponse(url, cancellationToken).ConfigureAwait(false))
{
using (var stream = response.Content)
{
@@ -49,11 +46,11 @@ namespace MediaBrowser.Providers.Music
var url = string.Format("/ws/2/artist/?query=\"{0}\"&dismax=true", UrlEncode(nameToSearch));
- using (var response = await MusicBrainzAlbumProvider.Current.GetMusicBrainzResponse(url, true, cancellationToken).ConfigureAwait(false))
+ using (var response = await MusicBrainzAlbumProvider.Current.GetMusicBrainzResponse(url, cancellationToken).ConfigureAwait(false))
{
using (var stream = response.Content)
{
- var results = GetResultsFromResponse(stream);
+ var results = GetResultsFromResponse(stream).ToList();
if (results.Count > 0)
{
@@ -67,7 +64,7 @@ namespace MediaBrowser.Providers.Music
// Try again using the search with accent characters url
url = string.Format("/ws/2/artist/?query=artistaccent:\"{0}\"", UrlEncode(nameToSearch));
- using (var response = await MusicBrainzAlbumProvider.Current.GetMusicBrainzResponse(url, true, cancellationToken).ConfigureAwait(false))
+ using (var response = await MusicBrainzAlbumProvider.Current.GetMusicBrainzResponse(url, cancellationToken).ConfigureAwait(false))
{
using (var stream = response.Content)
{
@@ -77,18 +74,20 @@ namespace MediaBrowser.Providers.Music
}
}
- return new List<RemoteSearchResult>();
+ return Enumerable.Empty<RemoteSearchResult>();
}
- private List<RemoteSearchResult> GetResultsFromResponse(Stream stream)
+ private IEnumerable<RemoteSearchResult> GetResultsFromResponse(Stream stream)
{
using (var oReader = new StreamReader(stream, Encoding.UTF8))
{
- var settings = _xmlSettings.Create(false);
-
- settings.CheckCharacters = false;
- settings.IgnoreProcessingInstructions = true;
- settings.IgnoreComments = true;
+ var settings = new XmlReaderSettings()
+ {
+ ValidationType = ValidationType.None,
+ CheckCharacters = false,
+ IgnoreProcessingInstructions = true,
+ IgnoreComments = true
+ };
using (var reader = XmlReader.Create(oReader, settings))
{
@@ -127,15 +126,13 @@ namespace MediaBrowser.Providers.Music
}
}
- return new List<RemoteSearchResult>();
+ return Enumerable.Empty<RemoteSearchResult>();
}
}
}
- private List<RemoteSearchResult> ParseArtistList(XmlReader reader)
+ private IEnumerable<RemoteSearchResult> ParseArtistList(XmlReader reader)
{
- var list = new List<RemoteSearchResult>();
-
reader.MoveToContent();
reader.Read();
@@ -160,7 +157,7 @@ namespace MediaBrowser.Providers.Music
var artist = ParseArtist(subReader, mbzId);
if (artist != null)
{
- list.Add(artist);
+ yield return artist;
}
}
break;
@@ -177,8 +174,6 @@ namespace MediaBrowser.Providers.Music
reader.Read();
}
}
-
- return list;
}
private RemoteSearchResult ParseArtist(XmlReader reader, string artistId)
@@ -278,7 +273,7 @@ namespace MediaBrowser.Providers.Music
/// </summary>
/// <param name="name">The name.</param>
/// <returns>System.String.</returns>
- private string UrlEncode(string name)
+ private static string UrlEncode(string name)
{
return WebUtility.UrlEncode(name);
}
diff --git a/MediaBrowser.Providers/Properties/AssemblyInfo.cs b/MediaBrowser.Providers/Properties/AssemblyInfo.cs
index d2b13fc89..f1c46899c 100644
--- a/MediaBrowser.Providers/Properties/AssemblyInfo.cs
+++ b/MediaBrowser.Providers/Properties/AssemblyInfo.cs
@@ -9,8 +9,8 @@ using System.Runtime.InteropServices;
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Jellyfin Project")]
-[assembly: AssemblyProduct("Jellyfin: The Free Software Media System")]
-[assembly: AssemblyCopyright("Copyright © 2019 Jellyfin Contributors. Code released under the GNU General Public License Version 2")]
+[assembly: AssemblyProduct("Jellyfin Server")]
+[assembly: AssemblyCopyright("Copyright © 2019 Jellyfin Contributors. Code released under the GNU General Public License")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: NeutralResourcesLanguage("en")]
diff --git a/MediaBrowser.Providers/TV/MissingEpisodeProvider.cs b/MediaBrowser.Providers/TV/MissingEpisodeProvider.cs
index 0a2975e0f..752c0941d 100644
--- a/MediaBrowser.Providers/TV/MissingEpisodeProvider.cs
+++ b/MediaBrowser.Providers/TV/MissingEpisodeProvider.cs
@@ -1,12 +1,9 @@
using System;
using System.Collections.Generic;
using System.Globalization;
-using System.IO;
using System.Linq;
-using System.Text;
using System.Threading;
using System.Threading.Tasks;
-using System.Xml;
using MediaBrowser.Controller.Configuration;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Entities.TV;
diff --git a/MediaBrowser.Providers/TV/SeriesMetadataService.cs b/MediaBrowser.Providers/TV/SeriesMetadataService.cs
index afbd838e4..d5b0b6fd8 100644
--- a/MediaBrowser.Providers/TV/SeriesMetadataService.cs
+++ b/MediaBrowser.Providers/TV/SeriesMetadataService.cs
@@ -8,7 +8,6 @@ using MediaBrowser.Controller.Providers;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Globalization;
using MediaBrowser.Model.IO;
-using MediaBrowser.Model.Xml;
using MediaBrowser.Providers.Manager;
using MediaBrowser.Providers.TV.TheTVDB;
using Microsoft.Extensions.Logging;
@@ -18,7 +17,6 @@ namespace MediaBrowser.Providers.TV
public class SeriesMetadataService : MetadataService<Series, SeriesInfo>
{
private readonly ILocalizationManager _localization;
- private readonly IXmlReaderSettingsFactory _xmlSettings;
private readonly TvDbClientManager _tvDbClientManager;
public SeriesMetadataService(
@@ -29,13 +27,11 @@ namespace MediaBrowser.Providers.TV
IUserDataManager userDataManager,
ILibraryManager libraryManager,
ILocalizationManager localization,
- IXmlReaderSettingsFactory xmlSettings,
TvDbClientManager tvDbClientManager
)
: base(serverConfigurationManager, logger, providerManager, fileSystem, userDataManager, libraryManager)
{
_localization = localization;
- _xmlSettings = xmlSettings;
_tvDbClientManager = tvDbClientManager;
}
diff --git a/MediaBrowser.Providers/TV/TheTVDB/TvdbEpisodeProvider.cs b/MediaBrowser.Providers/TV/TheTVDB/TvdbEpisodeProvider.cs
index b256f2667..5474a7c39 100644
--- a/MediaBrowser.Providers/TV/TheTVDB/TvdbEpisodeProvider.cs
+++ b/MediaBrowser.Providers/TV/TheTVDB/TvdbEpisodeProvider.cs
@@ -192,6 +192,7 @@ namespace MediaBrowser.Providers.TV.TheTVDB
Type = PersonType.Director
});
}
+
foreach (var person in episode.GuestStars)
{
var index = person.IndexOf('(');
@@ -212,6 +213,7 @@ namespace MediaBrowser.Providers.TV.TheTVDB
Role = role
});
}
+
foreach (var writer in episode.Writers)
{
result.AddPerson(new PersonInfo
diff --git a/MediaBrowser.Providers/TV/TheTVDB/TvdbSeriesProvider.cs b/MediaBrowser.Providers/TV/TheTVDB/TvdbSeriesProvider.cs
index 9c24e4c98..5ea73dfbf 100644
--- a/MediaBrowser.Providers/TV/TheTVDB/TvdbSeriesProvider.cs
+++ b/MediaBrowser.Providers/TV/TheTVDB/TvdbSeriesProvider.cs
@@ -23,7 +23,6 @@ namespace MediaBrowser.Providers.TV.TheTVDB
{
internal static TvdbSeriesProvider Current { get; private set; }
private readonly IHttpClient _httpClient;
- private readonly CultureInfo _usCulture = new CultureInfo("en-US");
private readonly ILogger _logger;
private readonly ILibraryManager _libraryManager;
private readonly ILocalizationManager _localizationManager;
@@ -146,6 +145,7 @@ namespace MediaBrowser.Providers.TV.TheTVDB
private async Task<string> GetSeriesByRemoteId(string id, string idType, string language, CancellationToken cancellationToken)
{
+
TvDbResponse<SeriesSearchResult[]> result = null;
try
@@ -334,7 +334,6 @@ namespace MediaBrowser.Providers.TV.TheTVDB
result.ResultLanguage = metadataLanguage;
series.AirDays = TVUtils.GetAirDays(tvdbSeries.AirsDayOfWeek);
series.AirTime = tvdbSeries.AirsTime;
-
series.CommunityRating = (float?)tvdbSeries.SiteRating;
series.SetProviderId(MetadataProviders.Imdb, tvdbSeries.ImdbId);
series.SetProviderId(MetadataProviders.Zap2It, tvdbSeries.Zap2itId);
diff --git a/MediaBrowser.Tests/Properties/AssemblyInfo.cs b/MediaBrowser.Tests/Properties/AssemblyInfo.cs
index 9bc2a19f2..1bd3ef5d6 100644
--- a/MediaBrowser.Tests/Properties/AssemblyInfo.cs
+++ b/MediaBrowser.Tests/Properties/AssemblyInfo.cs
@@ -9,7 +9,7 @@ using System.Runtime.InteropServices;
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Jellyfin Project")]
-[assembly: AssemblyProduct("Jellyfin: The Free Software Media System")]
+[assembly: AssemblyProduct("Jellyfin System")]
[assembly: AssemblyCopyright("Copyright © 2019 Jellyfin Contributors. Code released under the GNU General Public License Version 2")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
diff --git a/MediaBrowser.WebDashboard/Api/DashboardService.cs b/MediaBrowser.WebDashboard/Api/DashboardService.cs
index 531978e1d..58ab2d27b 100644
--- a/MediaBrowser.WebDashboard/Api/DashboardService.cs
+++ b/MediaBrowser.WebDashboard/Api/DashboardService.cs
@@ -13,7 +13,6 @@ using MediaBrowser.Model.Globalization;
using MediaBrowser.Model.IO;
using MediaBrowser.Model.Net;
using MediaBrowser.Model.Plugins;
-using MediaBrowser.Model.Reflection;
using MediaBrowser.Model.Serialization;
using MediaBrowser.Model.Services;
using Microsoft.Extensions.Logging;
@@ -117,20 +116,26 @@ namespace MediaBrowser.WebDashboard.Api
private readonly IFileSystem _fileSystem;
private readonly ILocalizationManager _localization;
private readonly IJsonSerializer _jsonSerializer;
- private readonly IAssemblyInfo _assemblyInfo;
private IResourceFileManager _resourceFileManager;
/// <summary>
/// Initializes a new instance of the <see cref="DashboardService" /> class.
/// </summary>
- public DashboardService(IServerApplicationHost appHost, IResourceFileManager resourceFileManager, IServerConfigurationManager serverConfigurationManager, IFileSystem fileSystem, ILocalizationManager localization, IJsonSerializer jsonSerializer, IAssemblyInfo assemblyInfo, ILogger logger, IHttpResultFactory resultFactory)
+ public DashboardService(
+ IServerApplicationHost appHost,
+ IResourceFileManager resourceFileManager,
+ IServerConfigurationManager serverConfigurationManager,
+ IFileSystem fileSystem,
+ ILocalizationManager localization,
+ IJsonSerializer jsonSerializer,
+ ILogger logger,
+ IHttpResultFactory resultFactory)
{
_appHost = appHost;
_serverConfigurationManager = serverConfigurationManager;
_fileSystem = fileSystem;
_localization = localization;
_jsonSerializer = jsonSerializer;
- _assemblyInfo = assemblyInfo;
_logger = logger;
_resultFactory = resultFactory;
_resourceFileManager = resourceFileManager;
@@ -149,7 +154,7 @@ namespace MediaBrowser.WebDashboard.Api
return _serverConfigurationManager.Configuration.DashboardSourcePath;
}
- return Path.Combine(_serverConfigurationManager.ApplicationPaths.ApplicationResourcesPath, "jellyfin-web", "src");
+ return _serverConfigurationManager.ApplicationPaths.WebPath;
}
}
@@ -187,7 +192,7 @@ namespace MediaBrowser.WebDashboard.Api
if (altPage != null)
{
plugin = altPage.Item2;
- stream = _assemblyInfo.GetManifestResourceStream(plugin.GetType(), altPage.Item1.EmbeddedResourcePath);
+ stream = plugin.GetType().Assembly.GetManifestResourceStream(altPage.Item1.EmbeddedResourcePath);
isJs = string.Equals(Path.GetExtension(altPage.Item1.EmbeddedResourcePath), ".js", StringComparison.OrdinalIgnoreCase);
isTemplate = altPage.Item1.EmbeddedResourcePath.EndsWith(".template.html");
diff --git a/MediaBrowser.WebDashboard/Properties/AssemblyInfo.cs b/MediaBrowser.WebDashboard/Properties/AssemblyInfo.cs
index 416ce4826..584d49021 100644
--- a/MediaBrowser.WebDashboard/Properties/AssemblyInfo.cs
+++ b/MediaBrowser.WebDashboard/Properties/AssemblyInfo.cs
@@ -9,8 +9,8 @@ using System.Runtime.InteropServices;
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Jellyfin Project")]
-[assembly: AssemblyProduct("Jellyfin: The Free Software Media System")]
-[assembly: AssemblyCopyright("Copyright © 2019 Jellyfin Contributors. Code released under the GNU General Public License Version 2")]
+[assembly: AssemblyProduct("Jellyfin Server")]
+[assembly: AssemblyCopyright("Copyright © 2019 Jellyfin Contributors. Code released under the GNU General Public License")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: NeutralResourcesLanguage("en")]
diff --git a/MediaBrowser.XbmcMetadata/Parsers/BaseNfoParser.cs b/MediaBrowser.XbmcMetadata/Parsers/BaseNfoParser.cs
index f20dbbb6e..5896497ab 100644
--- a/MediaBrowser.XbmcMetadata/Parsers/BaseNfoParser.cs
+++ b/MediaBrowser.XbmcMetadata/Parsers/BaseNfoParser.cs
@@ -13,8 +13,6 @@ using MediaBrowser.Controller.Entities.TV;
using MediaBrowser.Controller.Providers;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Extensions;
-using MediaBrowser.Model.IO;
-using MediaBrowser.Model.Xml;
using MediaBrowser.XbmcMetadata.Configuration;
using MediaBrowser.XbmcMetadata.Savers;
using Microsoft.Extensions.Logging;
@@ -28,9 +26,7 @@ namespace MediaBrowser.XbmcMetadata.Parsers
/// The logger
/// </summary>
protected ILogger Logger { get; private set; }
- protected IFileSystem FileSystem { get; private set; }
protected IProviderManager ProviderManager { get; private set; }
- protected IXmlReaderSettingsFactory XmlReaderSettingsFactory { get; private set; }
private readonly CultureInfo _usCulture = new CultureInfo("en-US");
private readonly IConfigurationManager _config;
@@ -39,13 +35,11 @@ namespace MediaBrowser.XbmcMetadata.Parsers
/// <summary>
/// Initializes a new instance of the <see cref="BaseNfoParser{T}" /> class.
/// </summary>
- public BaseNfoParser(ILogger logger, IConfigurationManager config, IProviderManager providerManager, IFileSystem fileSystem, IXmlReaderSettingsFactory xmlReaderSettingsFactory)
+ public BaseNfoParser(ILogger logger, IConfigurationManager config, IProviderManager providerManager)
{
Logger = logger;
_config = config;
ProviderManager = providerManager;
- FileSystem = fileSystem;
- XmlReaderSettingsFactory = xmlReaderSettingsFactory;
}
/// <summary>
@@ -68,12 +62,6 @@ namespace MediaBrowser.XbmcMetadata.Parsers
throw new ArgumentException("The metadata file was empty or null.", nameof(metadataFile));
}
- var settings = XmlReaderSettingsFactory.Create(false);
-
- settings.CheckCharacters = false;
- settings.IgnoreProcessingInstructions = true;
- settings.IgnoreComments = true;
-
_validProviderIds = _validProviderIds = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
var idInfos = ProviderManager.GetExternalIdInfos(item.Item);
@@ -92,7 +80,7 @@ namespace MediaBrowser.XbmcMetadata.Parsers
_validProviderIds.Add("tmdbcolid", "TmdbCollection");
_validProviderIds.Add("imdb_id", "Imdb");
- Fetch(item, metadataFile, settings, cancellationToken);
+ Fetch(item, metadataFile, GetXmlReaderSettings(), cancellationToken);
}
protected virtual bool SupportsUrlAfterClosingXmlTag => false;
@@ -109,31 +97,26 @@ namespace MediaBrowser.XbmcMetadata.Parsers
if (!SupportsUrlAfterClosingXmlTag)
{
using (var fileStream = File.OpenRead(metadataFile))
+ using (var streamReader = new StreamReader(fileStream, Encoding.UTF8))
+ using (var reader = XmlReader.Create(streamReader, settings))
{
- using (var streamReader = new StreamReader(fileStream, Encoding.UTF8))
- {
- // Use XmlReader for best performance
- using (var reader = XmlReader.Create(streamReader, settings))
- {
- item.ResetPeople();
+ item.ResetPeople();
- reader.MoveToContent();
- reader.Read();
+ reader.MoveToContent();
+ reader.Read();
- // Loop through each element
- while (!reader.EOF && reader.ReadState == ReadState.Interactive)
- {
- cancellationToken.ThrowIfCancellationRequested();
+ // Loop through each element
+ while (!reader.EOF && reader.ReadState == ReadState.Interactive)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
- if (reader.NodeType == XmlNodeType.Element)
- {
- FetchDataFromXmlNode(reader, item);
- }
- else
- {
- reader.Read();
- }
- }
+ if (reader.NodeType == XmlNodeType.Element)
+ {
+ FetchDataFromXmlNode(reader, item);
+ }
+ else
+ {
+ reader.Read();
}
}
}
@@ -141,81 +124,76 @@ namespace MediaBrowser.XbmcMetadata.Parsers
}
using (var fileStream = File.OpenRead(metadataFile))
+ using (var streamReader = new StreamReader(fileStream, Encoding.UTF8))
{
- using (var streamReader = new StreamReader(fileStream, Encoding.UTF8))
- {
- item.ResetPeople();
-
- // Need to handle a url after the xml data
- // http://kodi.wiki/view/NFO_files/movies
+ item.ResetPeople();
- var xml = streamReader.ReadToEnd();
+ // Need to handle a url after the xml data
+ // http://kodi.wiki/view/NFO_files/movies
- // Find last closing Tag
- // Need to do this in two steps to account for random > characters after the closing xml
- var index = xml.LastIndexOf(@"</", StringComparison.Ordinal);
+ var xml = streamReader.ReadToEnd();
- // If closing tag exists, move to end of Tag
- if (index != -1)
- {
- index = xml.IndexOf('>', index);
- }
+ // Find last closing Tag
+ // Need to do this in two steps to account for random > characters after the closing xml
+ var index = xml.LastIndexOf(@"</", StringComparison.Ordinal);
- if (index != -1)
- {
- var endingXml = xml.Substring(index);
+ // If closing tag exists, move to end of Tag
+ if (index != -1)
+ {
+ index = xml.IndexOf('>', index);
+ }
- ParseProviderLinks(item.Item, endingXml);
+ if (index != -1)
+ {
+ var endingXml = xml.Substring(index);
- // If the file is just an imdb url, don't go any further
- if (index == 0)
- {
- return;
- }
+ ParseProviderLinks(item.Item, endingXml);
- xml = xml.Substring(0, index + 1);
- }
- else
+ // If the file is just an imdb url, don't go any further
+ if (index == 0)
{
- // If the file is just an Imdb url, handle that
-
- ParseProviderLinks(item.Item, xml);
-
return;
}
- // These are not going to be valid xml so no sense in causing the provider to fail and spamming the log with exceptions
- try
+ xml = xml.Substring(0, index + 1);
+ }
+ else
+ {
+ // If the file is just an Imdb url, handle that
+
+ ParseProviderLinks(item.Item, xml);
+
+ return;
+ }
+
+ // These are not going to be valid xml so no sense in causing the provider to fail and spamming the log with exceptions
+ try
+ {
+ using (var stringReader = new StringReader(xml))
+ using (var reader = XmlReader.Create(stringReader, settings))
{
- using (var stringReader = new StringReader(xml))
+ reader.MoveToContent();
+ reader.Read();
+
+ // Loop through each element
+ while (!reader.EOF && reader.ReadState == ReadState.Interactive)
{
- // Use XmlReader for best performance
- using (var reader = XmlReader.Create(stringReader, settings))
+ cancellationToken.ThrowIfCancellationRequested();
+
+ if (reader.NodeType == XmlNodeType.Element)
+ {
+ FetchDataFromXmlNode(reader, item);
+ }
+ else
{
- reader.MoveToContent();
reader.Read();
-
- // Loop through each element
- while (!reader.EOF && reader.ReadState == ReadState.Interactive)
- {
- cancellationToken.ThrowIfCancellationRequested();
-
- if (reader.NodeType == XmlNodeType.Element)
- {
- FetchDataFromXmlNode(reader, item);
- }
- else
- {
- reader.Read();
- }
- }
}
}
}
- catch (XmlException)
- {
+ }
+ catch (XmlException)
+ {
- }
}
}
}
@@ -920,6 +898,15 @@ namespace MediaBrowser.XbmcMetadata.Parsers
};
}
+ internal XmlReaderSettings GetXmlReaderSettings()
+ => new XmlReaderSettings()
+ {
+ ValidationType = ValidationType.None,
+ CheckCharacters = false,
+ IgnoreProcessingInstructions = true,
+ IgnoreComments = true
+ };
+
/// <summary>
/// Used to split names of comma or pipe delimeted genres and people
/// </summary>
@@ -935,19 +922,7 @@ namespace MediaBrowser.XbmcMetadata.Parsers
value = value.Trim().Trim(separator);
- return string.IsNullOrWhiteSpace(value) ? Array.Empty<string>() : Split(value, separator, StringSplitOptions.RemoveEmptyEntries);
- }
-
- /// <summary>
- /// Provides an additional overload for string.split
- /// </summary>
- /// <param name="val">The val.</param>
- /// <param name="separators">The separators.</param>
- /// <param name="options">The options.</param>
- /// <returns>System.String[][].</returns>
- private string[] Split(string val, char[] separators, StringSplitOptions options)
- {
- return val.Split(separators, options);
+ return string.IsNullOrWhiteSpace(value) ? Array.Empty<string>() : value.Split(separator, StringSplitOptions.RemoveEmptyEntries);
}
}
}
diff --git a/MediaBrowser.XbmcMetadata/Parsers/EpisodeNfoParser.cs b/MediaBrowser.XbmcMetadata/Parsers/EpisodeNfoParser.cs
index a8cb6ac40..7f4224076 100644
--- a/MediaBrowser.XbmcMetadata/Parsers/EpisodeNfoParser.cs
+++ b/MediaBrowser.XbmcMetadata/Parsers/EpisodeNfoParser.cs
@@ -8,8 +8,6 @@ using System.Xml;
using MediaBrowser.Common.Configuration;
using MediaBrowser.Controller.Entities.TV;
using MediaBrowser.Controller.Providers;
-using MediaBrowser.Model.IO;
-using MediaBrowser.Model.Xml;
using Microsoft.Extensions.Logging;
namespace MediaBrowser.XbmcMetadata.Parsers
@@ -29,53 +27,48 @@ namespace MediaBrowser.XbmcMetadata.Parsers
protected override void Fetch(MetadataResult<Episode> item, string metadataFile, XmlReaderSettings settings, CancellationToken cancellationToken)
{
using (var fileStream = File.OpenRead(metadataFile))
+ using (var streamReader = new StreamReader(fileStream, Encoding.UTF8))
{
- using (var streamReader = new StreamReader(fileStream, Encoding.UTF8))
- {
- item.ResetPeople();
+ item.ResetPeople();
- var xml = streamReader.ReadToEnd();
+ var xml = streamReader.ReadToEnd();
- var srch = "</episodedetails>";
- var index = xml.IndexOf(srch, StringComparison.OrdinalIgnoreCase);
+ var srch = "</episodedetails>";
+ var index = xml.IndexOf(srch, StringComparison.OrdinalIgnoreCase);
- if (index != -1)
- {
- xml = xml.Substring(0, index + srch.Length);
- }
+ if (index != -1)
+ {
+ xml = xml.Substring(0, index + srch.Length);
+ }
- // These are not going to be valid xml so no sense in causing the provider to fail and spamming the log with exceptions
- try
+ // These are not going to be valid xml so no sense in causing the provider to fail and spamming the log with exceptions
+ try
+ {
+ using (var stringReader = new StringReader(xml))
+ using (var reader = XmlReader.Create(stringReader, settings))
{
- using (var stringReader = new StringReader(xml))
+ reader.MoveToContent();
+ reader.Read();
+
+ // Loop through each element
+ while (!reader.EOF && reader.ReadState == ReadState.Interactive)
{
- // Use XmlReader for best performance
- using (var reader = XmlReader.Create(stringReader, settings))
+ cancellationToken.ThrowIfCancellationRequested();
+
+ if (reader.NodeType == XmlNodeType.Element)
+ {
+ FetchDataFromXmlNode(reader, item);
+ }
+ else
{
- reader.MoveToContent();
reader.Read();
-
- // Loop through each element
- while (!reader.EOF && reader.ReadState == ReadState.Interactive)
- {
- cancellationToken.ThrowIfCancellationRequested();
-
- if (reader.NodeType == XmlNodeType.Element)
- {
- FetchDataFromXmlNode(reader, item);
- }
- else
- {
- reader.Read();
- }
- }
}
}
}
- catch (XmlException)
- {
+ }
+ catch (XmlException)
+ {
- }
}
}
}
@@ -220,7 +213,8 @@ namespace MediaBrowser.XbmcMetadata.Parsers
}
}
- public EpisodeNfoParser(ILogger logger, IConfigurationManager config, IProviderManager providerManager, IFileSystem fileSystem, IXmlReaderSettingsFactory xmlReaderSettingsFactory) : base(logger, config, providerManager, fileSystem, xmlReaderSettingsFactory)
+ public EpisodeNfoParser(ILogger logger, IConfigurationManager config, IProviderManager providerManager)
+ : base(logger, config, providerManager)
{
}
}
diff --git a/MediaBrowser.XbmcMetadata/Parsers/MovieNfoParser.cs b/MediaBrowser.XbmcMetadata/Parsers/MovieNfoParser.cs
index a3e48d30d..0c4de9f33 100644
--- a/MediaBrowser.XbmcMetadata/Parsers/MovieNfoParser.cs
+++ b/MediaBrowser.XbmcMetadata/Parsers/MovieNfoParser.cs
@@ -7,8 +7,6 @@ using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Entities.Movies;
using MediaBrowser.Controller.Providers;
using MediaBrowser.Model.Entities;
-using MediaBrowser.Model.IO;
-using MediaBrowser.Model.Xml;
using Microsoft.Extensions.Logging;
namespace MediaBrowser.XbmcMetadata.Parsers
@@ -126,14 +124,7 @@ namespace MediaBrowser.XbmcMetadata.Parsers
// These are not going to be valid xml so no sense in causing the provider to fail and spamming the log with exceptions
try
{
- var settings = XmlReaderSettingsFactory.Create(false);
-
- settings.CheckCharacters = false;
- settings.IgnoreProcessingInstructions = true;
- settings.IgnoreComments = true;
-
- // Use XmlReader for best performance
- using (var reader = XmlReader.Create(stringReader, settings))
+ using (var reader = XmlReader.Create(stringReader, GetXmlReaderSettings()))
{
reader.MoveToContent();
reader.Read();
@@ -167,7 +158,8 @@ namespace MediaBrowser.XbmcMetadata.Parsers
}
}
- public MovieNfoParser(ILogger logger, IConfigurationManager config, IProviderManager providerManager, IFileSystem fileSystem, IXmlReaderSettingsFactory xmlReaderSettingsFactory) : base(logger, config, providerManager, fileSystem, xmlReaderSettingsFactory)
+ public MovieNfoParser(ILogger logger, IConfigurationManager config, IProviderManager providerManager)
+ : base(logger, config, providerManager)
{
}
}
diff --git a/MediaBrowser.XbmcMetadata/Parsers/SeasonNfoParser.cs b/MediaBrowser.XbmcMetadata/Parsers/SeasonNfoParser.cs
index 17f36d82d..882f3a9d3 100644
--- a/MediaBrowser.XbmcMetadata/Parsers/SeasonNfoParser.cs
+++ b/MediaBrowser.XbmcMetadata/Parsers/SeasonNfoParser.cs
@@ -3,8 +3,6 @@ using System.Xml;
using MediaBrowser.Common.Configuration;
using MediaBrowser.Controller.Entities.TV;
using MediaBrowser.Controller.Providers;
-using MediaBrowser.Model.IO;
-using MediaBrowser.Model.Xml;
using Microsoft.Extensions.Logging;
namespace MediaBrowser.XbmcMetadata.Parsers
@@ -42,7 +40,8 @@ namespace MediaBrowser.XbmcMetadata.Parsers
}
}
- public SeasonNfoParser(ILogger logger, IConfigurationManager config, IProviderManager providerManager, IFileSystem fileSystem, IXmlReaderSettingsFactory xmlReaderSettingsFactory) : base(logger, config, providerManager, fileSystem, xmlReaderSettingsFactory)
+ public SeasonNfoParser(ILogger logger, IConfigurationManager config, IProviderManager providerManager)
+ : base(logger, config, providerManager)
{
}
}
diff --git a/MediaBrowser.XbmcMetadata/Parsers/SeriesNfoParser.cs b/MediaBrowser.XbmcMetadata/Parsers/SeriesNfoParser.cs
index 700656b65..b0f25ae64 100644
--- a/MediaBrowser.XbmcMetadata/Parsers/SeriesNfoParser.cs
+++ b/MediaBrowser.XbmcMetadata/Parsers/SeriesNfoParser.cs
@@ -5,8 +5,6 @@ using MediaBrowser.Controller.Entities.TV;
using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.Providers;
using MediaBrowser.Model.Entities;
-using MediaBrowser.Model.IO;
-using MediaBrowser.Model.Xml;
using Microsoft.Extensions.Logging;
namespace MediaBrowser.XbmcMetadata.Parsers
@@ -94,7 +92,8 @@ namespace MediaBrowser.XbmcMetadata.Parsers
}
}
- public SeriesNfoParser(ILogger logger, IConfigurationManager config, IProviderManager providerManager, IFileSystem fileSystem, IXmlReaderSettingsFactory xmlReaderSettingsFactory) : base(logger, config, providerManager, fileSystem, xmlReaderSettingsFactory)
+ public SeriesNfoParser(ILogger logger, IConfigurationManager config, IProviderManager providerManager)
+ : base(logger, config, providerManager)
{
}
}
diff --git a/MediaBrowser.XbmcMetadata/Properties/AssemblyInfo.cs b/MediaBrowser.XbmcMetadata/Properties/AssemblyInfo.cs
index 11e513f1b..b3e2f2717 100644
--- a/MediaBrowser.XbmcMetadata/Properties/AssemblyInfo.cs
+++ b/MediaBrowser.XbmcMetadata/Properties/AssemblyInfo.cs
@@ -9,8 +9,8 @@ using System.Runtime.InteropServices;
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Jellyfin Project")]
-[assembly: AssemblyProduct("Jellyfin: The Free Software Media System")]
-[assembly: AssemblyCopyright("Copyright © 2019 Jellyfin Contributors. Code released under the GNU General Public License Version 2")]
+[assembly: AssemblyProduct("Jellyfin Server")]
+[assembly: AssemblyCopyright("Copyright © 2019 Jellyfin Contributors. Code released under the GNU General Public License")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: NeutralResourcesLanguage("en")]
diff --git a/MediaBrowser.XbmcMetadata/Providers/AlbumNfoProvider.cs b/MediaBrowser.XbmcMetadata/Providers/AlbumNfoProvider.cs
index 1e22bf358..6e6a22794 100644
--- a/MediaBrowser.XbmcMetadata/Providers/AlbumNfoProvider.cs
+++ b/MediaBrowser.XbmcMetadata/Providers/AlbumNfoProvider.cs
@@ -4,7 +4,6 @@ using MediaBrowser.Common.Configuration;
using MediaBrowser.Controller.Entities.Audio;
using MediaBrowser.Controller.Providers;
using MediaBrowser.Model.IO;
-using MediaBrowser.Model.Xml;
using MediaBrowser.XbmcMetadata.Parsers;
using Microsoft.Extensions.Logging;
@@ -15,20 +14,18 @@ namespace MediaBrowser.XbmcMetadata.Providers
private readonly ILogger _logger;
private readonly IConfigurationManager _config;
private readonly IProviderManager _providerManager;
- protected IXmlReaderSettingsFactory XmlReaderSettingsFactory { get; private set; }
- public AlbumNfoProvider(IFileSystem fileSystem, ILogger logger, IConfigurationManager config, IProviderManager providerManager, IXmlReaderSettingsFactory xmlReaderSettingsFactory)
+ public AlbumNfoProvider(IFileSystem fileSystem, ILogger logger, IConfigurationManager config, IProviderManager providerManager)
: base(fileSystem)
{
_logger = logger;
_config = config;
_providerManager = providerManager;
- XmlReaderSettingsFactory = xmlReaderSettingsFactory;
}
protected override void Fetch(MetadataResult<MusicAlbum> result, string path, CancellationToken cancellationToken)
{
- new BaseNfoParser<MusicAlbum>(_logger, _config, _providerManager, FileSystem, XmlReaderSettingsFactory).Fetch(result, path, cancellationToken);
+ new BaseNfoParser<MusicAlbum>(_logger, _config, _providerManager).Fetch(result, path, cancellationToken);
}
protected override FileSystemMetadata GetXmlFile(ItemInfo info, IDirectoryService directoryService)
diff --git a/MediaBrowser.XbmcMetadata/Providers/ArtistNfoProvider.cs b/MediaBrowser.XbmcMetadata/Providers/ArtistNfoProvider.cs
index ad811b475..20abfc7f3 100644
--- a/MediaBrowser.XbmcMetadata/Providers/ArtistNfoProvider.cs
+++ b/MediaBrowser.XbmcMetadata/Providers/ArtistNfoProvider.cs
@@ -4,7 +4,6 @@ using MediaBrowser.Common.Configuration;
using MediaBrowser.Controller.Entities.Audio;
using MediaBrowser.Controller.Providers;
using MediaBrowser.Model.IO;
-using MediaBrowser.Model.Xml;
using MediaBrowser.XbmcMetadata.Parsers;
using Microsoft.Extensions.Logging;
@@ -15,20 +14,18 @@ namespace MediaBrowser.XbmcMetadata.Providers
private readonly ILogger _logger;
private readonly IConfigurationManager _config;
private readonly IProviderManager _providerManager;
- protected IXmlReaderSettingsFactory XmlReaderSettingsFactory { get; private set; }
- public ArtistNfoProvider(IFileSystem fileSystem, ILogger logger, IConfigurationManager config, IProviderManager providerManager, IXmlReaderSettingsFactory xmlReaderSettingsFactory)
+ public ArtistNfoProvider(IFileSystem fileSystem, ILogger logger, IConfigurationManager config, IProviderManager providerManager)
: base(fileSystem)
{
_logger = logger;
_config = config;
_providerManager = providerManager;
- XmlReaderSettingsFactory = xmlReaderSettingsFactory;
}
protected override void Fetch(MetadataResult<MusicArtist> result, string path, CancellationToken cancellationToken)
{
- new BaseNfoParser<MusicArtist>(_logger, _config, _providerManager, FileSystem, XmlReaderSettingsFactory).Fetch(result, path, cancellationToken);
+ new BaseNfoParser<MusicArtist>(_logger, _config, _providerManager).Fetch(result, path, cancellationToken);
}
protected override FileSystemMetadata GetXmlFile(ItemInfo info, IDirectoryService directoryService)
diff --git a/MediaBrowser.XbmcMetadata/Providers/BaseVideoNfoProvider.cs b/MediaBrowser.XbmcMetadata/Providers/BaseVideoNfoProvider.cs
index 94f104f61..28a0514d5 100644
--- a/MediaBrowser.XbmcMetadata/Providers/BaseVideoNfoProvider.cs
+++ b/MediaBrowser.XbmcMetadata/Providers/BaseVideoNfoProvider.cs
@@ -4,7 +4,6 @@ using MediaBrowser.Common.Configuration;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Providers;
using MediaBrowser.Model.IO;
-using MediaBrowser.Model.Xml;
using MediaBrowser.XbmcMetadata.Parsers;
using MediaBrowser.XbmcMetadata.Savers;
using Microsoft.Extensions.Logging;
@@ -17,15 +16,13 @@ namespace MediaBrowser.XbmcMetadata.Providers
private readonly ILogger _logger;
private readonly IConfigurationManager _config;
private readonly IProviderManager _providerManager;
- protected IXmlReaderSettingsFactory XmlReaderSettingsFactory { get; private set; }
- public BaseVideoNfoProvider(IFileSystem fileSystem, ILogger logger, IConfigurationManager config, IProviderManager providerManager, IXmlReaderSettingsFactory xmlReaderSettingsFactory)
+ public BaseVideoNfoProvider(IFileSystem fileSystem, ILogger logger, IConfigurationManager config, IProviderManager providerManager)
: base(fileSystem)
{
_logger = logger;
_config = config;
_providerManager = providerManager;
- XmlReaderSettingsFactory = xmlReaderSettingsFactory;
}
protected override void Fetch(MetadataResult<T> result, string path, CancellationToken cancellationToken)
@@ -34,7 +31,7 @@ namespace MediaBrowser.XbmcMetadata.Providers
{
Item = result.Item
};
- new MovieNfoParser(_logger, _config, _providerManager, FileSystem, XmlReaderSettingsFactory).Fetch(tmpItem, path, cancellationToken);
+ new MovieNfoParser(_logger, _config, _providerManager).Fetch(tmpItem, path, cancellationToken);
result.Item = (T)tmpItem.Item;
result.People = tmpItem.People;
diff --git a/MediaBrowser.XbmcMetadata/Providers/EpisodeNfoProvider.cs b/MediaBrowser.XbmcMetadata/Providers/EpisodeNfoProvider.cs
index bf05f0f38..f90f283cf 100644
--- a/MediaBrowser.XbmcMetadata/Providers/EpisodeNfoProvider.cs
+++ b/MediaBrowser.XbmcMetadata/Providers/EpisodeNfoProvider.cs
@@ -5,7 +5,6 @@ using MediaBrowser.Common.Configuration;
using MediaBrowser.Controller.Entities.TV;
using MediaBrowser.Controller.Providers;
using MediaBrowser.Model.IO;
-using MediaBrowser.Model.Xml;
using MediaBrowser.XbmcMetadata.Parsers;
using Microsoft.Extensions.Logging;
@@ -16,22 +15,20 @@ namespace MediaBrowser.XbmcMetadata.Providers
private readonly ILogger _logger;
private readonly IConfigurationManager _config;
private readonly IProviderManager _providerManager;
- protected IXmlReaderSettingsFactory XmlReaderSettingsFactory { get; private set; }
- public EpisodeNfoProvider(IFileSystem fileSystem, ILogger logger, IConfigurationManager config, IProviderManager providerManager, IXmlReaderSettingsFactory xmlReaderSettingsFactory)
+ public EpisodeNfoProvider(IFileSystem fileSystem, ILogger logger, IConfigurationManager config, IProviderManager providerManager)
: base(fileSystem)
{
_logger = logger;
_config = config;
_providerManager = providerManager;
- XmlReaderSettingsFactory = xmlReaderSettingsFactory;
}
protected override void Fetch(MetadataResult<Episode> result, string path, CancellationToken cancellationToken)
{
var images = new List<LocalImageInfo>();
- new EpisodeNfoParser(_logger, _config, _providerManager, FileSystem, XmlReaderSettingsFactory).Fetch(result, images, path, cancellationToken);
+ new EpisodeNfoParser(_logger, _config, _providerManager).Fetch(result, images, path, cancellationToken);
result.Images = images;
}
diff --git a/MediaBrowser.XbmcMetadata/Providers/MovieNfoProvider.cs b/MediaBrowser.XbmcMetadata/Providers/MovieNfoProvider.cs
index 77b3b3781..d21164c02 100644
--- a/MediaBrowser.XbmcMetadata/Providers/MovieNfoProvider.cs
+++ b/MediaBrowser.XbmcMetadata/Providers/MovieNfoProvider.cs
@@ -3,28 +3,30 @@ using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Entities.Movies;
using MediaBrowser.Controller.Providers;
using MediaBrowser.Model.IO;
-using MediaBrowser.Model.Xml;
using Microsoft.Extensions.Logging;
namespace MediaBrowser.XbmcMetadata.Providers
{
public class MovieNfoProvider : BaseVideoNfoProvider<Movie>
{
- public MovieNfoProvider(IFileSystem fileSystem, ILogger logger, IConfigurationManager config, IProviderManager providerManager, IXmlReaderSettingsFactory xmlReaderSettingsFactory) : base(fileSystem, logger, config, providerManager, xmlReaderSettingsFactory)
+ public MovieNfoProvider(IFileSystem fileSystem, ILogger logger, IConfigurationManager config, IProviderManager providerManager)
+ : base(fileSystem, logger, config, providerManager)
{
}
}
public class MusicVideoNfoProvider : BaseVideoNfoProvider<MusicVideo>
{
- public MusicVideoNfoProvider(IFileSystem fileSystem, ILogger logger, IConfigurationManager config, IProviderManager providerManager, IXmlReaderSettingsFactory xmlReaderSettingsFactory) : base(fileSystem, logger, config, providerManager, xmlReaderSettingsFactory)
+ public MusicVideoNfoProvider(IFileSystem fileSystem, ILogger logger, IConfigurationManager config, IProviderManager providerManager)
+ : base(fileSystem, logger, config, providerManager)
{
}
}
public class VideoNfoProvider : BaseVideoNfoProvider<Video>
{
- public VideoNfoProvider(IFileSystem fileSystem, ILogger logger, IConfigurationManager config, IProviderManager providerManager, IXmlReaderSettingsFactory xmlReaderSettingsFactory) : base(fileSystem, logger, config, providerManager, xmlReaderSettingsFactory)
+ public VideoNfoProvider(IFileSystem fileSystem, ILogger logger, IConfigurationManager config, IProviderManager providerManager)
+ : base(fileSystem, logger, config, providerManager)
{
}
}
diff --git a/MediaBrowser.XbmcMetadata/Providers/SeasonNfoProvider.cs b/MediaBrowser.XbmcMetadata/Providers/SeasonNfoProvider.cs
index e669a86a3..0ebc30293 100644
--- a/MediaBrowser.XbmcMetadata/Providers/SeasonNfoProvider.cs
+++ b/MediaBrowser.XbmcMetadata/Providers/SeasonNfoProvider.cs
@@ -4,7 +4,6 @@ using MediaBrowser.Common.Configuration;
using MediaBrowser.Controller.Entities.TV;
using MediaBrowser.Controller.Providers;
using MediaBrowser.Model.IO;
-using MediaBrowser.Model.Xml;
using MediaBrowser.XbmcMetadata.Parsers;
using Microsoft.Extensions.Logging;
@@ -15,26 +14,22 @@ namespace MediaBrowser.XbmcMetadata.Providers
private readonly ILogger _logger;
private readonly IConfigurationManager _config;
private readonly IProviderManager _providerManager;
- protected IXmlReaderSettingsFactory XmlReaderSettingsFactory { get; private set; }
- public SeasonNfoProvider(IFileSystem fileSystem, ILogger logger, IConfigurationManager config, IProviderManager providerManager, IXmlReaderSettingsFactory xmlReaderSettingsFactory)
+ public SeasonNfoProvider(IFileSystem fileSystem, ILogger logger, IConfigurationManager config, IProviderManager providerManager)
: base(fileSystem)
{
_logger = logger;
_config = config;
_providerManager = providerManager;
- XmlReaderSettingsFactory = xmlReaderSettingsFactory;
}
protected override void Fetch(MetadataResult<Season> result, string path, CancellationToken cancellationToken)
{
- new SeasonNfoParser(_logger, _config, _providerManager, FileSystem, XmlReaderSettingsFactory).Fetch(result, path, cancellationToken);
+ new SeasonNfoParser(_logger, _config, _providerManager).Fetch(result, path, cancellationToken);
}
protected override FileSystemMetadata GetXmlFile(ItemInfo info, IDirectoryService directoryService)
- {
- return directoryService.GetFile(Path.Combine(info.Path, "season.nfo"));
- }
+ => directoryService.GetFile(Path.Combine(info.Path, "season.nfo"));
}
}
diff --git a/MediaBrowser.XbmcMetadata/Providers/SeriesNfoProvider.cs b/MediaBrowser.XbmcMetadata/Providers/SeriesNfoProvider.cs
index d90a65535..19ac3dc97 100644
--- a/MediaBrowser.XbmcMetadata/Providers/SeriesNfoProvider.cs
+++ b/MediaBrowser.XbmcMetadata/Providers/SeriesNfoProvider.cs
@@ -4,7 +4,6 @@ using MediaBrowser.Common.Configuration;
using MediaBrowser.Controller.Entities.TV;
using MediaBrowser.Controller.Providers;
using MediaBrowser.Model.IO;
-using MediaBrowser.Model.Xml;
using MediaBrowser.XbmcMetadata.Parsers;
using Microsoft.Extensions.Logging;
@@ -15,27 +14,21 @@ namespace MediaBrowser.XbmcMetadata.Providers
private readonly ILogger _logger;
private readonly IConfigurationManager _config;
private readonly IProviderManager _providerManager;
- private readonly IFileSystem _fileSystem;
- protected IXmlReaderSettingsFactory XmlReaderSettingsFactory { get; private set; }
- public SeriesNfoProvider(IFileSystem fileSystem, ILogger logger, IConfigurationManager config, IProviderManager providerManager, IFileSystem fileSystem1, IXmlReaderSettingsFactory xmlReaderSettingsFactory)
+ public SeriesNfoProvider(IFileSystem fileSystem, ILogger logger, IConfigurationManager config, IProviderManager providerManager)
: base(fileSystem)
{
_logger = logger;
_config = config;
_providerManager = providerManager;
- _fileSystem = fileSystem1;
- XmlReaderSettingsFactory = xmlReaderSettingsFactory;
}
protected override void Fetch(MetadataResult<Series> result, string path, CancellationToken cancellationToken)
{
- new SeriesNfoParser(_logger, _config, _providerManager, _fileSystem, XmlReaderSettingsFactory).Fetch(result, path, cancellationToken);
+ new SeriesNfoParser(_logger, _config, _providerManager).Fetch(result, path, cancellationToken);
}
protected override FileSystemMetadata GetXmlFile(ItemInfo info, IDirectoryService directoryService)
- {
- return directoryService.GetFile(Path.Combine(info.Path, "tvshow.nfo"));
- }
+ => directoryService.GetFile(Path.Combine(info.Path, "tvshow.nfo"));
}
}
diff --git a/MediaBrowser.XbmcMetadata/Savers/AlbumNfoSaver.cs b/MediaBrowser.XbmcMetadata/Savers/AlbumNfoSaver.cs
index 79f119d7f..430b93199 100644
--- a/MediaBrowser.XbmcMetadata/Savers/AlbumNfoSaver.cs
+++ b/MediaBrowser.XbmcMetadata/Savers/AlbumNfoSaver.cs
@@ -9,7 +9,6 @@ using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Entities.Audio;
using MediaBrowser.Controller.Library;
using MediaBrowser.Model.IO;
-using MediaBrowser.Model.Xml;
using Microsoft.Extensions.Logging;
namespace MediaBrowser.XbmcMetadata.Savers
@@ -94,7 +93,8 @@ namespace MediaBrowser.XbmcMetadata.Savers
return list;
}
- public AlbumNfoSaver(IFileSystem fileSystem, IServerConfigurationManager configurationManager, ILibraryManager libraryManager, IUserManager userManager, IUserDataManager userDataManager, ILogger logger, IXmlReaderSettingsFactory xmlReaderSettingsFactory) : base(fileSystem, configurationManager, libraryManager, userManager, userDataManager, logger, xmlReaderSettingsFactory)
+ public AlbumNfoSaver(IFileSystem fileSystem, IServerConfigurationManager configurationManager, ILibraryManager libraryManager, IUserManager userManager, IUserDataManager userDataManager, ILogger logger)
+ : base(fileSystem, configurationManager, libraryManager, userManager, userDataManager, logger)
{
}
}
diff --git a/MediaBrowser.XbmcMetadata/Savers/ArtistNfoSaver.cs b/MediaBrowser.XbmcMetadata/Savers/ArtistNfoSaver.cs
index f01132fd9..0876db5c1 100644
--- a/MediaBrowser.XbmcMetadata/Savers/ArtistNfoSaver.cs
+++ b/MediaBrowser.XbmcMetadata/Savers/ArtistNfoSaver.cs
@@ -7,7 +7,6 @@ using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Entities.Audio;
using MediaBrowser.Controller.Library;
using MediaBrowser.Model.IO;
-using MediaBrowser.Model.Xml;
using MediaBrowser.XbmcMetadata.Configuration;
using Microsoft.Extensions.Logging;
@@ -85,7 +84,8 @@ namespace MediaBrowser.XbmcMetadata.Savers
return list;
}
- public ArtistNfoSaver(IFileSystem fileSystem, IServerConfigurationManager configurationManager, ILibraryManager libraryManager, IUserManager userManager, IUserDataManager userDataManager, ILogger logger, IXmlReaderSettingsFactory xmlReaderSettingsFactory) : base(fileSystem, configurationManager, libraryManager, userManager, userDataManager, logger, xmlReaderSettingsFactory)
+ public ArtistNfoSaver(IFileSystem fileSystem, IServerConfigurationManager configurationManager, ILibraryManager libraryManager, IUserManager userManager, IUserDataManager userDataManager, ILogger logger)
+ : base(fileSystem, configurationManager, libraryManager, userManager, userDataManager, logger)
{
}
}
diff --git a/MediaBrowser.XbmcMetadata/Savers/BaseNfoSaver.cs b/MediaBrowser.XbmcMetadata/Savers/BaseNfoSaver.cs
index 4925c7cd1..3ae72c472 100644
--- a/MediaBrowser.XbmcMetadata/Savers/BaseNfoSaver.cs
+++ b/MediaBrowser.XbmcMetadata/Savers/BaseNfoSaver.cs
@@ -18,7 +18,6 @@ using MediaBrowser.Model.Configuration;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Extensions;
using MediaBrowser.Model.IO;
-using MediaBrowser.Model.Xml;
using MediaBrowser.XbmcMetadata.Configuration;
using Microsoft.Extensions.Logging;
@@ -97,10 +96,15 @@ namespace MediaBrowser.XbmcMetadata.Savers
}.ToDictionary(i => i, StringComparer.OrdinalIgnoreCase);
- protected BaseNfoSaver(IFileSystem fileSystem, IServerConfigurationManager configurationManager, ILibraryManager libraryManager, IUserManager userManager, IUserDataManager userDataManager, ILogger logger, IXmlReaderSettingsFactory xmlReaderSettingsFactory)
+ protected BaseNfoSaver(
+ IFileSystem fileSystem,
+ IServerConfigurationManager configurationManager,
+ ILibraryManager libraryManager,
+ IUserManager userManager,
+ IUserDataManager userDataManager,
+ ILogger logger)
{
Logger = logger;
- XmlReaderSettingsFactory = xmlReaderSettingsFactory;
UserDataManager = userDataManager;
UserManager = userManager;
LibraryManager = libraryManager;
@@ -114,7 +118,6 @@ namespace MediaBrowser.XbmcMetadata.Savers
protected IUserManager UserManager { get; private set; }
protected IUserDataManager UserDataManager { get; private set; }
protected ILogger Logger { get; private set; }
- protected IXmlReaderSettingsFactory XmlReaderSettingsFactory { get; private set; }
protected ItemUpdateType MinimumUpdateType
{
@@ -961,52 +964,49 @@ namespace MediaBrowser.XbmcMetadata.Savers
private void AddCustomTags(string path, List<string> xmlTagsUsed, XmlWriter writer, ILogger logger, IFileSystem fileSystem)
{
- var settings = XmlReaderSettingsFactory.Create(false);
-
- settings.CheckCharacters = false;
- settings.IgnoreProcessingInstructions = true;
- settings.IgnoreComments = true;
+ var settings = new XmlReaderSettings()
+ {
+ ValidationType = ValidationType.None,
+ CheckCharacters = false,
+ IgnoreProcessingInstructions = true,
+ IgnoreComments = true
+ };
using (var fileStream = File.OpenRead(path))
+ using (var streamReader = new StreamReader(fileStream, Encoding.UTF8))
+ using (var reader = XmlReader.Create(streamReader, settings))
{
- using (var streamReader = new StreamReader(fileStream, Encoding.UTF8))
+ try
+ {
+ reader.MoveToContent();
+ }
+ catch (Exception ex)
{
- // Use XmlReader for best performance
- using (var reader = XmlReader.Create(streamReader, settings))
+ logger.LogError(ex, "Error reading existing xml tags from {path}.", path);
+ return;
+ }
+
+ reader.Read();
+
+ // Loop through each element
+ while (!reader.EOF && reader.ReadState == ReadState.Interactive)
+ {
+ if (reader.NodeType == XmlNodeType.Element)
{
- try
+ var name = reader.Name;
+
+ if (!CommonTags.ContainsKey(name) && !xmlTagsUsed.Contains(name, StringComparer.OrdinalIgnoreCase))
{
- reader.MoveToContent();
+ writer.WriteNode(reader, false);
}
- catch (Exception ex)
+ else
{
- logger.LogError(ex, "Error reading existing xml tags from {path}.", path);
- return;
+ reader.Skip();
}
-
+ }
+ else
+ {
reader.Read();
-
- // Loop through each element
- while (!reader.EOF && reader.ReadState == ReadState.Interactive)
- {
- if (reader.NodeType == XmlNodeType.Element)
- {
- var name = reader.Name;
-
- if (!CommonTags.ContainsKey(name) && !xmlTagsUsed.Contains(name, StringComparer.OrdinalIgnoreCase))
- {
- writer.WriteNode(reader, false);
- }
- else
- {
- reader.Skip();
- }
- }
- else
- {
- reader.Read();
- }
- }
}
}
}
diff --git a/MediaBrowser.XbmcMetadata/Savers/EpisodeNfoSaver.cs b/MediaBrowser.XbmcMetadata/Savers/EpisodeNfoSaver.cs
index 05a7a44f9..cf1b6468a 100644
--- a/MediaBrowser.XbmcMetadata/Savers/EpisodeNfoSaver.cs
+++ b/MediaBrowser.XbmcMetadata/Savers/EpisodeNfoSaver.cs
@@ -7,7 +7,6 @@ using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Entities.TV;
using MediaBrowser.Controller.Library;
using MediaBrowser.Model.IO;
-using MediaBrowser.Model.Xml;
using MediaBrowser.XbmcMetadata.Configuration;
using Microsoft.Extensions.Logging;
@@ -109,7 +108,8 @@ namespace MediaBrowser.XbmcMetadata.Savers
return list;
}
- public EpisodeNfoSaver(IFileSystem fileSystem, IServerConfigurationManager configurationManager, ILibraryManager libraryManager, IUserManager userManager, IUserDataManager userDataManager, ILogger logger, IXmlReaderSettingsFactory xmlReaderSettingsFactory) : base(fileSystem, configurationManager, libraryManager, userManager, userDataManager, logger, xmlReaderSettingsFactory)
+ public EpisodeNfoSaver(IFileSystem fileSystem, IServerConfigurationManager configurationManager, ILibraryManager libraryManager, IUserManager userManager, IUserDataManager userDataManager, ILogger logger)
+ : base(fileSystem, configurationManager, libraryManager, userManager, userDataManager, logger)
{
}
}
diff --git a/MediaBrowser.XbmcMetadata/Savers/MovieNfoSaver.cs b/MediaBrowser.XbmcMetadata/Savers/MovieNfoSaver.cs
index b3bbe539a..5e0eff029 100644
--- a/MediaBrowser.XbmcMetadata/Savers/MovieNfoSaver.cs
+++ b/MediaBrowser.XbmcMetadata/Savers/MovieNfoSaver.cs
@@ -9,7 +9,6 @@ using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.Providers;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.IO;
-using MediaBrowser.Model.Xml;
using Microsoft.Extensions.Logging;
namespace MediaBrowser.XbmcMetadata.Savers
@@ -129,7 +128,8 @@ namespace MediaBrowser.XbmcMetadata.Savers
return list;
}
- public MovieNfoSaver(IFileSystem fileSystem, IServerConfigurationManager configurationManager, ILibraryManager libraryManager, IUserManager userManager, IUserDataManager userDataManager, ILogger logger, IXmlReaderSettingsFactory xmlReaderSettingsFactory) : base(fileSystem, configurationManager, libraryManager, userManager, userDataManager, logger, xmlReaderSettingsFactory)
+ public MovieNfoSaver(IFileSystem fileSystem, IServerConfigurationManager configurationManager, ILibraryManager libraryManager, IUserManager userManager, IUserDataManager userDataManager, ILogger logger)
+ : base(fileSystem, configurationManager, libraryManager, userManager, userDataManager, logger)
{
}
}
diff --git a/MediaBrowser.XbmcMetadata/Savers/SeasonNfoSaver.cs b/MediaBrowser.XbmcMetadata/Savers/SeasonNfoSaver.cs
index 5246bec02..aa8d3e96c 100644
--- a/MediaBrowser.XbmcMetadata/Savers/SeasonNfoSaver.cs
+++ b/MediaBrowser.XbmcMetadata/Savers/SeasonNfoSaver.cs
@@ -7,7 +7,6 @@ using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Entities.TV;
using MediaBrowser.Controller.Library;
using MediaBrowser.Model.IO;
-using MediaBrowser.Model.Xml;
using Microsoft.Extensions.Logging;
namespace MediaBrowser.XbmcMetadata.Savers
@@ -66,9 +65,8 @@ namespace MediaBrowser.XbmcMetadata.Savers
ILibraryManager libraryManager,
IUserManager userManager,
IUserDataManager userDataManager,
- ILogger logger,
- IXmlReaderSettingsFactory xmlReaderSettingsFactory)
- : base(fileSystem, configurationManager, libraryManager, userManager, userDataManager, logger, xmlReaderSettingsFactory)
+ ILogger logger)
+ : base(fileSystem, configurationManager, libraryManager, userManager, userDataManager, logger)
{
}
}
diff --git a/MediaBrowser.XbmcMetadata/Savers/SeriesNfoSaver.cs b/MediaBrowser.XbmcMetadata/Savers/SeriesNfoSaver.cs
index 0ef267a1d..b0fc8c368 100644
--- a/MediaBrowser.XbmcMetadata/Savers/SeriesNfoSaver.cs
+++ b/MediaBrowser.XbmcMetadata/Savers/SeriesNfoSaver.cs
@@ -7,7 +7,6 @@ using MediaBrowser.Controller.Entities.TV;
using MediaBrowser.Controller.Library;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.IO;
-using MediaBrowser.Model.Xml;
using Microsoft.Extensions.Logging;
namespace MediaBrowser.XbmcMetadata.Savers
@@ -83,7 +82,8 @@ namespace MediaBrowser.XbmcMetadata.Savers
return list;
}
- public SeriesNfoSaver(IFileSystem fileSystem, IServerConfigurationManager configurationManager, ILibraryManager libraryManager, IUserManager userManager, IUserDataManager userDataManager, ILogger logger, IXmlReaderSettingsFactory xmlReaderSettingsFactory) : base(fileSystem, configurationManager, libraryManager, userManager, userDataManager, logger, xmlReaderSettingsFactory)
+ public SeriesNfoSaver(IFileSystem fileSystem, IServerConfigurationManager configurationManager, ILibraryManager libraryManager, IUserManager userManager, IUserDataManager userDataManager, ILogger logger)
+ : base(fileSystem, configurationManager, libraryManager, userManager, userDataManager, logger)
{
}
}
diff --git a/MediaBrowser.sln b/MediaBrowser.sln
index e43a58224..3ed86d65c 100644
--- a/MediaBrowser.sln
+++ b/MediaBrowser.sln
@@ -15,8 +15,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MediaBrowser.WebDashboard",
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MediaBrowser.Providers", "MediaBrowser.Providers\MediaBrowser.Providers.csproj", "{442B5058-DCAF-4263-BB6A-F21E31120A1B}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenSubtitlesHandler", "OpenSubtitlesHandler\OpenSubtitlesHandler.csproj", "{4A4402D4-E910-443B-B8FC-2C18286A2CA0}"
-EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MediaBrowser.XbmcMetadata", "MediaBrowser.XbmcMetadata\MediaBrowser.XbmcMetadata.csproj", "{23499896-B135-4527-8574-C26E926EA99E}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MediaBrowser.LocalMetadata", "MediaBrowser.LocalMetadata\MediaBrowser.LocalMetadata.csproj", "{7EF9F3E0-697D-42F3-A08F-19DEB5F84392}"
@@ -180,7 +178,7 @@ Global
GlobalSection(MonoDevelopProperties) = preSolution
Policies = $0
$0.StandardHeader = $1
- $1.Text = @### This header should be used to start new files.\n### It provides an explicit per-file license reference that should be present on all new files.\n### To use this header, delete these lines and the following empty line, modify <filename> to\n### the proper full path, and then add new code following the header and a single empty line.\n\n// ${FileName}\n// Part of the Jellyfin project (https://jellyfin.media)\n//\n// All copyright belongs to the Jellyfin contributors; a full list can\n// be found in the file CONTRIBUTORS.md\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, version 2.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with this program. If not, see <https://www.gnu.org/licenses/>.\n
+ $1.IncludeInNewFiles = False
$0.DotNetNamingPolicy = $2
$2.DirectoryNamespaceAssociation = PrefixedHierarchical
EndGlobalSection
diff --git a/Mono.Nat/Properties/AssemblyInfo.cs b/Mono.Nat/Properties/AssemblyInfo.cs
index ea1c9dee6..dc47f2ffe 100644
--- a/Mono.Nat/Properties/AssemblyInfo.cs
+++ b/Mono.Nat/Properties/AssemblyInfo.cs
@@ -9,8 +9,8 @@ using System.Runtime.InteropServices;
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Jellyfin Project")]
-[assembly: AssemblyProduct("Jellyfin: The Free Software Media System")]
-[assembly: AssemblyCopyright("Copyright © 2006 Alan McGovern. Copyright © 2007 Ben Motmans. Code releases unde the MIT license. Copyright © 2019 Jellyfin Contributors. Code released under the GNU General Public License Version 2")]
+[assembly: AssemblyProduct("Jellyfin Server")]
+[assembly: AssemblyCopyright("Copyright © 2006 Alan McGovern. Copyright © 2007 Ben Motmans. Code releases under the MIT license. Copyright © 2019 Jellyfin Contributors. Code released under the GNU General Public License")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: NeutralResourcesLanguage("en")]
diff --git a/OpenSubtitlesHandler/Console/OSHConsole.cs b/OpenSubtitlesHandler/Console/OSHConsole.cs
deleted file mode 100644
index 396b28cbc..000000000
--- a/OpenSubtitlesHandler/Console/OSHConsole.cs
+++ /dev/null
@@ -1,92 +0,0 @@
-/* This file is part of OpenSubtitles Handler
- A library that handle OpenSubtitles.org XML-RPC methods.
-
- Copyright © Ala Ibrahim Hadid 2013
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-using System;
-
-namespace OpenSubtitlesHandler.Console
-{
- public class OSHConsole
- {
- /// <summary>
- /// Write line to the console and raise the "LineWritten" event
- /// </summary>
- ///
- /// <param name="text">The debug line</param>
- /// <param name="code">The status</param>
- public static void WriteLine(string text, DebugCode code = DebugCode.None)
- {
- if (LineWritten != null)
- LineWritten(null, new DebugEventArgs(text, code));
- }
- /// <summary>
- /// Update the last written line
- /// </summary>
- /// <param name="text">The debug line</param>
- /// <param name="code">The status</param>
- public static void UpdateLine(string text, DebugCode code = DebugCode.None)
- {
- if (UpdateLastLine != null)
- UpdateLastLine(null, new DebugEventArgs(text, code));
- }
-
- public static event EventHandler<DebugEventArgs> LineWritten;
- public static event EventHandler<DebugEventArgs> UpdateLastLine;
- }
- public enum DebugCode
- {
- None,
- Good,
- Warning,
- Error
- }
- /// <summary>
- /// Console Debug Args
- /// </summary>
- public class DebugEventArgs : EventArgs
- {
- public DebugCode Code { get; private set; }
- public string Text { get; private set; }
-
- /// <summary>
- /// Console Debug Args
- /// </summary>
- /// <param name="text">The debug line</param>
- /// <param name="code">The status</param>
- public DebugEventArgs(string text, DebugCode code)
- {
- this.Text = text;
- this.Code = code;
- }
- }
- public struct DebugLine
- {
- public DebugLine(string debugLine, DebugCode status)
- {
- this.debugLine = debugLine;
- this.status = status;
- }
- string debugLine;
- DebugCode status;
-
- public string Text
- { get { return debugLine; } set { debugLine = value; } }
- public DebugCode Code
- { get { return status; } set { status = value; } }
- }
-}
diff --git a/OpenSubtitlesHandler/Interfaces/IMethodResponse.cs b/OpenSubtitlesHandler/Interfaces/IMethodResponse.cs
deleted file mode 100644
index 3450beff5..000000000
--- a/OpenSubtitlesHandler/Interfaces/IMethodResponse.cs
+++ /dev/null
@@ -1,71 +0,0 @@
-/* This file is part of OpenSubtitles Handler
- A library that handle OpenSubtitles.org XML-RPC methods.
-
- Copyright © Ala Ibrahim Hadid 2013
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-using System;
-
-namespace OpenSubtitlesHandler
-{
- /// <summary>
- /// When you call a method to communicate with OpenSubtitles server, that method should return this response with the reuired information.
- /// </summary>
- public abstract class IMethodResponse
- {
- public IMethodResponse() { LoadAttributes(); }
- public IMethodResponse(string name, string message)
- {
- this.name = name;
- this.message = message;
- }
- protected string name;
- protected string message;
- protected double seconds;
- protected string status;
-
- protected void LoadAttributes()
- {
- //foreach (Attribute attr in Attribute.GetCustomAttributes(this.GetType()))
- //{
- // if (attr.GetType() == typeof(MethodResponseDescription))
- // {
- // this.name = ((MethodResponseDescription)attr).Name;
- // this.message = ((MethodResponseDescription)attr).Message;
- // break;
- // }
- //}
- }
-
- [Description("The name of this response"), Category("MethodResponse")]
- public virtual string Name { get { return name; } set { name = value; } }
- [Description("The message about this response"), Category("MethodResponse")]
- public virtual string Message { get { return message; } set { message = value; } }
- [Description("Time taken to execute this command on server"), Category("MethodResponse")]
- public double Seconds { get { return seconds; } set { seconds = value; } }
- [Description("The status"), Category("MethodResponse")]
- public string Status { get { return status; } set { status = value; } }
- }
-
- public class DescriptionAttribute : Attribute
- {
- public DescriptionAttribute(string text) { }
- }
-
- public class CategoryAttribute : Attribute
- {
- public CategoryAttribute(string text) { }
- }
-}
diff --git a/OpenSubtitlesHandler/Interfaces/MethodResponseAttr.cs b/OpenSubtitlesHandler/Interfaces/MethodResponseAttr.cs
deleted file mode 100644
index a7e49032d..000000000
--- a/OpenSubtitlesHandler/Interfaces/MethodResponseAttr.cs
+++ /dev/null
@@ -1,40 +0,0 @@
-/* This file is part of OpenSubtitles Handler
- A library that handle OpenSubtitles.org XML-RPC methods.
-
- Copyright © Ala Ibrahim Hadid 2013
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-using System;
-
-namespace OpenSubtitlesHandler
-{
- /// <summary>
- /// Attributes to describe a method response object.
- /// </summary>
- public class MethodResponseDescription : Attribute
- {
- public MethodResponseDescription(string name, string message)
- {
- this.name = name;
- this.message = message;
- }
-
- private string name;
- private string message;
-
- public string Name { get { return name; } set { name = value; } }
- public string Message { get { return message; } set { message = value; } }
- }
-}
diff --git a/OpenSubtitlesHandler/Languages/DetectLanguageResult.cs b/OpenSubtitlesHandler/Languages/DetectLanguageResult.cs
deleted file mode 100644
index 3e72dc65c..000000000
--- a/OpenSubtitlesHandler/Languages/DetectLanguageResult.cs
+++ /dev/null
@@ -1,31 +0,0 @@
-/* This file is part of OpenSubtitles Handler
- A library that handle OpenSubtitles.org XML-RPC methods.
-
- Copyright © Ala Ibrahim Hadid 2013
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-namespace OpenSubtitlesHandler
-{
- public struct DetectLanguageResult
- {
- private string inputSample;
- private string languageID;
-
- public string LanguageID
- { get { return languageID; } set { languageID = value; } }
- public string InputSample
- { get { return inputSample; } set { inputSample = value; } }
- }
-}
diff --git a/OpenSubtitlesHandler/MethodResponses/MethodResponseAddComment.cs b/OpenSubtitlesHandler/MethodResponses/MethodResponseAddComment.cs
deleted file mode 100644
index 03d0337d4..000000000
--- a/OpenSubtitlesHandler/MethodResponses/MethodResponseAddComment.cs
+++ /dev/null
@@ -1,32 +0,0 @@
-/* This file is part of OpenSubtitles Handler
- A library that handle OpenSubtitles.org XML-RPC methods.
-
- Copyright © Ala Ibrahim Hadid 2013
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-namespace OpenSubtitlesHandler
-{
- [MethodResponseDescription("AddComment method response",
- "AddComment method response hold all expected values from server.")]
- public class MethodResponseAddComment : IMethodResponse
- {
- public MethodResponseAddComment()
- : base()
- { }
- public MethodResponseAddComment(string name, string message)
- : base(name, message)
- { }
- }
-}
diff --git a/OpenSubtitlesHandler/MethodResponses/MethodResponseAddRequest.cs b/OpenSubtitlesHandler/MethodResponses/MethodResponseAddRequest.cs
deleted file mode 100644
index b996043c2..000000000
--- a/OpenSubtitlesHandler/MethodResponses/MethodResponseAddRequest.cs
+++ /dev/null
@@ -1,35 +0,0 @@
-/* This file is part of OpenSubtitles Handler
- A library that handle OpenSubtitles.org XML-RPC methods.
-
- Copyright © Ala Ibrahim Hadid 2013
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-namespace OpenSubtitlesHandler
-{
- [MethodResponseDescription("AddRequest method response",
- "AddRequest method response hold all expected values from server.")]
- public class MethodResponseAddRequest : IMethodResponse
- {
- public MethodResponseAddRequest()
- : base()
- { }
- public MethodResponseAddRequest(string name, string message)
- : base(name, message)
- { }
- private string _request_url;
-
- public string request_url { get { return _request_url; } set { _request_url = value; } }
- }
-}
diff --git a/OpenSubtitlesHandler/MethodResponses/MethodResponseAutoUpdate.cs b/OpenSubtitlesHandler/MethodResponses/MethodResponseAutoUpdate.cs
deleted file mode 100644
index 6ee14f1f8..000000000
--- a/OpenSubtitlesHandler/MethodResponses/MethodResponseAutoUpdate.cs
+++ /dev/null
@@ -1,59 +0,0 @@
-/* This file is part of OpenSubtitles Handler
- A library that handle OpenSubtitles.org XML-RPC methods.
-
- Copyright © Ala Ibrahim Hadid 2013
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-
-namespace OpenSubtitlesHandler
-{
- [MethodResponseDescription("AutoUpdate method response",
- "AutoUpdate method response hold all expected values from server.")]
- public class MethodResponseAutoUpdate : IMethodResponse
- {
- public MethodResponseAutoUpdate()
- : base()
- { }
- public MethodResponseAutoUpdate(string name, string message)
- : base(name, message)
- { }
-
- private string _version;
- private string _url_windows;
- private string _comments;
- private string _url_linux;
- /// <summary>
- /// Latest application version
- /// </summary>
- [Description("Latest application version"), Category("AutoUpdate")]
- public string version { get { return _version; } set { _version = value; } }
- /// <summary>
- /// Download URL for Windows version
- /// </summary>
- [Description("Download URL for Windows version"), Category("AutoUpdate")]
- public string url_windows { get { return _url_windows; } set { _url_windows = value; } }
- /// <summary>
- /// Application changelog and other comments
- /// </summary>
- [Description("Application changelog and other comments"), Category("AutoUpdate")]
- public string comments { get { return _comments; } set { _comments = value; } }
- /// <summary>
- /// Download URL for Linux version
- /// </summary>
- [Description("Download URL for Linux version"), Category("AutoUpdate")]
- public string url_linux { get { return _url_linux; } set { _url_linux = value; } }
- }
-}
diff --git a/OpenSubtitlesHandler/MethodResponses/MethodResponseCheckMovieHash.cs b/OpenSubtitlesHandler/MethodResponses/MethodResponseCheckMovieHash.cs
deleted file mode 100644
index 4bb326244..000000000
--- a/OpenSubtitlesHandler/MethodResponses/MethodResponseCheckMovieHash.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-/* This file is part of OpenSubtitles Handler
- A library that handle OpenSubtitles.org XML-RPC methods.
-
- Copyright © Ala Ibrahim Hadid 2013
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-using System.Collections.Generic;
-namespace OpenSubtitlesHandler
-{
- [MethodResponseDescription("CheckMovieHash method response",
- "CheckMovieHash method response hold all expected values from server.")]
- public class MethodResponseCheckMovieHash : IMethodResponse
- {
- public MethodResponseCheckMovieHash()
- : base()
- { }
- public MethodResponseCheckMovieHash(string name, string message)
- : base(name, message)
- { }
- private List<CheckMovieHashResult> results = new List<CheckMovieHashResult>();
- public List<CheckMovieHashResult> Results
- { get { return results; } set { results = value; } }
- }
-}
diff --git a/OpenSubtitlesHandler/MethodResponses/MethodResponseCheckMovieHash2.cs b/OpenSubtitlesHandler/MethodResponses/MethodResponseCheckMovieHash2.cs
deleted file mode 100644
index 72b4c3b15..000000000
--- a/OpenSubtitlesHandler/MethodResponses/MethodResponseCheckMovieHash2.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-/* This file is part of OpenSubtitles Handler
- A library that handle OpenSubtitles.org XML-RPC methods.
-
- Copyright © Ala Ibrahim Hadid 2013
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-using System.Collections.Generic;
-namespace OpenSubtitlesHandler
-{
- [MethodResponseDescription("CheckMovieHash2 method response",
- "CheckMovieHash2 method response hold all expected values from server.")]
- public class MethodResponseCheckMovieHash2 : IMethodResponse
- {
- public MethodResponseCheckMovieHash2()
- : base()
- { }
- public MethodResponseCheckMovieHash2(string name, string message)
- : base(name, message)
- { }
- private List<CheckMovieHash2Result> results = new List<CheckMovieHash2Result>();
- public List<CheckMovieHash2Result> Results
- { get { return results; } set { results = value; } }
- }
-}
diff --git a/OpenSubtitlesHandler/MethodResponses/MethodResponseCheckSubHash.cs b/OpenSubtitlesHandler/MethodResponses/MethodResponseCheckSubHash.cs
deleted file mode 100644
index 04e287ea7..000000000
--- a/OpenSubtitlesHandler/MethodResponses/MethodResponseCheckSubHash.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-/* This file is part of OpenSubtitles Handler
- A library that handle OpenSubtitles.org XML-RPC methods.
-
- Copyright © Ala Ibrahim Hadid 2013
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-using System.Collections.Generic;
-
-namespace OpenSubtitlesHandler
-{
- [MethodResponseDescription("CheckSubHash method response",
- "CheckSubHash method response hold all expected values from server.")]
- public class MethodResponseCheckSubHash : IMethodResponse
- {
- public MethodResponseCheckSubHash()
- : base()
- { }
- public MethodResponseCheckSubHash(string name, string message)
- : base(name, message)
- { }
- private List<CheckSubHashResult> results = new List<CheckSubHashResult>();
-
- public List<CheckSubHashResult> Results { get { return results; } set { results = value; } }
- }
-}
diff --git a/OpenSubtitlesHandler/MethodResponses/MethodResponseDetectLanguage.cs b/OpenSubtitlesHandler/MethodResponses/MethodResponseDetectLanguage.cs
deleted file mode 100644
index 6bf21d50e..000000000
--- a/OpenSubtitlesHandler/MethodResponses/MethodResponseDetectLanguage.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-/* This file is part of OpenSubtitles Handler
- A library that handle OpenSubtitles.org XML-RPC methods.
-
- Copyright © Ala Ibrahim Hadid 2013
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-using System.Collections.Generic;
-namespace OpenSubtitlesHandler
-{
- [MethodResponseDescription("DetectLanguage method response",
- "DetectLanguage method response hold all expected values from server.")]
- public class MethodResponseDetectLanguage : IMethodResponse
- {
- public MethodResponseDetectLanguage()
- : base()
- { }
- public MethodResponseDetectLanguage(string name, string message)
- : base(name, message)
- { }
- private List<DetectLanguageResult> results = new List<DetectLanguageResult>();
-
- public List<DetectLanguageResult> Results
- { get { return results; } set { results = value; } }
- }
-}
diff --git a/OpenSubtitlesHandler/MethodResponses/MethodResponseError.cs b/OpenSubtitlesHandler/MethodResponses/MethodResponseError.cs
deleted file mode 100644
index 7ed807067..000000000
--- a/OpenSubtitlesHandler/MethodResponses/MethodResponseError.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-/* This file is part of OpenSubtitles Handler
- A library that handle OpenSubtitles.org XML-RPC methods.
-
- Copyright © Ala Ibrahim Hadid 2013
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-namespace OpenSubtitlesHandler
-{
- /// <summary>
- /// Response that can be used for general error like internet connection fail.
- /// </summary>
- [MethodResponseDescription("Error method response",
- "Error method response that describes error that occured")]
- public class MethodResponseError : IMethodResponse
- {
- public MethodResponseError()
- : base()
- { }
- public MethodResponseError(string name, string message)
- : base(name, message)
- { }
- }
-}
diff --git a/OpenSubtitlesHandler/MethodResponses/MethodResponseGetAvailableTranslations.cs b/OpenSubtitlesHandler/MethodResponses/MethodResponseGetAvailableTranslations.cs
deleted file mode 100644
index 91803f4b3..000000000
--- a/OpenSubtitlesHandler/MethodResponses/MethodResponseGetAvailableTranslations.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-/* This file is part of OpenSubtitles Handler
- A library that handle OpenSubtitles.org XML-RPC methods.
-
- Copyright © Ala Ibrahim Hadid 2013
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-using System.Collections.Generic;
-
-namespace OpenSubtitlesHandler
-{
- [MethodResponseDescription("GetAvailableTranslations method response",
- "GetAvailableTranslations method response hold all expected values from server.")]
- public class MethodResponseGetAvailableTranslations : IMethodResponse
- {
- public MethodResponseGetAvailableTranslations()
- : base()
- { }
- public MethodResponseGetAvailableTranslations(string name, string message)
- : base(name, message)
- { }
- private List<GetAvailableTranslationsResult> results = new List<GetAvailableTranslationsResult>();
- public List<GetAvailableTranslationsResult> Results { get { return results; } set { results = value; } }
- }
-}
diff --git a/OpenSubtitlesHandler/MethodResponses/MethodResponseGetComments.cs b/OpenSubtitlesHandler/MethodResponses/MethodResponseGetComments.cs
deleted file mode 100644
index 421e1783b..000000000
--- a/OpenSubtitlesHandler/MethodResponses/MethodResponseGetComments.cs
+++ /dev/null
@@ -1,39 +0,0 @@
-/* This file is part of OpenSubtitles Handler
- A library that handle OpenSubtitles.org XML-RPC methods.
-
- Copyright © Ala Ibrahim Hadid 2013
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-using System.Collections.Generic;
-
-namespace OpenSubtitlesHandler
-{
- [MethodResponseDescription("GetComments method response",
- "GetComments method response hold all expected values from server.")]
- public class MethodResponseGetComments : IMethodResponse
- {
- public MethodResponseGetComments()
- : base()
- { }
- public MethodResponseGetComments(string name, string message)
- : base(name, message)
- { }
- private List<GetCommentsResult> results = new List<GetCommentsResult>();
-
- public List<GetCommentsResult> Results
- { get { return results; } set { results = value; } }
- }
-}
diff --git a/OpenSubtitlesHandler/MethodResponses/MethodResponseGetSubLanguages.cs b/OpenSubtitlesHandler/MethodResponses/MethodResponseGetSubLanguages.cs
deleted file mode 100644
index 905b87c91..000000000
--- a/OpenSubtitlesHandler/MethodResponses/MethodResponseGetSubLanguages.cs
+++ /dev/null
@@ -1,39 +0,0 @@
-/* This file is part of OpenSubtitles Handler
- A library that handle OpenSubtitles.org XML-RPC methods.
-
- Copyright © Ala Ibrahim Hadid 2013
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-using System.Collections.Generic;
-
-namespace OpenSubtitlesHandler
-{
- [MethodResponseDescription("GetSubLanguages method response",
- "GetSubLanguages method response hold all expected values from server.")]
- public class MethodResponseGetSubLanguages : IMethodResponse
- {
- public MethodResponseGetSubLanguages()
- : base()
- { }
- public MethodResponseGetSubLanguages(string name, string message)
- : base(name, message)
- { }
- private List<SubtitleLanguage> languages = new List<SubtitleLanguage>();
-
- public List<SubtitleLanguage> Languages
- { get { return languages; } set { languages = value; } }
- }
-}
diff --git a/OpenSubtitlesHandler/MethodResponses/MethodResponseGetTranslation.cs b/OpenSubtitlesHandler/MethodResponses/MethodResponseGetTranslation.cs
deleted file mode 100644
index f008f7711..000000000
--- a/OpenSubtitlesHandler/MethodResponses/MethodResponseGetTranslation.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-/* This file is part of OpenSubtitles Handler
- A library that handle OpenSubtitles.org XML-RPC methods.
-
- Copyright © Ala Ibrahim Hadid 2013
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-namespace OpenSubtitlesHandler
-{
- [MethodResponseDescription("GetTranslation method response",
- "GetTranslation method response hold all expected values from server.")]
- public class MethodResponseGetTranslation : IMethodResponse
- {
- public MethodResponseGetTranslation()
- : base()
- { }
- public MethodResponseGetTranslation(string name, string message)
- : base(name, message)
- { }
- private string data;
-
- public string ContentData { get { return data; } set { data = value; } }
- }
-}
diff --git a/OpenSubtitlesHandler/MethodResponses/MethodResponseInsertMovie.cs b/OpenSubtitlesHandler/MethodResponses/MethodResponseInsertMovie.cs
deleted file mode 100644
index 1148b5f47..000000000
--- a/OpenSubtitlesHandler/MethodResponses/MethodResponseInsertMovie.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-/* This file is part of OpenSubtitles Handler
- A library that handle OpenSubtitles.org XML-RPC methods.
-
- Copyright © Ala Ibrahim Hadid 2013
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-namespace OpenSubtitlesHandler
-{
- [MethodResponseDescription("InsertMovie method response",
- "InsertMovie method response hold all expected values from server.")]
- public class MethodResponseInsertMovie : IMethodResponse
- {
- public MethodResponseInsertMovie()
- : base()
- { }
- public MethodResponseInsertMovie(string name, string message)
- : base(name, message)
- { }
- private string _ID;
- public string ID
- { get { return _ID; } set { _ID = value; } }
- }
-}
diff --git a/OpenSubtitlesHandler/MethodResponses/MethodResponseInsertMovieHash.cs b/OpenSubtitlesHandler/MethodResponses/MethodResponseInsertMovieHash.cs
deleted file mode 100644
index 74f52837c..000000000
--- a/OpenSubtitlesHandler/MethodResponses/MethodResponseInsertMovieHash.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-/* This file is part of OpenSubtitles Handler
- A library that handle OpenSubtitles.org XML-RPC methods.
-
- Copyright © Ala Ibrahim Hadid 2013
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-using System.Collections.Generic;
-namespace OpenSubtitlesHandler
-{
- [MethodResponseDescription("InsertMovieHash method response",
- "InsertMovieHash method response hold all expected values from server.")]
- public class MethodResponseInsertMovieHash : IMethodResponse
- {
- public MethodResponseInsertMovieHash()
- : base()
- { }
- public MethodResponseInsertMovieHash(string name, string message)
- : base(name, message)
- { }
- private List<string> _accepted_moviehashes = new List<string>();
- private List<string> _new_imdbs = new List<string>();
-
- public List<string> accepted_moviehashes { get { return _accepted_moviehashes; } set { _accepted_moviehashes = value; } }
- public List<string> new_imdbs { get { return _new_imdbs; } set { _new_imdbs = value; } }
- }
-}
diff --git a/OpenSubtitlesHandler/MethodResponses/MethodResponseLogIn.cs b/OpenSubtitlesHandler/MethodResponses/MethodResponseLogIn.cs
deleted file mode 100644
index 44d294382..000000000
--- a/OpenSubtitlesHandler/MethodResponses/MethodResponseLogIn.cs
+++ /dev/null
@@ -1,39 +0,0 @@
-/* This file is part of OpenSubtitles Handler
- A library that handle OpenSubtitles.org XML-RPC methods.
-
- Copyright © Ala Ibrahim Hadid 2013
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-namespace OpenSubtitlesHandler
-{
- /// <summary>
- /// Response can be used for log in/out operation.
- /// </summary>
- [MethodResponseDescription("LogIn method response",
- "LogIn method response hold all expected values from server.")]
- public class MethodResponseLogIn : IMethodResponse
- {
- public MethodResponseLogIn()
- : base()
- { }
- public MethodResponseLogIn(string name, string message)
- : base(name, message)
- { }
- private string token;
-
- public string Token { get { return token; } set { token = value; } }
- }
-}
diff --git a/OpenSubtitlesHandler/MethodResponses/MethodResponseMovieDetails.cs b/OpenSubtitlesHandler/MethodResponses/MethodResponseMovieDetails.cs
deleted file mode 100644
index 6126c0053..000000000
--- a/OpenSubtitlesHandler/MethodResponses/MethodResponseMovieDetails.cs
+++ /dev/null
@@ -1,73 +0,0 @@
-/* This file is part of OpenSubtitles Handler
- A library that handle OpenSubtitles.org XML-RPC methods.
-
- Copyright © Ala Ibrahim Hadid 2013
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-using System.Collections.Generic;
-
-namespace OpenSubtitlesHandler
-{
- [MethodResponseDescription("MovieDetails method response",
- "MovieDetails method response hold all expected values from server.")]
- public class MethodResponseMovieDetails : IMethodResponse
- {
- public MethodResponseMovieDetails()
- : base()
- { }
- public MethodResponseMovieDetails(string name, string message)
- : base(name, message)
- { }
- // Details
- private string id;
- private string title;
- private string year;
- private string coverLink;
-
- private string duration;
- private string tagline;
- private string plot;
- private string goofs;
- private string trivia;
- private List<string> cast = new List<string>();
- private List<string> directors = new List<string>();
- private List<string> writers = new List<string>();
- private List<string> awards = new List<string>();
- private List<string> genres = new List<string>();
- private List<string> country = new List<string>();
- private List<string> language = new List<string>();
- private List<string> certification = new List<string>();
-
- // Details
- public string ID { get { return id; } set { id = value; } }
- public string Title { get { return title; } set { title = value; } }
- public string Year { get { return year; } set { year = value; } }
- public string CoverLink { get { return coverLink; } set { coverLink = value; } }
- public string Duration { get { return duration; } set { duration = value; } }
- public string Tagline { get { return tagline; } set { tagline = value; } }
- public string Plot { get { return plot; } set { plot = value; } }
- public string Goofs { get { return goofs; } set { goofs = value; } }
- public string Trivia { get { return trivia; } set { trivia = value; } }
- public List<string> Cast { get { return cast; } set { cast = value; } }
- public List<string> Directors { get { return directors; } set { directors = value; } }
- public List<string> Writers { get { return writers; } set { writers = value; } }
- public List<string> Genres { get { return genres; } set { genres = value; } }
- public List<string> Awards { get { return awards; } set { awards = value; } }
- public List<string> Country { get { return country; } set { country = value; } }
- public List<string> Language { get { return language; } set { language = value; } }
- public List<string> Certification { get { return certification; } set { certification = value; } }
- }
-}
diff --git a/OpenSubtitlesHandler/MethodResponses/MethodResponseMovieSearch.cs b/OpenSubtitlesHandler/MethodResponses/MethodResponseMovieSearch.cs
deleted file mode 100644
index 93cd70346..000000000
--- a/OpenSubtitlesHandler/MethodResponses/MethodResponseMovieSearch.cs
+++ /dev/null
@@ -1,43 +0,0 @@
-/* This file is part of OpenSubtitles Handler
- A library that handle OpenSubtitles.org XML-RPC methods.
-
- Copyright © Ala Ibrahim Hadid 2013
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-using System.Collections.Generic;
-
-namespace OpenSubtitlesHandler
-{
- [MethodResponseDescription("MovieSearch method response",
- "MovieSearch method response hold all expected values from server.")]
- public class MethodResponseMovieSearch : IMethodResponse
- {
- public MethodResponseMovieSearch()
- : base()
- {
- results = new List<MovieSearchResult>();
- }
- public MethodResponseMovieSearch(string name, string message)
- : base(name, message)
- {
- results = new List<MovieSearchResult>();
- }
- private List<MovieSearchResult> results;
-
- public List<MovieSearchResult> Results
- { get { return results; } set { results = value; } }
- }
-}
diff --git a/OpenSubtitlesHandler/MethodResponses/MethodResponseNoOperation.cs b/OpenSubtitlesHandler/MethodResponses/MethodResponseNoOperation.cs
deleted file mode 100644
index 02a9993cb..000000000
--- a/OpenSubtitlesHandler/MethodResponses/MethodResponseNoOperation.cs
+++ /dev/null
@@ -1,52 +0,0 @@
-/* This file is part of OpenSubtitles Handler
- A library that handle OpenSubtitles.org XML-RPC methods.
-
- Copyright © Ala Ibrahim Hadid 2013
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-namespace OpenSubtitlesHandler
-{
- [MethodResponseDescription("NoOperation method response",
- "NoOperation method response hold all expected values from server.")]
- public class MethodResponseNoOperation : IMethodResponse
- {
- public MethodResponseNoOperation()
- : base() { }
- public MethodResponseNoOperation(string name, string message)
- : base(name, message)
- { }
-
- private string _global_wrh_download_limit;
- private string _client_ip;
- private string _limit_check_by;
- private string _client_24h_download_count;
- private string _client_downlaod_quota;
- private string _client_24h_download_limit;
-
- public string global_wrh_download_limit
- { get { return _global_wrh_download_limit; } set { _global_wrh_download_limit = value; } }
- public string client_ip
- { get { return _client_ip; } set { _client_ip = value; } }
- public string limit_check_by
- { get { return _limit_check_by; } set { _limit_check_by = value; } }
- public string client_24h_download_count
- { get { return _client_24h_download_count; } set { _client_24h_download_count = value; } }
- public string client_downlaod_quota
- { get { return _client_downlaod_quota; } set { _client_downlaod_quota = value; } }
- public string client_24h_download_limit
- { get { return _client_24h_download_limit; } set { _client_24h_download_limit = value; } }
- }
-}
diff --git a/OpenSubtitlesHandler/MethodResponses/MethodResponseReportWrongImdbMovie.cs b/OpenSubtitlesHandler/MethodResponses/MethodResponseReportWrongImdbMovie.cs
deleted file mode 100644
index 391fec58a..000000000
--- a/OpenSubtitlesHandler/MethodResponses/MethodResponseReportWrongImdbMovie.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-/* This file is part of OpenSubtitles Handler
- A library that handle OpenSubtitles.org XML-RPC methods.
-
- Copyright © Ala Ibrahim Hadid 2013
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-namespace OpenSubtitlesHandler
-{
- [MethodResponseDescription("ReportWrongImdbMovie method response",
- "ReportWrongImdbMovie method response hold all expected values from server.")]
- public class MethodResponseReportWrongImdbMovie : IMethodResponse
- {
- public MethodResponseReportWrongImdbMovie()
- : base()
- { }
- public MethodResponseReportWrongImdbMovie(string name, string message)
- : base(name, message)
- { }
- }
-}
diff --git a/OpenSubtitlesHandler/MethodResponses/MethodResponseReportWrongMovieHash.cs b/OpenSubtitlesHandler/MethodResponses/MethodResponseReportWrongMovieHash.cs
deleted file mode 100644
index 5696e7084..000000000
--- a/OpenSubtitlesHandler/MethodResponses/MethodResponseReportWrongMovieHash.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-/* This file is part of OpenSubtitles Handler
- A library that handle OpenSubtitles.org XML-RPC methods.
-
- Copyright © Ala Ibrahim Hadid 2013
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-namespace OpenSubtitlesHandler
-{
- [MethodResponseDescription("ReportWrongMovieHash method response",
- "ReportWrongMovieHash method response hold all expected values from server.")]
- public class MethodResponseReportWrongMovieHash : IMethodResponse
- {
- public MethodResponseReportWrongMovieHash()
- : base()
- { }
- public MethodResponseReportWrongMovieHash(string name, string message)
- : base(name, message)
- { }
- }
-}
diff --git a/OpenSubtitlesHandler/MethodResponses/MethodResponseSearchToMail.cs b/OpenSubtitlesHandler/MethodResponses/MethodResponseSearchToMail.cs
deleted file mode 100644
index ea248bc22..000000000
--- a/OpenSubtitlesHandler/MethodResponses/MethodResponseSearchToMail.cs
+++ /dev/null
@@ -1,32 +0,0 @@
-/* This file is part of OpenSubtitles Handler
- A library that handle OpenSubtitles.org XML-RPC methods.
-
- Copyright © Ala Ibrahim Hadid 2013
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-namespace OpenSubtitlesHandler
-{
- [MethodResponseDescription("SearchToMail method response",
- "SearchToMail method response hold all expected values from server.")]
- public class MethodResponseSearchToMail : IMethodResponse
- {
- public MethodResponseSearchToMail()
- : base()
- { }
- public MethodResponseSearchToMail(string name, string message)
- : base(name, message)
- { }
- }
-}
diff --git a/OpenSubtitlesHandler/MethodResponses/MethodResponseServerInfo.cs b/OpenSubtitlesHandler/MethodResponses/MethodResponseServerInfo.cs
deleted file mode 100644
index 973550e9f..000000000
--- a/OpenSubtitlesHandler/MethodResponses/MethodResponseServerInfo.cs
+++ /dev/null
@@ -1,131 +0,0 @@
-/* This file is part of OpenSubtitles Handler
- A library that handle OpenSubtitles.org XML-RPC methods.
-
- Copyright © Ala Ibrahim Hadid 2013
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-using System.Collections.Generic;
-namespace OpenSubtitlesHandler
-{
- [MethodResponseDescription("ServerInfo method response",
- "ServerInfo method response hold all expected values from server.")]
- public class MethodResponseServerInfo : IMethodResponse
- {
- public MethodResponseServerInfo()
- : base()
- { }
- public MethodResponseServerInfo(string name, string message)
- : base(name, message)
- { }
- private string _xmlrpc_version;
- private string _xmlrpc_url;
- private string _application;
- private string _contact;
- private string _website_url;
- private int _users_online_total;
- private int _users_online_program;
- private int _users_loggedin;
- private string _users_max_alltime;
- private string _users_registered;
- private string _subs_downloads;
- private string _subs_subtitle_files;
- private string _movies_total;
- private string _movies_aka;
- private string _total_subtitles_languages;
- private List<string> _last_update_strings = new List<string>();
-
- /// <summary>
- /// Version of server's XML-RPC API implementation
- /// </summary>
- [Description("Version of server's XML-RPC API implementation"), Category("OS")]
- public string xmlrpc_version { get { return _xmlrpc_version; } set { _xmlrpc_version = value; } }
- /// <summary>
- /// XML-RPC interface URL
- /// </summary>
- [Description("XML-RPC interface URL"), Category("OS")]
- public string xmlrpc_url { get { return _xmlrpc_url; } set { _xmlrpc_url = value; } }
- /// <summary>
- /// Server's application name and version
- /// </summary>
- [Description("Server's application name and version"), Category("OS")]
- public string application { get { return _application; } set { _application = value; } }
- /// <summary>
- /// Contact e-mail address for server related quuestions and problems
- /// </summary>
- [Description("Contact e-mail address for server related quuestions and problems"), Category("OS")]
- public string contact { get { return _contact; } set { _contact = value; } }
- /// <summary>
- /// Main server URL
- /// </summary>
- [Description("Main server URL"), Category("OS")]
- public string website_url { get { return _website_url; } set { _website_url = value; } }
- /// <summary>
- /// Number of users currently online
- /// </summary>
- [Description("Number of users currently online"), Category("OS")]
- public int users_online_total { get { return _users_online_total; } set { _users_online_total = value; } }
- /// <summary>
- /// Number of users currently online using a client application (XML-RPC API)
- /// </summary>
- [Description("Number of users currently online using a client application (XML-RPC API)"), Category("OS")]
- public int users_online_program { get { return _users_online_program; } set { _users_online_program = value; } }
- /// <summary>
- /// Number of currently logged-in users
- /// </summary>
- [Description("Number of currently logged-in users"), Category("OS")]
- public int users_loggedin { get { return _users_loggedin; } set { _users_loggedin = value; } }
- /// <summary>
- /// Maximum number of users throughout the history
- /// </summary>
- [Description("Maximum number of users throughout the history"), Category("OS")]
- public string users_max_alltime { get { return _users_max_alltime; } set { _users_max_alltime = value; } }
- /// <summary>
- /// Number of registered users
- /// </summary>
- [Description("Number of registered users"), Category("OS")]
- public string users_registered { get { return _users_registered; } set { _users_registered = value; } }
- /// <summary>
- /// Total number of subtitle downloads
- /// </summary>
- [Description("Total number of subtitle downloads"), Category("OS")]
- public string subs_downloads { get { return _subs_downloads; } set { _subs_downloads = value; } }
- /// <summary>
- /// Total number of subtitle files stored on the server
- /// </summary>
- [Description("Total number of subtitle files stored on the server"), Category("OS")]
- public string subs_subtitle_files { get { return _subs_subtitle_files; } set { _subs_subtitle_files = value; } }
- /// <summary>
- /// Total number of movies in the database
- /// </summary>
- [Description("Total number of movies in the database"), Category("OS")]
- public string movies_total { get { return _movies_total; } set { _movies_total = value; } }
- /// <summary>
- /// Total number of movie A.K.A. titles in the database
- /// </summary>
- [Description("Total number of movie A.K.A. titles in the database"), Category("OS")]
- public string movies_aka { get { return _movies_aka; } set { _movies_aka = value; } }
- /// <summary>
- /// Total number of subtitle languages supported
- /// </summary>
- [Description("Total number of subtitle languages supported"), Category("OS")]
- public string total_subtitles_languages { get { return _total_subtitles_languages; } set { _total_subtitles_languages = value; } }
- /// <summary>
- /// Structure containing information about last updates of translations.
- /// </summary>
- [Description("Structure containing information about last updates of translations"), Category("OS")]
- public List<string> last_update_strings { get { return _last_update_strings; } set { _last_update_strings = value; } }
- }
-}
diff --git a/OpenSubtitlesHandler/MethodResponses/MethodResponseSubtitleDownload.cs b/OpenSubtitlesHandler/MethodResponses/MethodResponseSubtitleDownload.cs
deleted file mode 100644
index 6a5d57d19..000000000
--- a/OpenSubtitlesHandler/MethodResponses/MethodResponseSubtitleDownload.cs
+++ /dev/null
@@ -1,44 +0,0 @@
-/* This file is part of OpenSubtitles Handler
- A library that handle OpenSubtitles.org XML-RPC methods.
-
- Copyright © Ala Ibrahim Hadid 2013
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-using System.Collections.Generic;
-namespace OpenSubtitlesHandler
-{
- /// <summary>
- /// The response that should be used by subtitle download methods.
- /// </summary>
- [MethodResponseDescription("SubtitleDownload method response",
- "SubtitleDownload method response hold all expected values from server.")]
- public class MethodResponseSubtitleDownload : IMethodResponse
- {
- public MethodResponseSubtitleDownload()
- : base()
- {
- results = new List<SubtitleDownloadResult>();
- }
- public MethodResponseSubtitleDownload(string name, string message)
- : base(name, message)
- {
- results = new List<SubtitleDownloadResult>();
- }
- private List<SubtitleDownloadResult> results;
- public List<SubtitleDownloadResult> Results
- { get { return results; } set { results = value; } }
- }
-}
diff --git a/OpenSubtitlesHandler/MethodResponses/MethodResponseSubtitleSearch.cs b/OpenSubtitlesHandler/MethodResponses/MethodResponseSubtitleSearch.cs
deleted file mode 100644
index 0dce20349..000000000
--- a/OpenSubtitlesHandler/MethodResponses/MethodResponseSubtitleSearch.cs
+++ /dev/null
@@ -1,46 +0,0 @@
-/* This file is part of OpenSubtitles Handler
- A library that handle OpenSubtitles.org XML-RPC methods.
-
- Copyright © Ala Ibrahim Hadid 2013
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-using System.Collections.Generic;
-
-namespace OpenSubtitlesHandler
-{
- /// <summary>
- /// Response to SearchSubtitle successed call.
- /// </summary>
- [MethodResponseDescription("SubtitleSearch method response",
- "SubtitleSearch method response hold all expected values from server.")]
- public class MethodResponseSubtitleSearch : IMethodResponse
- {
- public MethodResponseSubtitleSearch()
- : base()
- {
- results = new List<SubtitleSearchResult>();
- }
- public MethodResponseSubtitleSearch(string name, string message)
- : base(name, message)
- {
- results = new List<SubtitleSearchResult>();
- }
-
- private List<SubtitleSearchResult> results;
- public List<SubtitleSearchResult> Results
- { get { return results; } set { results = value; } }
- }
-}
diff --git a/OpenSubtitlesHandler/MethodResponses/MethodResponseSubtitlesVote.cs b/OpenSubtitlesHandler/MethodResponses/MethodResponseSubtitlesVote.cs
deleted file mode 100644
index f02f822f0..000000000
--- a/OpenSubtitlesHandler/MethodResponses/MethodResponseSubtitlesVote.cs
+++ /dev/null
@@ -1,43 +0,0 @@
-/* This file is part of OpenSubtitles Handler
- A library that handle OpenSubtitles.org XML-RPC methods.
-
- Copyright © Ala Ibrahim Hadid 2013
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-namespace OpenSubtitlesHandler
-{
- [MethodResponseDescription("SubtitlesVote method response",
- "SubtitlesVote method response hold all expected values from server.")]
- public class MethodResponseSubtitlesVote : IMethodResponse
- {
- public MethodResponseSubtitlesVote()
- : base()
- { }
- public MethodResponseSubtitlesVote(string name, string message)
- : base(name, message)
- { }
- private string _SubRating;
- private string _SubSumVotes;
- private string _IDSubtitle;
-
- public string SubRating
- { get { return _SubRating; } set { _SubRating = value; } }
- public string SubSumVotes
- { get { return _SubSumVotes; } set { _SubSumVotes = value; } }
- public string IDSubtitle
- { get { return _IDSubtitle; } set { _IDSubtitle = value; } }
- }
-}
diff --git a/OpenSubtitlesHandler/MethodResponses/MethodResponseTryUploadSubtitles.cs b/OpenSubtitlesHandler/MethodResponses/MethodResponseTryUploadSubtitles.cs
deleted file mode 100644
index cb3866a62..000000000
--- a/OpenSubtitlesHandler/MethodResponses/MethodResponseTryUploadSubtitles.cs
+++ /dev/null
@@ -1,40 +0,0 @@
-/* This file is part of OpenSubtitles Handler
- A library that handle OpenSubtitles.org XML-RPC methods.
-
- Copyright © Ala Ibrahim Hadid 2013
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-using System.Collections.Generic;
-
-namespace OpenSubtitlesHandler
-{
- [MethodResponseDescription("TryUploadSubtitles method response",
- "TryUploadSubtitles method response hold all expected values from server.")]
- public class MethodResponseTryUploadSubtitles : IMethodResponse
- {
- public MethodResponseTryUploadSubtitles()
- : base()
- { }
- public MethodResponseTryUploadSubtitles(string name, string message)
- : base(name, message)
- { }
- private int alreadyindb;
- private List<SubtitleSearchResult> results = new List<SubtitleSearchResult>();
-
- public int AlreadyInDB { get { return alreadyindb; } set { alreadyindb = value; } }
- public List<SubtitleSearchResult> Results { get { return results; } set { results = value; } }
- }
-}
diff --git a/OpenSubtitlesHandler/MethodResponses/MethodResponseUploadSubtitles.cs b/OpenSubtitlesHandler/MethodResponses/MethodResponseUploadSubtitles.cs
deleted file mode 100644
index bda950bef..000000000
--- a/OpenSubtitlesHandler/MethodResponses/MethodResponseUploadSubtitles.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-/* This file is part of OpenSubtitles Handler
- A library that handle OpenSubtitles.org XML-RPC methods.
-
- Copyright © Ala Ibrahim Hadid 2013
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-namespace OpenSubtitlesHandler
-{
- [MethodResponseDescription("UploadSubtitles method response",
- "UploadSubtitles method response hold all expected values from server.")]
- public class MethodResponseUploadSubtitles : IMethodResponse
- {
- public MethodResponseUploadSubtitles()
- : base()
- { }
- public MethodResponseUploadSubtitles(string name, string message)
- : base(name, message)
- { }
- private string _data;
- private bool _subtitles;
-
- public string Data { get { return _data; } set { _data = value; } }
- public bool SubTitles { get { return _subtitles; } set { _subtitles = value; } }
- }
-}
diff --git a/OpenSubtitlesHandler/Methods Implemeted.txt b/OpenSubtitlesHandler/Methods Implemeted.txt
deleted file mode 100644
index e3493d9a2..000000000
--- a/OpenSubtitlesHandler/Methods Implemeted.txt
+++ /dev/null
@@ -1,39 +0,0 @@
-List of available OpenSubtitles.org server XML-RPC methods.
-==========================================================
-Legends:
-* OK: this method is fully implemented, tested and works fine.
-* TODO: this method is in the plan to be added.
-* NOT TESTED: this method added and expected to work fine but never tested.
-* NOT WORK (x): this method added but not work. x= Description of the error.
-
---------------------------------------------
-Method name | Status
--------------------------|------------------
-LogIn | OK
-LogOut | OK
-NoOperation | OK
-SearchSubtitles | OK
-DownloadSubtitles | OK
-SearchToMail | OK
-TryUploadSubtitles | OK
-UploadSubtitles | OK
-SearchMoviesOnIMDB | OK
-GetIMDBMovieDetails | OK
-InsertMovie | OK
-InsertMovieHash | OK
-ServerInfo | OK
-ReportWrongMovieHash | OK
-ReportWrongImdbMovie | OK
-SubtitlesVote | OK
-AddComment | OK
-AddRequest | OK
-GetComments | OK
-GetSubLanguages | OK
-DetectLanguage | OK
-GetAvailableTranslations | OK
-GetTranslation | NOT WORK (Returns status of error 410 'Other or unknown error')
-AutoUpdate | NOT WORK (Returns status: 'parse error. not well formed')
-CheckMovieHash | OK
-CheckMovieHash2 | OK
-CheckSubHash | OK
---------------------------------------------
diff --git a/OpenSubtitlesHandler/MovieHasher.cs b/OpenSubtitlesHandler/MovieHasher.cs
deleted file mode 100644
index 25d91c1ac..000000000
--- a/OpenSubtitlesHandler/MovieHasher.cs
+++ /dev/null
@@ -1,48 +0,0 @@
-using System;
-using System.IO;
-using System.Text;
-
-namespace OpenSubtitlesHandler
-{
- public class MovieHasher
- {
- public static byte[] ComputeMovieHash(Stream input)
- {
- using (input)
- {
- long lhash, streamsize;
- streamsize = input.Length;
- lhash = streamsize;
-
- long i = 0;
- byte[] buffer = new byte[sizeof(long)];
- while (i < 65536 / sizeof(long) && (input.Read(buffer, 0, sizeof(long)) > 0))
- {
- i++;
- lhash += BitConverter.ToInt64(buffer, 0);
- }
-
- input.Position = Math.Max(0, streamsize - 65536);
- i = 0;
- while (i < 65536 / sizeof(long) && (input.Read(buffer, 0, sizeof(long)) > 0))
- {
- i++;
- lhash += BitConverter.ToInt64(buffer, 0);
- }
- byte[] result = BitConverter.GetBytes(lhash);
- Array.Reverse(result);
- return result;
- }
- }
-
- public static string ToHexadecimal(byte[] bytes)
- {
- var hexBuilder = new StringBuilder();
- for (int i = 0; i < bytes.Length; i++)
- {
- hexBuilder.Append(bytes[i].ToString("x2"));
- }
- return hexBuilder.ToString();
- }
- }
-}
diff --git a/OpenSubtitlesHandler/Movies/CheckMovieHash2Data.cs b/OpenSubtitlesHandler/Movies/CheckMovieHash2Data.cs
deleted file mode 100644
index 953590137..000000000
--- a/OpenSubtitlesHandler/Movies/CheckMovieHash2Data.cs
+++ /dev/null
@@ -1,42 +0,0 @@
-/* This file is part of OpenSubtitles Handler
- A library that handle OpenSubtitles.org XML-RPC methods.
-
- Copyright © Ala Ibrahim Hadid 2013
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-namespace OpenSubtitlesHandler
-{
- public struct CheckMovieHash2Data
- {
- private string _MovieHash;
- private string _MovieImdbID;
- private string _MovieName;
- private string _MovieYear;
- private string _MovieKind;
- private string _SeriesSeason;
- private string _SeriesEpisode;
- private string _SeenCount;
-
- public string MovieHash { get { return _MovieHash; } set { _MovieHash = value; } }
- public string MovieImdbID { get { return _MovieImdbID; } set { _MovieImdbID = value; } }
- public string MovieName { get { return _MovieName; } set { _MovieName = value; } }
- public string MovieYear { get { return _MovieYear; } set { _MovieYear = value; } }
- public string MovieKind { get { return _MovieKind; } set { _MovieKind = value; } }
- public string SeriesSeason { get { return _SeriesSeason; } set { _SeriesSeason = value; } }
- public string SeriesEpisode { get { return _SeriesEpisode; } set { _SeriesEpisode = value; } }
- public string SeenCount { get { return _SeenCount; } set { _SeenCount = value; } }
- }
-}
diff --git a/OpenSubtitlesHandler/Movies/CheckMovieHash2Result.cs b/OpenSubtitlesHandler/Movies/CheckMovieHash2Result.cs
deleted file mode 100644
index 96652fae7..000000000
--- a/OpenSubtitlesHandler/Movies/CheckMovieHash2Result.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-/* This file is part of OpenSubtitles Handler
- A library that handle OpenSubtitles.org XML-RPC methods.
-
- Copyright © Ala Ibrahim Hadid 2013
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-using System.Collections.Generic;
-
-namespace OpenSubtitlesHandler
-{
- public class CheckMovieHash2Result
- {
- private string name;
- private List<CheckMovieHash2Data> data = new List<CheckMovieHash2Data>();
-
- public string Name { get { return name; } set { name = value; } }
- public List<CheckMovieHash2Data> Items { get { return data; } set { data = value; } }
-
- public override string ToString()
- {
- return name;
- }
- }
-}
diff --git a/OpenSubtitlesHandler/Movies/CheckMovieHashResult.cs b/OpenSubtitlesHandler/Movies/CheckMovieHashResult.cs
deleted file mode 100644
index 0d6c79f80..000000000
--- a/OpenSubtitlesHandler/Movies/CheckMovieHashResult.cs
+++ /dev/null
@@ -1,41 +0,0 @@
-/* This file is part of OpenSubtitles Handler
- A library that handle OpenSubtitles.org XML-RPC methods.
-
- Copyright © Ala Ibrahim Hadid 2013
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-namespace OpenSubtitlesHandler
-{
- public struct CheckMovieHashResult
- {
- private string name;
- private string _MovieHash;
- private string _MovieImdbID;
- private string _MovieName;
- private string _MovieYear;
-
- public string MovieHash { get { return _MovieHash; } set { _MovieHash = value; } }
- public string MovieImdbID { get { return _MovieImdbID; } set { _MovieImdbID = value; } }
- public string MovieName { get { return _MovieName; } set { _MovieName = value; } }
- public string MovieYear { get { return _MovieYear; } set { _MovieYear = value; } }
- public string Name { get { return name; } set { name = value; } }
-
- public override string ToString()
- {
- return name;
- }
- }
-}
diff --git a/OpenSubtitlesHandler/Movies/InsertMovieHashParameters.cs b/OpenSubtitlesHandler/Movies/InsertMovieHashParameters.cs
deleted file mode 100644
index d0de7f8c6..000000000
--- a/OpenSubtitlesHandler/Movies/InsertMovieHashParameters.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-/* This file is part of OpenSubtitles Handler
- A library that handle OpenSubtitles.org XML-RPC methods.
-
- Copyright © Ala Ibrahim Hadid 2013
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-namespace OpenSubtitlesHandler
-{
- public class InsertMovieHashParameters
- {
- private string _moviehash = "";
- private string _moviebytesize = "";
- private string _imdbid = "";
- private string _movietimems = "";
- private string _moviefps = "";
- private string _moviefilename = "";
-
- public string moviehash { get { return _moviehash; } set { _moviehash = value; } }
- public string moviebytesize { get { return _moviebytesize; } set { _moviebytesize = value; } }
- public string imdbid { get { return _imdbid; } set { _imdbid = value; } }
- public string movietimems { get { return _movietimems; } set { _movietimems = value; } }
- public string moviefps { get { return _moviefps; } set { _moviefps = value; } }
- public string moviefilename { get { return _moviefilename; } set { _moviefilename = value; } }
- }
-}
diff --git a/OpenSubtitlesHandler/Movies/MovieSearchResult.cs b/OpenSubtitlesHandler/Movies/MovieSearchResult.cs
deleted file mode 100644
index d77116583..000000000
--- a/OpenSubtitlesHandler/Movies/MovieSearchResult.cs
+++ /dev/null
@@ -1,40 +0,0 @@
-/* This file is part of OpenSubtitles Handler
- A library that handle OpenSubtitles.org XML-RPC methods.
-
- Copyright © Ala Ibrahim Hadid 2013
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-namespace OpenSubtitlesHandler
-{
- public struct MovieSearchResult
- {
- private string id;
- private string title;
-
- public string ID
- { get { return id; } set { id = value; } }
- public string Title
- { get { return title; } set { title = value; } }
- /// <summary>
- /// Title
- /// </summary>
- /// <returns></returns>
- public override string ToString()
- {
- return title;
- }
- }
-}
diff --git a/OpenSubtitlesHandler/Movies/SearchToMailMovieParameter.cs b/OpenSubtitlesHandler/Movies/SearchToMailMovieParameter.cs
deleted file mode 100644
index a0ecc87f8..000000000
--- a/OpenSubtitlesHandler/Movies/SearchToMailMovieParameter.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-/* This file is part of OpenSubtitles Handler
- A library that handle OpenSubtitles.org XML-RPC methods.
-
- Copyright © Ala Ibrahim Hadid 2013
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-namespace OpenSubtitlesHandler
-{
- public struct SearchToMailMovieParameter
- {
- private string _moviehash;
- private double _moviesize;
-
- public string moviehash { get { return _moviehash; } set { _moviehash = value; } }
- public double moviesize { get { return _moviesize; } set { _moviesize = value; } }
- }
-}
diff --git a/OpenSubtitlesHandler/OpenSubtitles.cs b/OpenSubtitlesHandler/OpenSubtitles.cs
deleted file mode 100644
index 76f70dc07..000000000
--- a/OpenSubtitlesHandler/OpenSubtitles.cs
+++ /dev/null
@@ -1,2744 +0,0 @@
-/* This file is part of OpenSubtitles Handler
- A library that handle OpenSubtitles.org XML-RPC methods.
-
- Copyright © Ala Ibrahim Hadid 2013
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-using System;
-using System.Collections.Generic;
-using System.Globalization;
-using System.IO;
-using System.Text;
-using System.Threading;
-using System.Threading.Tasks;
-using OpenSubtitlesHandler.Console;
-using XmlRpcHandler;
-
-namespace OpenSubtitlesHandler
-{
- /// <summary>
- /// The core of the OpenSubtitles Handler library. All members are static.
- /// </summary>
- public sealed class OpenSubtitles
- {
- private static string XML_PRC_USERAGENT = "";
- // This is session id after log in, important value and MUST be set by LogIn before any other call.
- private static string TOKEN = "";
-
- /// <summary>
- /// Set the useragent value. This must be called before doing anything else.
- /// </summary>
- /// <param name="agent">The useragent value</param>
- public static void SetUserAgent(string agent)
- {
- XML_PRC_USERAGENT = agent;
- }
-
- /*Session handling*/
- /// <summary>
- /// Send a LogIn request, this must be called before anything else in this class.
- /// </summary>
- /// <param name="userName">The user name of OpenSubtitles</param>
- /// <param name="password">The password</param>
- /// <param name="language">The language, usally en</param>
- /// <returns>Status of the login operation</returns>
- public static IMethodResponse LogIn(string userName, string password, string language)
- {
- // Method call ..
- var parms = new List<IXmlRpcValue>();
- parms.Add(new XmlRpcValueBasic(userName));
- parms.Add(new XmlRpcValueBasic(password));
- parms.Add(new XmlRpcValueBasic(language));
- parms.Add(new XmlRpcValueBasic(XML_PRC_USERAGENT));
- var call = new XmlRpcMethodCall("LogIn", parms);
- OSHConsole.WriteLine("Sending LogIn request to the server ...", DebugCode.Good);
-
- //File.WriteAllText(".\\request.txt", Encoding.UTF8.GetString(XmlRpcGenerator.Generate(call)));
- // Send the request to the server
- string response = Utilities.GetStreamString(Utilities.SendRequest(XmlRpcGenerator.Generate(call), XML_PRC_USERAGENT));
-
- if (!response.Contains("ERROR:"))
- {
- // No error occur, get and decode the response. We expect Struct here.
- XmlRpcMethodCall[] calls = XmlRpcGenerator.DecodeMethodResponse(response);
- if (calls.Length > 0)
- {
- if (calls[0].Parameters.Count > 0)
- {
- var mainStruct = (XmlRpcValueStruct)calls[0].Parameters[0];
- var re = new MethodResponseLogIn("Success", "Log in successful.");
- foreach (XmlRpcStructMember MEMBER in mainStruct.Members)
- {
- switch (MEMBER.Name)
- {
- case "token": re.Token = TOKEN = MEMBER.Data.Data.ToString(); OSHConsole.WriteLine(MEMBER.Name + "= " + MEMBER.Data.Data.ToString()); break;
- case "seconds": re.Seconds = (double)MEMBER.Data.Data; OSHConsole.WriteLine(MEMBER.Name + "= " + MEMBER.Data.Data.ToString()); break;
- case "status": re.Status = MEMBER.Data.Data.ToString(); OSHConsole.WriteLine(MEMBER.Name + "= " + MEMBER.Data.Data.ToString()); break;
- }
- }
- return re;
- }
- }
- }
- else
- {
- OSHConsole.WriteLine(response, DebugCode.Error);
- return new MethodResponseError("Fail", response);
- }
- return new MethodResponseError("Fail", "Log in failed !");
- }
-
- public static async Task<IMethodResponse> LogInAsync(string userName, string password, string language, CancellationToken cancellationToken)
- {
- // Method call ..
- var parms = new List<IXmlRpcValue>();
- parms.Add(new XmlRpcValueBasic(userName));
- parms.Add(new XmlRpcValueBasic(password));
- parms.Add(new XmlRpcValueBasic(language));
- parms.Add(new XmlRpcValueBasic(XML_PRC_USERAGENT));
- var call = new XmlRpcMethodCall("LogIn", parms);
- OSHConsole.WriteLine("Sending LogIn request to the server ...", DebugCode.Good);
-
- //File.WriteAllText(".\\request.txt", Encoding.UTF8.GetString(XmlRpcGenerator.Generate(call)));
- // Send the request to the server
- var stream = await Utilities.SendRequestAsync(XmlRpcGenerator.Generate(call), XML_PRC_USERAGENT, cancellationToken)
- .ConfigureAwait(false);
-
- string response = Utilities.GetStreamString(stream);
-
- if (!response.Contains("ERROR:"))
- {
- // No error occur, get and decode the response. We expect Struct here.
- XmlRpcMethodCall[] calls = XmlRpcGenerator.DecodeMethodResponse(response);
- if (calls.Length > 0)
- {
- if (calls[0].Parameters.Count > 0)
- {
- var mainStruct = (XmlRpcValueStruct)calls[0].Parameters[0];
- var re = new MethodResponseLogIn("Success", "Log in successful.");
- foreach (XmlRpcStructMember MEMBER in mainStruct.Members)
- {
- switch (MEMBER.Name)
- {
- case "token":
- re.Token = TOKEN = MEMBER.Data.Data.ToString();
- OSHConsole.WriteLine(MEMBER.Name + "= " + MEMBER.Data.Data.ToString());
- break;
- case "seconds":
- re.Seconds = double.Parse(MEMBER.Data.Data.ToString(), CultureInfo.InvariantCulture);
- OSHConsole.WriteLine(MEMBER.Name + "= " + MEMBER.Data.Data.ToString());
- break;
- case "status":
- re.Status = MEMBER.Data.Data.ToString();
- OSHConsole.WriteLine(MEMBER.Name + "= " + MEMBER.Data.Data.ToString());
- break;
- }
- }
- return re;
- }
- }
- }
- else
- {
- OSHConsole.WriteLine(response, DebugCode.Error);
- return new MethodResponseError("Fail", response);
- }
- return new MethodResponseError("Fail", "Log in failed !");
- }
-
- /// <summary>
- /// Log out from the server. Call this to terminate the session.
- /// </summary>
- /// <returns></returns>
- public static IMethodResponse LogOut()
- {
- if (TOKEN == "")
- {
- OSHConsole.WriteLine("Can't do this call, 'token' value not set. Please use Log In method first.", DebugCode.Error);
- return new MethodResponseError("Fail", "Can't do this call, 'token' value not set. Please use Log In method first.");
- }
- // Method call ..
- var parms = new List<IXmlRpcValue>();
- parms.Add(new XmlRpcValueBasic(TOKEN, XmlRpcBasicValueType.String));
- var call = new XmlRpcMethodCall("LogOut", parms);
-
- OSHConsole.WriteLine("Sending LogOut request to the server ...", DebugCode.Good);
- // Send the request to the server
- string response = Utilities.GetStreamString(Utilities.SendRequest(XmlRpcGenerator.Generate(call), XML_PRC_USERAGENT));
- if (!response.Contains("ERROR:"))
- {
- // No error occur, get and decode the response. We expect Struct here.
- XmlRpcMethodCall[] calls = XmlRpcGenerator.DecodeMethodResponse(response);
- if (calls.Length > 0)
- {
- if (calls[0].Parameters.Count > 0)
- {
- var strct = (XmlRpcValueStruct)calls[0].Parameters[0];
- OSHConsole.WriteLine("STATUS=" + ((XmlRpcValueBasic)strct.Members[0].Data).Data.ToString());
- OSHConsole.WriteLine("SECONDS=" + ((XmlRpcValueBasic)strct.Members[1].Data).Data.ToString());
- var re = new MethodResponseLogIn("Success", "Log out successful.");
- re.Status = ((XmlRpcValueBasic)strct.Members[0].Data).Data.ToString();
- re.Seconds = (double)((XmlRpcValueBasic)strct.Members[1].Data).Data;
- return re;
- }
- }
- }
- else
- {
- OSHConsole.WriteLine(response, DebugCode.Error);
- return new MethodResponseError("Fail", response);
- }
- return new MethodResponseError("Fail", "Log out failed !");
- }
- /// <summary>
- /// keep-alive user's session, verify token/session validity
- /// </summary>
- /// <returns>Status of the call operation</returns>
- public static IMethodResponse NoOperation()
- {
- if (TOKEN == "")
- {
- OSHConsole.WriteLine("Can't do this call, 'token' value not set. Please use Log In method first.", DebugCode.Error);
- return new MethodResponseError("Fail", "Can't do this call, 'token' value not set. Please use Log In method first.");
- }
- // Method call ..
- var parms = new List<IXmlRpcValue>();
- parms.Add(new XmlRpcValueBasic(TOKEN, XmlRpcBasicValueType.String));
- parms.Add(new XmlRpcValueBasic(XML_PRC_USERAGENT, XmlRpcBasicValueType.String));
- var call = new XmlRpcMethodCall("NoOperation", parms);
-
- OSHConsole.WriteLine("Sending NoOperation request to the server ...", DebugCode.Good);
- // Send the request to the server
- string response = Utilities.GetStreamString(Utilities.SendRequest(XmlRpcGenerator.Generate(call), XML_PRC_USERAGENT));
- if (!response.Contains("ERROR:"))
- {
- // No error occur, get and decode the response. We expect Struct here.
- XmlRpcMethodCall[] calls = XmlRpcGenerator.DecodeMethodResponse(response);
- if (calls.Length > 0)
- {
- if (calls[0].Parameters.Count > 0)
- {
- var R = new MethodResponseNoOperation();
- var mainStruct = (XmlRpcValueStruct)calls[0].Parameters[0];
- // To make sure response is not currepted by server, do it in loop
- foreach (XmlRpcStructMember MEMBER in mainStruct.Members)
- {
- switch (MEMBER.Name)
- {
- case "status": R.Status = (string)MEMBER.Data.Data; OSHConsole.WriteLine(MEMBER.Name + "= " + MEMBER.Data.Data); break;
- case "seconds": R.Seconds = (double)MEMBER.Data.Data; OSHConsole.WriteLine(MEMBER.Name + "= " + MEMBER.Data.Data); break;
- case "download_limits":
- var dlStruct = (XmlRpcValueStruct)MEMBER.Data;
- foreach (XmlRpcStructMember dlmember in dlStruct.Members)
- {
- OSHConsole.WriteLine(" >" + dlmember.Name + "= " + dlmember.Data.Data.ToString());
- switch (dlmember.Name)
- {
- case "global_wrh_download_limit": R.global_wrh_download_limit = dlmember.Data.Data.ToString(); break;
- case "client_ip": R.client_ip = dlmember.Data.Data.ToString(); break;
- case "limit_check_by": R.limit_check_by = dlmember.Data.Data.ToString(); break;
- case "client_24h_download_count": R.client_24h_download_count = dlmember.Data.Data.ToString(); break;
- case "client_downlaod_quota": R.client_downlaod_quota = dlmember.Data.Data.ToString(); break;
- case "client_24h_download_limit": R.client_24h_download_limit = dlmember.Data.Data.ToString(); break;
- }
- }
- break;
- }
- }
- return R;
- }
- }
- }
- else
- {
- OSHConsole.WriteLine(response, DebugCode.Error);
- return new MethodResponseError("Fail", response);
- }
- return new MethodResponseError("Fail", "NoOperation call failed !");
- }
- /*Search and download*/
- /// <summary>
- /// Search for subtitle files matching your videos using either video file hashes or IMDb IDs.
- /// </summary>
- /// <param name="parameters">List of search subtitle parameters which each one represents 'struct parameter' as descriped at http://trac.opensubtitles.org/projects/opensubtitles/wiki/XmlRpcSearchSubtitles </param>
- /// <returns>Status of the call operation. If the call success the response will be 'MethodResponseSubtitleSearch'</returns>
- public static IMethodResponse SearchSubtitles(SubtitleSearchParameters[] parameters)
- {
- if (TOKEN == "")
- {
- OSHConsole.WriteLine("Can't do this call, 'token' value not set. Please use Log In method first.", DebugCode.Error);
- return new MethodResponseError("Fail", "Can't do this call, 'token' value not set. Please use Log In method first.");
- }
- if (parameters == null)
- {
- OSHConsole.UpdateLine("No subtitle search parameter passed !!", DebugCode.Error);
- return new MethodResponseError("Fail", "No subtitle search parameter passed");
- }
- if (parameters.Length == 0)
- {
- OSHConsole.UpdateLine("No subtitle search parameter passed !!", DebugCode.Error);
- return new MethodResponseError("Fail", "No subtitle search parameter passed");
- }
- // Method call ..
- var parms = new List<IXmlRpcValue>();
- // Add token param
- parms.Add(new XmlRpcValueBasic(TOKEN, XmlRpcBasicValueType.String));
- // Add subtitle search parameters. Each one will be like 'array' of structs.
- var array = new XmlRpcValueArray();
- foreach (SubtitleSearchParameters param in parameters)
- {
- var strct = new XmlRpcValueStruct(new List<XmlRpcStructMember>());
- // sublanguageid member
- var member = new XmlRpcStructMember("sublanguageid",
- new XmlRpcValueBasic(param.SubLangaugeID, XmlRpcBasicValueType.String));
- strct.Members.Add(member);
- // moviehash member
- if (param.MovieHash.Length > 0 && param.MovieByteSize > 0)
- {
- member = new XmlRpcStructMember("moviehash",
- new XmlRpcValueBasic(param.MovieHash, XmlRpcBasicValueType.String));
- strct.Members.Add(member);
- // moviehash member
- member = new XmlRpcStructMember("moviebytesize",
- new XmlRpcValueBasic(param.MovieByteSize, XmlRpcBasicValueType.Int));
- strct.Members.Add(member);
- }
- if (param.Query.Length > 0)
- {
- member = new XmlRpcStructMember("query",
- new XmlRpcValueBasic(param.Query, XmlRpcBasicValueType.String));
- strct.Members.Add(member);
- }
-
- if (param.Episode.Length > 0 && param.Season.Length > 0)
- {
- member = new XmlRpcStructMember("season",
- new XmlRpcValueBasic(param.Season, XmlRpcBasicValueType.String));
- strct.Members.Add(member);
- member = new XmlRpcStructMember("episode",
- new XmlRpcValueBasic(param.Episode, XmlRpcBasicValueType.String));
- strct.Members.Add(member);
- }
-
- // imdbid member
- if (param.IMDbID.Length > 0)
- {
- member = new XmlRpcStructMember("imdbid",
- new XmlRpcValueBasic(param.IMDbID, XmlRpcBasicValueType.String));
- strct.Members.Add(member);
- }
- // Add the struct to the array
- array.Values.Add(strct);
- }
- // Add the array to the parameters
- parms.Add(array);
- // Call !
- var call = new XmlRpcMethodCall("SearchSubtitles", parms);
- OSHConsole.WriteLine("Sending SearchSubtitles request to the server ...", DebugCode.Good);
- // Send the request to the server
- string response = Utilities.GetStreamString(Utilities.SendRequest(XmlRpcGenerator.Generate(call), XML_PRC_USERAGENT));
-
- if (!response.Contains("ERROR:"))
- {
- // No error occur, get and decode the response.
- XmlRpcMethodCall[] calls = XmlRpcGenerator.DecodeMethodResponse(response);
- if (calls.Length > 0)
- {
- if (calls[0].Parameters.Count > 0)
- {
- // We expect Struct of 3 members:
- //* the first is status
- //* the second is [array of structs, each one includes subtitle file].
- //* the third is [double basic value] represent seconds token by server.
- var mainStruct = (XmlRpcValueStruct)calls[0].Parameters[0];
- // Create the response, we'll need it later
- var R = new MethodResponseSubtitleSearch();
- // To make sure response is not currepted by server, do it in loop
- foreach (XmlRpcStructMember MEMBER in mainStruct.Members)
- {
- if (MEMBER.Name == "status")
- {
- R.Status = (string)MEMBER.Data.Data;
- OSHConsole.WriteLine("Status= " + R.Status);
- }
- else if (MEMBER.Name == "seconds")
- {
- R.Seconds = (double)MEMBER.Data.Data;
- OSHConsole.WriteLine("Seconds= " + R.Seconds);
- }
- else if (MEMBER.Name == "data")
- {
- if (MEMBER.Data is XmlRpcValueArray)
- {
- OSHConsole.WriteLine("Search results: ");
-
- var rarray = (XmlRpcValueArray)MEMBER.Data;
- foreach (IXmlRpcValue subStruct in rarray.Values)
- {
- if (subStruct == null) continue;
- if (!(subStruct is XmlRpcValueStruct)) continue;
-
- var result = new SubtitleSearchResult();
- foreach (XmlRpcStructMember submember in ((XmlRpcValueStruct)subStruct).Members)
- {
- // To avoid errors of arranged info or missing ones, let's do it with switch..
- switch (submember.Name)
- {
- case "IDMovie": result.IDMovie = submember.Data.Data.ToString(); break;
- case "IDMovieImdb": result.IDMovieImdb = submember.Data.Data.ToString(); break;
- case "IDSubMovieFile": result.IDSubMovieFile = submember.Data.Data.ToString(); break;
- case "IDSubtitle": result.IDSubtitle = submember.Data.Data.ToString(); break;
- case "IDSubtitleFile": result.IDSubtitleFile = submember.Data.Data.ToString(); break;
- case "ISO639": result.ISO639 = submember.Data.Data.ToString(); break;
- case "LanguageName": result.LanguageName = submember.Data.Data.ToString(); break;
- case "MovieByteSize": result.MovieByteSize = submember.Data.Data.ToString(); break;
- case "MovieHash": result.MovieHash = submember.Data.Data.ToString(); break;
- case "MovieImdbRating": result.MovieImdbRating = submember.Data.Data.ToString(); break;
- case "MovieName": result.MovieName = submember.Data.Data.ToString(); break;
- case "MovieNameEng": result.MovieNameEng = submember.Data.Data.ToString(); break;
- case "MovieReleaseName": result.MovieReleaseName = submember.Data.Data.ToString(); break;
- case "MovieTimeMS": result.MovieTimeMS = submember.Data.Data.ToString(); break;
- case "MovieYear": result.MovieYear = submember.Data.Data.ToString(); break;
- case "SubActualCD": result.SubActualCD = submember.Data.Data.ToString(); break;
- case "SubAddDate": result.SubAddDate = submember.Data.Data.ToString(); break;
- case "SubAuthorComment": result.SubAuthorComment = submember.Data.Data.ToString(); break;
- case "SubBad": result.SubBad = submember.Data.Data.ToString(); break;
- case "SubDownloadLink": result.SubDownloadLink = submember.Data.Data.ToString(); break;
- case "SubDownloadsCnt": result.SubDownloadsCnt = submember.Data.Data.ToString(); break;
- case "SeriesEpisode": result.SeriesEpisode = submember.Data.Data.ToString(); break;
- case "SeriesSeason": result.SeriesSeason = submember.Data.Data.ToString(); break;
- case "SubFileName": result.SubFileName = submember.Data.Data.ToString(); break;
- case "SubFormat": result.SubFormat = submember.Data.Data.ToString(); break;
- case "SubHash": result.SubHash = submember.Data.Data.ToString(); break;
- case "SubLanguageID": result.SubLanguageID = submember.Data.Data.ToString(); break;
- case "SubRating": result.SubRating = submember.Data.Data.ToString(); break;
- case "SubSize": result.SubSize = submember.Data.Data.ToString(); break;
- case "SubSumCD": result.SubSumCD = submember.Data.Data.ToString(); break;
- case "UserID": result.UserID = submember.Data.Data.ToString(); break;
- case "UserNickName": result.UserNickName = submember.Data.Data.ToString(); break;
- case "ZipDownloadLink": result.ZipDownloadLink = submember.Data.Data.ToString(); break;
- }
- }
- R.Results.Add(result);
- OSHConsole.WriteLine(">" + result.ToString());
- }
- }
- else// Unknown data ?
- {
- OSHConsole.WriteLine("Data= " + MEMBER.Data.Data.ToString(), DebugCode.Warning);
- }
- }
- }
- // Return the response to user !!
- return R;
- }
- }
- }
- else
- {
- OSHConsole.WriteLine(response, DebugCode.Error);
- return new MethodResponseError("Fail", response);
- }
- return new MethodResponseError("Fail", "Search Subtitles call failed !");
- }
-
- public static async Task<IMethodResponse> SearchSubtitlesAsync(SubtitleSearchParameters[] parameters, CancellationToken cancellationToken)
- {
- if (TOKEN == "")
- {
- OSHConsole.WriteLine("Can't do this call, 'token' value not set. Please use Log In method first.", DebugCode.Error);
- return new MethodResponseError("Fail", "Can't do this call, 'token' value not set. Please use Log In method first.");
- }
- if (parameters == null)
- {
- OSHConsole.UpdateLine("No subtitle search parameter passed !!", DebugCode.Error);
- return new MethodResponseError("Fail", "No subtitle search parameter passed");
- }
- if (parameters.Length == 0)
- {
- OSHConsole.UpdateLine("No subtitle search parameter passed !!", DebugCode.Error);
- return new MethodResponseError("Fail", "No subtitle search parameter passed");
- }
- // Method call ..
- var parms = new List<IXmlRpcValue>();
- // Add token param
- parms.Add(new XmlRpcValueBasic(TOKEN, XmlRpcBasicValueType.String));
- // Add subtitle search parameters. Each one will be like 'array' of structs.
- var array = new XmlRpcValueArray();
- foreach (SubtitleSearchParameters param in parameters)
- {
- var strct = new XmlRpcValueStruct(new List<XmlRpcStructMember>());
- // sublanguageid member
- var member = new XmlRpcStructMember("sublanguageid",
- new XmlRpcValueBasic(param.SubLangaugeID, XmlRpcBasicValueType.String));
- strct.Members.Add(member);
- // moviehash member
- if (param.MovieHash.Length > 0 && param.MovieByteSize > 0)
- {
- member = new XmlRpcStructMember("moviehash",
- new XmlRpcValueBasic(param.MovieHash, XmlRpcBasicValueType.String));
- strct.Members.Add(member);
- // moviehash member
- member = new XmlRpcStructMember("moviebytesize",
- new XmlRpcValueBasic(param.MovieByteSize, XmlRpcBasicValueType.Int));
- strct.Members.Add(member);
- }
- if (param.Query.Length > 0)
- {
- member = new XmlRpcStructMember("query",
- new XmlRpcValueBasic(param.Query, XmlRpcBasicValueType.String));
- strct.Members.Add(member);
- }
-
- if (param.Episode.Length > 0 && param.Season.Length > 0)
- {
- member = new XmlRpcStructMember("season",
- new XmlRpcValueBasic(param.Season, XmlRpcBasicValueType.String));
- strct.Members.Add(member);
- member = new XmlRpcStructMember("episode",
- new XmlRpcValueBasic(param.Episode, XmlRpcBasicValueType.String));
- strct.Members.Add(member);
- }
-
- // imdbid member
- if (param.IMDbID.Length > 0)
- {
- member = new XmlRpcStructMember("imdbid",
- new XmlRpcValueBasic(param.IMDbID, XmlRpcBasicValueType.String));
- strct.Members.Add(member);
- }
- // Add the struct to the array
- array.Values.Add(strct);
- }
- // Add the array to the parameters
- parms.Add(array);
- // Call !
- var call = new XmlRpcMethodCall("SearchSubtitles", parms);
- OSHConsole.WriteLine("Sending SearchSubtitles request to the server ...", DebugCode.Good);
- // Send the request to the server
- string response = Utilities.GetStreamString(await Utilities.SendRequestAsync(XmlRpcGenerator.Generate(call), XML_PRC_USERAGENT, cancellationToken).ConfigureAwait(false));
-
- if (!response.Contains("ERROR:"))
- {
- // No error occur, get and decode the response.
- XmlRpcMethodCall[] calls = XmlRpcGenerator.DecodeMethodResponse(response);
- if (calls.Length > 0)
- {
- if (calls[0].Parameters.Count > 0)
- {
- // We expect Struct of 3 members:
- //* the first is status
- //* the second is [array of structs, each one includes subtitle file].
- //* the third is [double basic value] represent seconds token by server.
- var mainStruct = (XmlRpcValueStruct)calls[0].Parameters[0];
- // Create the response, we'll need it later
- var R = new MethodResponseSubtitleSearch();
- // To make sure response is not currepted by server, do it in loop
- foreach (XmlRpcStructMember MEMBER in mainStruct.Members)
- {
- if (MEMBER.Name == "status")
- {
- R.Status = (string)MEMBER.Data.Data;
- OSHConsole.WriteLine("Status= " + R.Status);
- }
- else if (MEMBER.Name == "seconds")
- {
- R.Seconds = (double)MEMBER.Data.Data;
- OSHConsole.WriteLine("Seconds= " + R.Seconds);
- }
- else if (MEMBER.Name == "data")
- {
- if (MEMBER.Data is XmlRpcValueArray)
- {
- OSHConsole.WriteLine("Search results: ");
-
- var rarray = (XmlRpcValueArray)MEMBER.Data;
- foreach (IXmlRpcValue subStruct in rarray.Values)
- {
- if (subStruct == null) continue;
- if (!(subStruct is XmlRpcValueStruct)) continue;
-
- var result = new SubtitleSearchResult();
- foreach (XmlRpcStructMember submember in ((XmlRpcValueStruct)subStruct).Members)
- {
- // To avoid errors of arranged info or missing ones, let's do it with switch..
- switch (submember.Name)
- {
- case "IDMovie": result.IDMovie = submember.Data.Data.ToString(); break;
- case "IDMovieImdb": result.IDMovieImdb = submember.Data.Data.ToString(); break;
- case "IDSubMovieFile": result.IDSubMovieFile = submember.Data.Data.ToString(); break;
- case "IDSubtitle": result.IDSubtitle = submember.Data.Data.ToString(); break;
- case "IDSubtitleFile": result.IDSubtitleFile = submember.Data.Data.ToString(); break;
- case "ISO639": result.ISO639 = submember.Data.Data.ToString(); break;
- case "LanguageName": result.LanguageName = submember.Data.Data.ToString(); break;
- case "MovieByteSize": result.MovieByteSize = submember.Data.Data.ToString(); break;
- case "MovieHash": result.MovieHash = submember.Data.Data.ToString(); break;
- case "MovieImdbRating": result.MovieImdbRating = submember.Data.Data.ToString(); break;
- case "MovieName": result.MovieName = submember.Data.Data.ToString(); break;
- case "MovieNameEng": result.MovieNameEng = submember.Data.Data.ToString(); break;
- case "MovieReleaseName": result.MovieReleaseName = submember.Data.Data.ToString(); break;
- case "MovieTimeMS": result.MovieTimeMS = submember.Data.Data.ToString(); break;
- case "MovieYear": result.MovieYear = submember.Data.Data.ToString(); break;
- case "SubActualCD": result.SubActualCD = submember.Data.Data.ToString(); break;
- case "SubAddDate": result.SubAddDate = submember.Data.Data.ToString(); break;
- case "SubAuthorComment": result.SubAuthorComment = submember.Data.Data.ToString(); break;
- case "SubBad": result.SubBad = submember.Data.Data.ToString(); break;
- case "SubDownloadLink": result.SubDownloadLink = submember.Data.Data.ToString(); break;
- case "SubDownloadsCnt": result.SubDownloadsCnt = submember.Data.Data.ToString(); break;
- case "SeriesEpisode": result.SeriesEpisode = submember.Data.Data.ToString(); break;
- case "SeriesSeason": result.SeriesSeason = submember.Data.Data.ToString(); break;
- case "SubFileName": result.SubFileName = submember.Data.Data.ToString(); break;
- case "SubFormat": result.SubFormat = submember.Data.Data.ToString(); break;
- case "SubHash": result.SubHash = submember.Data.Data.ToString(); break;
- case "SubLanguageID": result.SubLanguageID = submember.Data.Data.ToString(); break;
- case "SubRating": result.SubRating = submember.Data.Data.ToString(); break;
- case "SubSize": result.SubSize = submember.Data.Data.ToString(); break;
- case "SubSumCD": result.SubSumCD = submember.Data.Data.ToString(); break;
- case "UserID": result.UserID = submember.Data.Data.ToString(); break;
- case "UserNickName": result.UserNickName = submember.Data.Data.ToString(); break;
- case "ZipDownloadLink": result.ZipDownloadLink = submember.Data.Data.ToString(); break;
- }
- }
- R.Results.Add(result);
- OSHConsole.WriteLine(">" + result.ToString());
- }
- }
- else// Unknown data ?
- {
- OSHConsole.WriteLine("Data= " + MEMBER.Data.Data.ToString(), DebugCode.Warning);
- }
- }
- }
- // Return the response to user !!
- return R;
- }
- }
- }
- else
- {
- OSHConsole.WriteLine(response, DebugCode.Error);
- return new MethodResponseError("Fail", response);
- }
- return new MethodResponseError("Fail", "Search Subtitles call failed !");
- }
-
- /// <summary>
- /// Download subtitle file(s)
- /// </summary>
- /// <param name="subIDS">The subtitle IDS (an array of IDSubtitleFile value that given by server as SearchSubtiles results)</param>
- /// <returns>Status of the call operation. If the call success the response will be 'MethodResponseSubtitleDownload' which will hold downloaded subtitles</returns>
- public static IMethodResponse DownloadSubtitles(int[] subIDS)
- {
- if (TOKEN == "")
- {
- OSHConsole.WriteLine("Can't do this call, 'token' value not set. Please use Log In method first.", DebugCode.Error);
- return new MethodResponseError("Fail", "Can't do this call, 'token' value not set. Please use Log In method first.");
- }
- if (subIDS == null)
- {
- OSHConsole.UpdateLine("No subtitle id passed !!", DebugCode.Error);
- return new MethodResponseError("Fail", "No subtitle id passed");
- }
- if (subIDS.Length == 0)
- {
- OSHConsole.UpdateLine("No subtitle id passed !!", DebugCode.Error);
- return new MethodResponseError("Fail", "No subtitle id passed");
- }
- // Method call ..
- var parms = new List<IXmlRpcValue>();
- // Add token param
- parms.Add(new XmlRpcValueBasic(TOKEN, XmlRpcBasicValueType.String));
- // Add subtitle search parameters. Each one will be like 'array' of structs.
- var array = new XmlRpcValueArray();
- foreach (int id in subIDS)
- {
- array.Values.Add(new XmlRpcValueBasic(id, XmlRpcBasicValueType.Int));
- }
- // Add the array to the parameters
- parms.Add(array);
- // Call !
- var call = new XmlRpcMethodCall("DownloadSubtitles", parms);
- OSHConsole.WriteLine("Sending DownloadSubtitles request to the server ...", DebugCode.Good);
- // Send the request to the server
- string response = Utilities.GetStreamString(Utilities.SendRequest(XmlRpcGenerator.Generate(call), XML_PRC_USERAGENT));
- if (!response.Contains("ERROR:"))
- {
- // No error occur, get and decode the response.
- XmlRpcMethodCall[] calls = XmlRpcGenerator.DecodeMethodResponse(response);
- if (calls.Length > 0)
- {
- if (calls[0].Parameters.Count > 0)
- {
- // We expect Struct of 3 members:
- //* the first is status
- //* the second is [array of structs, each one includes subtitle file].
- //* the third is [double basic value] represent seconds token by server.
- var mainStruct = (XmlRpcValueStruct)calls[0].Parameters[0];
- // Create the response, we'll need it later
- var R = new MethodResponseSubtitleDownload();
-
- // To make sure response is not currepted by server, do it in loop
- foreach (XmlRpcStructMember MEMBER in mainStruct.Members)
- {
- if (MEMBER.Name == "status")
- {
- R.Status = (string)MEMBER.Data.Data;
- OSHConsole.WriteLine("Status= " + R.Status);
- }
- else if (MEMBER.Name == "seconds")
- {
- R.Seconds = (double)MEMBER.Data.Data;
- OSHConsole.WriteLine("Seconds= " + R.Seconds);
- }
- else if (MEMBER.Name == "data")
- {
- if (MEMBER.Data is XmlRpcValueArray)
- {
- OSHConsole.WriteLine("Download results:");
- var rarray = (XmlRpcValueArray)MEMBER.Data;
- foreach (IXmlRpcValue subStruct in rarray.Values)
- {
- if (subStruct == null) continue;
- if (!(subStruct is XmlRpcValueStruct)) continue;
-
- var result = new SubtitleDownloadResult();
- foreach (XmlRpcStructMember submember in ((XmlRpcValueStruct)subStruct).Members)
- {
- // To avoid errors of arranged info or missing ones, let's do it with switch..
- switch (submember.Name)
- {
- case "idsubtitlefile": result.IdSubtitleFile = (string)submember.Data.Data; break;
- case "data": result.Data = (string)submember.Data.Data; break;
- }
- }
- R.Results.Add(result);
- OSHConsole.WriteLine("> IDSubtilteFile= " + result.ToString());
- }
- }
- else// Unknown data ?
- {
- OSHConsole.WriteLine("Data= " + MEMBER.Data.Data.ToString(), DebugCode.Warning);
- }
- }
- }
- // Return the response to user !!
- return R;
- }
- }
- }
- else
- {
- OSHConsole.WriteLine(response, DebugCode.Error);
- return new MethodResponseError("Fail", response);
- }
- return new MethodResponseError("Fail", "DownloadSubtitles call failed !");
- }
-
- public static async Task<IMethodResponse> DownloadSubtitlesAsync(int[] subIDS, CancellationToken cancellationToken)
- {
- if (TOKEN == "")
- {
- OSHConsole.WriteLine("Can't do this call, 'token' value not set. Please use Log In method first.", DebugCode.Error);
- return new MethodResponseError("Fail", "Can't do this call, 'token' value not set. Please use Log In method first.");
- }
- if (subIDS == null)
- {
- OSHConsole.UpdateLine("No subtitle id passed !!", DebugCode.Error);
- return new MethodResponseError("Fail", "No subtitle id passed");
- }
- if (subIDS.Length == 0)
- {
- OSHConsole.UpdateLine("No subtitle id passed !!", DebugCode.Error);
- return new MethodResponseError("Fail", "No subtitle id passed");
- }
- // Method call ..
- var parms = new List<IXmlRpcValue>();
- // Add token param
- parms.Add(new XmlRpcValueBasic(TOKEN, XmlRpcBasicValueType.String));
- // Add subtitle search parameters. Each one will be like 'array' of structs.
- var array = new XmlRpcValueArray();
- foreach (int id in subIDS)
- {
- array.Values.Add(new XmlRpcValueBasic(id, XmlRpcBasicValueType.Int));
- }
- // Add the array to the parameters
- parms.Add(array);
- // Call !
- var call = new XmlRpcMethodCall("DownloadSubtitles", parms);
- OSHConsole.WriteLine("Sending DownloadSubtitles request to the server ...", DebugCode.Good);
- // Send the request to the server
-
- var httpResponse = await Utilities.SendRequestAsync(XmlRpcGenerator.Generate(call), XML_PRC_USERAGENT, cancellationToken).ConfigureAwait(false);
-
- string response = Utilities.GetStreamString(httpResponse);
- if (!response.Contains("ERROR:"))
- {
- // No error occur, get and decode the response.
- XmlRpcMethodCall[] calls = XmlRpcGenerator.DecodeMethodResponse(response);
- if (calls.Length > 0)
- {
- if (calls[0].Parameters.Count > 0)
- {
- // We expect Struct of 3 members:
- //* the first is status
- //* the second is [array of structs, each one includes subtitle file].
- //* the third is [double basic value] represent seconds token by server.
- var mainStruct = (XmlRpcValueStruct)calls[0].Parameters[0];
- // Create the response, we'll need it later
- var R = new MethodResponseSubtitleDownload();
-
- // To make sure response is not currepted by server, do it in loop
- foreach (XmlRpcStructMember MEMBER in mainStruct.Members)
- {
- if (MEMBER.Name == "status")
- {
- R.Status = (string)MEMBER.Data.Data;
- OSHConsole.WriteLine("Status= " + R.Status);
- }
- else if (MEMBER.Name == "seconds")
- {
- R.Seconds = (double)MEMBER.Data.Data;
- OSHConsole.WriteLine("Seconds= " + R.Seconds);
- }
- else if (MEMBER.Name == "data")
- {
- if (MEMBER.Data is XmlRpcValueArray)
- {
- OSHConsole.WriteLine("Download results:");
- var rarray = (XmlRpcValueArray)MEMBER.Data;
- foreach (IXmlRpcValue subStruct in rarray.Values)
- {
- if (subStruct == null) continue;
- if (!(subStruct is XmlRpcValueStruct)) continue;
-
- var result = new SubtitleDownloadResult();
- foreach (XmlRpcStructMember submember in ((XmlRpcValueStruct)subStruct).Members)
- {
- // To avoid errors of arranged info or missing ones, let's do it with switch..
- switch (submember.Name)
- {
- case "idsubtitlefile": result.IdSubtitleFile = (string)submember.Data.Data; break;
- case "data": result.Data = (string)submember.Data.Data; break;
- }
- }
- R.Results.Add(result);
- OSHConsole.WriteLine("> IDSubtilteFile= " + result.ToString());
- }
- }
- else// Unknown data ?
- {
- OSHConsole.WriteLine("Data= " + MEMBER.Data.Data.ToString(), DebugCode.Warning);
- }
- }
- }
- // Return the response to user !!
- return R;
- }
- }
- }
- else
- {
- OSHConsole.WriteLine(response, DebugCode.Error);
- return new MethodResponseError("Fail", response);
- }
- return new MethodResponseError("Fail", "DownloadSubtitles call failed !");
- }
-
- /// <summary>
- /// Returns comments for subtitles
- /// </summary>
- /// <param name="subIDS">The subtitle IDS (an array of IDSubtitleFile value that given by server as SearchSubtiles results)</param>
- /// <returns>Status of the call operation. If the call success the response will be 'MethodResponseGetComments'</returns>
- public static IMethodResponse GetComments(int[] subIDS)
- {
- if (TOKEN == "")
- {
- OSHConsole.WriteLine("Can't do this call, 'token' value not set. Please use Log In method first.", DebugCode.Error);
- return new MethodResponseError("Fail", "Can't do this call, 'token' value not set. Please use Log In method first.");
- }
- if (subIDS == null)
- {
- OSHConsole.UpdateLine("No subtitle id passed !!", DebugCode.Error);
- return new MethodResponseError("Fail", "No subtitle id passed");
- }
- if (subIDS.Length == 0)
- {
- OSHConsole.UpdateLine("No subtitle id passed !!", DebugCode.Error);
- return new MethodResponseError("Fail", "No subtitle id passed");
- }
- // Method call ..
- var parms = new List<IXmlRpcValue>();
- // Add token param
- parms.Add(new XmlRpcValueBasic(TOKEN));
- // Add subtitle search parameters. Each one will be like 'array' of structs.
- var array = new XmlRpcValueArray(subIDS);
- // Add the array to the parameters
- parms.Add(array);
- // Call !
- var call = new XmlRpcMethodCall("GetComments", parms);
- OSHConsole.WriteLine("Sending GetComments request to the server ...", DebugCode.Good);
- // Send the request to the server
- string response = Utilities.GetStreamString(Utilities.SendRequest(XmlRpcGenerator.Generate(call), XML_PRC_USERAGENT));
- if (!response.Contains("ERROR:"))
- {
- // No error occur, get and decode the response.
- XmlRpcMethodCall[] calls = XmlRpcGenerator.DecodeMethodResponse(response);
- if (calls.Length > 0)
- {
- if (calls[0].Parameters.Count > 0)
- {
- var mainStruct = (XmlRpcValueStruct)calls[0].Parameters[0];
- // Create the response, we'll need it later
- var R = new MethodResponseGetComments();
-
- // To make sure response is not currepted by server, do it in loop
- foreach (XmlRpcStructMember MEMBER in mainStruct.Members)
- {
- if (MEMBER.Name == "status")
- {
- R.Status = (string)MEMBER.Data.Data;
- OSHConsole.WriteLine("Status= " + R.Status);
- }
- else if (MEMBER.Name == "seconds")
- {
- R.Seconds = (double)MEMBER.Data.Data;
- OSHConsole.WriteLine("Seconds= " + R.Seconds);
- }
- else if (MEMBER.Name == "data")
- {
- if (MEMBER.Data is XmlRpcValueArray)
- {
- OSHConsole.WriteLine("Comments results:");
- var rarray = (XmlRpcValueArray)MEMBER.Data;
- foreach (IXmlRpcValue commentStruct in rarray.Values)
- {
- if (commentStruct == null) continue;
- if (!(commentStruct is XmlRpcValueStruct)) continue;
-
- var result = new GetCommentsResult();
- foreach (XmlRpcStructMember commentmember in ((XmlRpcValueStruct)commentStruct).Members)
- {
- // To avoid errors of arranged info or missing ones, let's do it with switch..
- switch (commentmember.Name)
- {
- case "IDSubtitle": result.IDSubtitle = (string)commentmember.Data.Data; break;
- case "UserID": result.UserID = (string)commentmember.Data.Data; break;
- case "UserNickName": result.UserNickName = (string)commentmember.Data.Data; break;
- case "Comment": result.Comment = (string)commentmember.Data.Data; break;
- case "Created": result.Created = (string)commentmember.Data.Data; break;
- }
- }
- R.Results.Add(result);
- OSHConsole.WriteLine("> IDSubtitle= " + result.ToString());
- }
- }
- else// Unknown data ?
- {
- OSHConsole.WriteLine("Data= " + MEMBER.Data.Data.ToString(), DebugCode.Warning);
- }
- }
- }
- // Return the response to user !!
- return R;
- }
- }
- }
- else
- {
- OSHConsole.WriteLine(response, DebugCode.Error);
- return new MethodResponseError("Fail", response);
- }
- return new MethodResponseError("Fail", "GetComments call failed !");
- }
-
- /// <summary>
- /// Schedule a periodical search for subtitles matching given video files, send results to user's e-mail address.
- /// </summary>
- /// <param name="languageIDS">The language 3 lenght ids array</param>
- /// <param name="movies">The movies parameters</param>
- /// <returns>Status of the call operation. If the call success the response will be 'MethodResponseSearchToMail'</returns>
- public static IMethodResponse SearchToMail(string[] languageIDS, SearchToMailMovieParameter[] movies)
- {
- if (TOKEN == "")
- {
- OSHConsole.WriteLine("Can't do this call, 'token' value not set. Please use Log In method first.", DebugCode.Error);
- return new MethodResponseError("Fail", "Can't do this call, 'token' value not set. Please use Log In method first.");
- }
- // Method call ..
- var parms = new List<IXmlRpcValue>();
- parms.Add(new XmlRpcValueBasic(TOKEN, XmlRpcBasicValueType.String));
- // Array of sub langs
- var a = new XmlRpcValueArray(languageIDS);
- parms.Add(a);
- // Array of video parameters
- a = new XmlRpcValueArray();
- foreach (SearchToMailMovieParameter p in movies)
- {
- var str = new XmlRpcValueStruct(new List<XmlRpcStructMember>());
- str.Members.Add(new XmlRpcStructMember("moviehash", new XmlRpcValueBasic(p.moviehash)));
- str.Members.Add(new XmlRpcStructMember("moviesize", new XmlRpcValueBasic(p.moviesize)));
- a.Values.Add(str);
- }
- parms.Add(a);
- var call = new XmlRpcMethodCall("SearchToMail", parms);
-
- OSHConsole.WriteLine("Sending SearchToMail request to the server ...", DebugCode.Good);
- // Send the request to the server
- string response = Utilities.GetStreamString(Utilities.SendRequest(XmlRpcGenerator.Generate(call), XML_PRC_USERAGENT));
- if (!response.Contains("ERROR:"))
- {
- // No error occur, get and decode the response.
- XmlRpcMethodCall[] calls = XmlRpcGenerator.DecodeMethodResponse(response);
- if (calls.Length > 0)
- {
- if (calls[0].Parameters.Count > 0)
- {
- var mainStruct = (XmlRpcValueStruct)calls[0].Parameters[0];
- // Create the response, we'll need it later
- var R = new MethodResponseSearchToMail();
-
- // To make sure response is not currepted by server, do it in loop
- foreach (XmlRpcStructMember MEMBER in mainStruct.Members)
- {
- switch (MEMBER.Name)
- {
- case "status": R.Status = (string)MEMBER.Data.Data; OSHConsole.WriteLine(">" + MEMBER.Name + "= " + MEMBER.Data.Data.ToString()); break;
- case "seconds": R.Seconds = (double)MEMBER.Data.Data; OSHConsole.WriteLine(">" + MEMBER.Name + "= " + MEMBER.Data.Data.ToString()); break;
- }
- }
- // Return the response to user !!
- return R;
- }
- }
- }
- else
- {
- OSHConsole.WriteLine(response, DebugCode.Error);
- return new MethodResponseError("Fail", response);
- }
- return new MethodResponseError("Fail", "SearchToMail call failed !");
- }
- /*Movies*/
- /// <summary>
- /// Search for a movie (using movie title)
- /// </summary>
- /// <param name="query">Movie title user is searching for, this is cleaned-up a bit (remove dvdrip, etc.) before searching </param>
- /// <returns>Status of the call operation. If the call success the response will be 'MethodResponseSubtitleSearch'</returns>
- public static IMethodResponse SearchMoviesOnIMDB(string query)
- {
- if (TOKEN == "")
- {
- OSHConsole.WriteLine("Can't do this call, 'token' value not set. Please use Log In method first.", DebugCode.Error);
- return new MethodResponseError("Fail", "Can't do this call, 'token' value not set. Please use Log In method first.");
- }
- // Method call ..
- var parms = new List<IXmlRpcValue>();
- // Add token param
- parms.Add(new XmlRpcValueBasic(TOKEN, XmlRpcBasicValueType.String));
- // Add query param
- parms.Add(new XmlRpcValueBasic(query, XmlRpcBasicValueType.String));
- // Call !
- var call = new XmlRpcMethodCall("SearchMoviesOnIMDB", parms);
- OSHConsole.WriteLine("Sending SearchMoviesOnIMDB request to the server ...", DebugCode.Good);
- // Send the request to the server
- string response = Utilities.GetStreamString(Utilities.SendRequest(XmlRpcGenerator.Generate(call), XML_PRC_USERAGENT));
- if (!response.Contains("ERROR:"))
- {
- // No error occur, get and decode the response.
- XmlRpcMethodCall[] calls = XmlRpcGenerator.DecodeMethodResponse(response);
- if (calls.Length > 0)
- {
- if (calls[0].Parameters.Count > 0)
- {
- var mainStruct = (XmlRpcValueStruct)calls[0].Parameters[0];
- // Create the response, we'll need it later
- var R = new MethodResponseMovieSearch();
-
- // To make sure response is not currepted by server, do it in loop
- foreach (XmlRpcStructMember MEMBER in mainStruct.Members)
- {
- if (MEMBER.Name == "status")
- {
- R.Status = (string)MEMBER.Data.Data;
- OSHConsole.WriteLine("Status= " + R.Status);
- }
- else if (MEMBER.Name == "seconds")
- {
- R.Seconds = (double)MEMBER.Data.Data;
- OSHConsole.WriteLine("Seconds= " + R.Seconds);
- }
- else if (MEMBER.Name == "data")
- {
- if (MEMBER.Data is XmlRpcValueArray)
- {
- OSHConsole.WriteLine("Search results:");
- var rarray = (XmlRpcValueArray)MEMBER.Data;
- foreach (IXmlRpcValue subStruct in rarray.Values)
- {
- if (subStruct == null) continue;
- if (!(subStruct is XmlRpcValueStruct)) continue;
-
- var result = new MovieSearchResult();
- foreach (XmlRpcStructMember submember in ((XmlRpcValueStruct)subStruct).Members)
- {
- // To avoid errors of arranged info or missing ones, let's do it with switch..
- switch (submember.Name)
- {
- case "id": result.ID = (string)submember.Data.Data; break;
- case "title": result.Title = (string)submember.Data.Data; break;
- }
- }
- R.Results.Add(result);
- OSHConsole.WriteLine(">" + result.ToString());
- }
- }
- else// Unknown data ?
- {
- OSHConsole.WriteLine("Data= " + MEMBER.Data.Data.ToString(), DebugCode.Warning);
- }
- }
- }
- // Return the response to user !!
- return R;
- }
- }
- }
- else
- {
- OSHConsole.WriteLine(response, DebugCode.Error);
- return new MethodResponseError("Fail", response);
- }
- return new MethodResponseError("Fail", "SearchMoviesOnIMDB call failed !");
- }
- /// <summary>
- /// Get movie details for given IMDb ID
- /// </summary>
- /// <param name="imdbid">http://www.imdb.com/</param>
- /// <returns>Status of the call operation. If the call success the response will be 'MethodResponseMovieDetails'</returns>
- public static IMethodResponse GetIMDBMovieDetails(string imdbid)
- {
- if (TOKEN == "")
- {
- OSHConsole.WriteLine("Can't do this call, 'token' value not set. Please use Log In method first.", DebugCode.Error);
- return new MethodResponseError("Fail", "Can't do this call, 'token' value not set. Please use Log In method first.");
- }
- // Method call ..
- var parms = new List<IXmlRpcValue>();
- // Add token param
- parms.Add(new XmlRpcValueBasic(TOKEN));
- // Add query param
- parms.Add(new XmlRpcValueBasic(imdbid));
- // Call !
- var call = new XmlRpcMethodCall("GetIMDBMovieDetails", parms);
- OSHConsole.WriteLine("Sending GetIMDBMovieDetails request to the server ...", DebugCode.Good);
- // Send the request to the server
- string response = Utilities.GetStreamString(Utilities.SendRequest(XmlRpcGenerator.Generate(call), XML_PRC_USERAGENT));
- if (!response.Contains("ERROR:"))
- {
- // No error occur, get and decode the response.
- XmlRpcMethodCall[] calls = XmlRpcGenerator.DecodeMethodResponse(response);
- if (calls.Length > 0)
- {
- if (calls[0].Parameters.Count > 0)
- {
- var mainStruct = (XmlRpcValueStruct)calls[0].Parameters[0];
- // Create the response, we'll need it later
- var R = new MethodResponseMovieDetails();
-
- // To make sure response is not currepted by server, do it in loop
- foreach (XmlRpcStructMember MEMBER in mainStruct.Members)
- {
- if (MEMBER.Name == "status")
- {
- R.Status = (string)MEMBER.Data.Data;
- OSHConsole.WriteLine("Status= " + R.Status);
- }
- else if (MEMBER.Name == "seconds")
- {
- R.Seconds = (double)MEMBER.Data.Data;
- OSHConsole.WriteLine("Seconds= " + R.Seconds);
- }
- else if (MEMBER.Name == "data")
- {
- // We expect struct with details...
- if (MEMBER.Data is XmlRpcValueStruct)
- {
- OSHConsole.WriteLine("Details result:");
- var detailsStruct = (XmlRpcValueStruct)MEMBER.Data;
- foreach (XmlRpcStructMember dmem in detailsStruct.Members)
- {
- switch (dmem.Name)
- {
- case "id": R.ID = dmem.Data.Data.ToString(); OSHConsole.WriteLine(">" + dmem.Name + "= " + dmem.Data.Data.ToString()); break;
- case "title": R.Title = dmem.Data.Data.ToString(); OSHConsole.WriteLine(">" + dmem.Name + "= " + dmem.Data.Data.ToString()); break;
- case "year": R.Year = dmem.Data.Data.ToString(); OSHConsole.WriteLine(">" + dmem.Name + "= " + dmem.Data.Data.ToString()); break;
- case "cover": R.CoverLink = dmem.Data.Data.ToString(); OSHConsole.WriteLine(">" + dmem.Name + "= " + dmem.Data.Data.ToString()); break;
- case "duration": R.Duration = dmem.Data.Data.ToString(); OSHConsole.WriteLine(">" + dmem.Name + "= " + dmem.Data.Data.ToString()); break;
- case "tagline": R.Tagline = dmem.Data.Data.ToString(); OSHConsole.WriteLine(">" + dmem.Name + "= " + dmem.Data.Data.ToString()); break;
- case "plot": R.Plot = dmem.Data.Data.ToString(); OSHConsole.WriteLine(">" + dmem.Name + "= " + dmem.Data.Data.ToString()); break;
- case "goofs": R.Goofs = dmem.Data.Data.ToString(); OSHConsole.WriteLine(">" + dmem.Name + "= " + dmem.Data.Data.ToString()); break;
- case "trivia": R.Trivia = dmem.Data.Data.ToString(); OSHConsole.WriteLine(">" + dmem.Name + "= " + dmem.Data.Data.ToString()); break;
- case "cast":
- // this is another struct with cast members...
- OSHConsole.WriteLine(">" + dmem.Name + "= ");
- var castStruct = (XmlRpcValueStruct)dmem.Data;
- foreach (XmlRpcStructMember castMemeber in castStruct.Members)
- {
- R.Cast.Add(castMemeber.Data.Data.ToString());
- OSHConsole.WriteLine(" >" + castMemeber.Data.Data.ToString());
- }
- break;
- case "directors":
- OSHConsole.WriteLine(">" + dmem.Name + "= ");
- // this is another struct with directors members...
- var directorsStruct = (XmlRpcValueStruct)dmem.Data;
- foreach (XmlRpcStructMember directorsMember in directorsStruct.Members)
- {
- R.Directors.Add(directorsMember.Data.Data.ToString());
- OSHConsole.WriteLine(" >" + directorsMember.Data.Data.ToString());
- }
- break;
- case "writers":
- OSHConsole.WriteLine(">" + dmem.Name + "= ");
- // this is another struct with writers members...
- var writersStruct = (XmlRpcValueStruct)dmem.Data;
- foreach (XmlRpcStructMember writersMember in writersStruct.Members)
- {
- R.Writers.Add(writersMember.Data.Data.ToString());
- OSHConsole.WriteLine("+->" + writersMember.Data.Data.ToString());
- }
- break;
- case "awards":
- // this is an array of genres...
- var awardsArray = (XmlRpcValueArray)dmem.Data;
- foreach (XmlRpcValueBasic award in awardsArray.Values)
- {
- R.Awards.Add(award.Data.ToString());
- OSHConsole.WriteLine(" >" + award.Data.ToString());
- }
- break;
- case "genres":
- OSHConsole.WriteLine(">" + dmem.Name + "= ");
- // this is an array of genres...
- var genresArray = (XmlRpcValueArray)dmem.Data;
- foreach (XmlRpcValueBasic genre in genresArray.Values)
- {
- R.Genres.Add(genre.Data.ToString());
- OSHConsole.WriteLine(" >" + genre.Data.ToString());
- }
- break;
- case "country":
- OSHConsole.WriteLine(">" + dmem.Name + "= ");
- // this is an array of country...
- var countryArray = (XmlRpcValueArray)dmem.Data;
- foreach (XmlRpcValueBasic country in countryArray.Values)
- {
- R.Country.Add(country.Data.ToString());
- OSHConsole.WriteLine(" >" + country.Data.ToString());
- }
- break;
- case "language":
- OSHConsole.WriteLine(">" + dmem.Name + "= ");
- // this is an array of language...
- var languageArray = (XmlRpcValueArray)dmem.Data;
- foreach (XmlRpcValueBasic language in languageArray.Values)
- {
- R.Language.Add(language.Data.ToString());
- OSHConsole.WriteLine(" >" + language.Data.ToString());
- }
- break;
- case "certification":
- OSHConsole.WriteLine(">" + dmem.Name + "= ");
- // this is an array of certification...
- var certificationArray = (XmlRpcValueArray)dmem.Data;
- foreach (XmlRpcValueBasic certification in certificationArray.Values)
- {
- R.Certification.Add(certification.Data.ToString());
- OSHConsole.WriteLine(" >" + certification.Data.ToString());
- }
- break;
- }
- }
- }
- else// Unknown data ?
- {
- OSHConsole.WriteLine("Data= " + MEMBER.Data.Data.ToString(), DebugCode.Warning);
- }
- }
- }
- // Return the response to user !!
- return R;
- }
- }
- }
- else
- {
- OSHConsole.WriteLine(response, DebugCode.Error);
- return new MethodResponseError("Fail", response);
- }
- return new MethodResponseError("Fail", "GetIMDBMovieDetails call failed !");
- }
- /// <summary>
- /// Allows registered users to insert new movies (not stored in IMDb) to the database.
- /// </summary>
- /// <param name="movieName">Movie title </param>
- /// <param name="movieyear">Release year </param>
- /// <returns>Status of the call operation. If the call success the response will be 'MethodResponseInsertMovie'</returns>
- public static IMethodResponse InsertMovie(string movieName, string movieyear)
- {
- if (TOKEN == "")
- {
- OSHConsole.WriteLine("Can't do this call, 'token' value not set. Please use Log In method first.", DebugCode.Error);
- return new MethodResponseError("Fail", "Can't do this call, 'token' value not set. Please use Log In method first.");
- }
- // Method call ..
- var parms = new List<IXmlRpcValue>();
- // Add token param
- parms.Add(new XmlRpcValueBasic(TOKEN, XmlRpcBasicValueType.String));
- // Add movieinfo struct
- var movieinfo = new XmlRpcValueStruct(new List<XmlRpcStructMember>());
- movieinfo.Members.Add(new XmlRpcStructMember("moviename", new XmlRpcValueBasic(movieName)));
- movieinfo.Members.Add(new XmlRpcStructMember("movieyear", new XmlRpcValueBasic(movieyear)));
- parms.Add(movieinfo);
- // Call !
- var call = new XmlRpcMethodCall("InsertMovie", parms);
- OSHConsole.WriteLine("Sending InsertMovie request to the server ...", DebugCode.Good);
- // Send the request to the server
- string response = Utilities.GetStreamString(Utilities.SendRequest(XmlRpcGenerator.Generate(call), XML_PRC_USERAGENT));
- if (!response.Contains("ERROR:"))
- {
- // No error occur, get and decode the response.
- XmlRpcMethodCall[] calls = XmlRpcGenerator.DecodeMethodResponse(response);
- if (calls.Length > 0)
- {
- if (calls[0].Parameters.Count > 0)
- {
- var mainStruct = (XmlRpcValueStruct)calls[0].Parameters[0];
- // Create the response, we'll need it later
- var R = new MethodResponseInsertMovie();
-
- // To make sure response is not currepted by server, do it in loop
- foreach (XmlRpcStructMember MEMBER in mainStruct.Members)
- {
- if (MEMBER.Name == "status")
- {
- R.Status = (string)MEMBER.Data.Data;
- OSHConsole.WriteLine("Status= " + R.Status);
- }
- else if (MEMBER.Name == "seconds")
- {
- R.Seconds = (double)MEMBER.Data.Data;
- OSHConsole.WriteLine("Seconds= " + R.Seconds);
- }
- else if (MEMBER.Name == "id")
- {
- R.ID = (string)MEMBER.Data.Data;
- OSHConsole.WriteLine("ID= " + R.Seconds);
- }
- }
- // Return the response to user !!
- return R;
- }
- }
- }
- else
- {
- OSHConsole.WriteLine(response, DebugCode.Error);
- return new MethodResponseError("Fail", response);
- }
- return new MethodResponseError("Fail", "InsertMovie call failed !");
- }
- /// <summary>
- /// Inserts or updates data to tables, which are used for CheckMovieHash() and !CheckMovieHash2().
- /// </summary>
- /// <param name="parameters">The parameters</param>
- /// <returns>Status of the call operation. If the call success the response will be 'MethodResponseInsertMovieHash'</returns>
- public static IMethodResponse InsertMovieHash(InsertMovieHashParameters[] parameters)
- {
- if (TOKEN == "")
- {
- OSHConsole.WriteLine("Can't do this call, 'token' value not set. Please use Log In method first.", DebugCode.Error);
- return new MethodResponseError("Fail", "Can't do this call, 'token' value not set. Please use Log In method first.");
- }
- // Method call ..
- var parms = new List<IXmlRpcValue>();
- parms.Add(new XmlRpcValueBasic(TOKEN, XmlRpcBasicValueType.String));
- foreach (InsertMovieHashParameters p in parameters)
- {
- var pstruct = new XmlRpcValueStruct(new List<XmlRpcStructMember>());
- pstruct.Members.Add(new XmlRpcStructMember("moviehash", new XmlRpcValueBasic(p.moviehash)));
- pstruct.Members.Add(new XmlRpcStructMember("moviebytesize", new XmlRpcValueBasic(p.moviebytesize)));
- pstruct.Members.Add(new XmlRpcStructMember("imdbid", new XmlRpcValueBasic(p.imdbid)));
- pstruct.Members.Add(new XmlRpcStructMember("movietimems", new XmlRpcValueBasic(p.movietimems)));
- pstruct.Members.Add(new XmlRpcStructMember("moviefps", new XmlRpcValueBasic(p.moviefps)));
- pstruct.Members.Add(new XmlRpcStructMember("moviefilename", new XmlRpcValueBasic(p.moviefilename)));
- parms.Add(pstruct);
- }
- var call = new XmlRpcMethodCall("InsertMovieHash", parms);
-
- OSHConsole.WriteLine("Sending InsertMovieHash request to the server ...", DebugCode.Good);
- // Send the request to the server
- string response = Utilities.GetStreamString(Utilities.SendRequest(XmlRpcGenerator.Generate(call), XML_PRC_USERAGENT));
- if (!response.Contains("ERROR:"))
- {
- // No error occur, get and decode the response.
- XmlRpcMethodCall[] calls = XmlRpcGenerator.DecodeMethodResponse(response);
- if (calls.Length > 0)
- {
- if (calls[0].Parameters.Count > 0)
- {
- var mainStruct = (XmlRpcValueStruct)calls[0].Parameters[0];
- // Create the response, we'll need it later
- var R = new MethodResponseInsertMovieHash();
-
- // To make sure response is not currepted by server, do it in loop
- foreach (XmlRpcStructMember MEMBER in mainStruct.Members)
- {
- switch (MEMBER.Name)
- {
- case "status":
- R.Status = (string)MEMBER.Data.Data;
- OSHConsole.WriteLine(">" + MEMBER.Name + "= " + MEMBER.Data.Data.ToString());
- break;
- case "seconds":
- R.Seconds = (double)MEMBER.Data.Data;
- OSHConsole.WriteLine(">" + MEMBER.Name + "= " + MEMBER.Data.Data.ToString());
- break;
- case "data":
- var dataStruct = (XmlRpcValueStruct)MEMBER.Data;
- foreach (XmlRpcStructMember dataMember in dataStruct.Members)
- {
- switch (dataMember.Name)
- {
- case "accepted_moviehashes":
- var mh = (XmlRpcValueArray)dataMember.Data;
- foreach (IXmlRpcValue val in mh.Values)
- {
- if (val is XmlRpcValueBasic)
- {
- R.accepted_moviehashes.Add(val.Data.ToString());
- }
- }
- break;
- case "new_imdbs":
- var mi = (XmlRpcValueArray)dataMember.Data;
- foreach (IXmlRpcValue val in mi.Values)
- {
- if (val is XmlRpcValueBasic)
- {
- R.new_imdbs.Add(val.Data.ToString());
- }
- }
- break;
- }
- }
- break;
- }
- }
- // Return the response to user !!
- return R;
- }
- }
- }
- else
- {
- OSHConsole.WriteLine(response, DebugCode.Error);
- return new MethodResponseError("Fail", response);
- }
- return new MethodResponseError("Fail", "InsertMovieHash call failed !");
- }
- /*Reporting and rating*/
- /// <summary>
- /// Get basic server information and statistics
- /// </summary>
- /// <returns>Status of the call operation. If the call success the response will be 'MethodResponseServerInfo'</returns>
- public static IMethodResponse ServerInfo()
- {
- if (TOKEN == "")
- {
- OSHConsole.WriteLine("Can't do this call, 'token' value not set. Please use Log In method first.", DebugCode.Error);
- return new MethodResponseError("Fail", "Can't do this call, 'token' value not set. Please use Log In method first.");
- }
- // Method call ..
- var parms = new List<IXmlRpcValue>();
- parms.Add(new XmlRpcValueBasic(TOKEN, XmlRpcBasicValueType.String));
- parms.Add(new XmlRpcValueBasic(XML_PRC_USERAGENT, XmlRpcBasicValueType.String));
- var call = new XmlRpcMethodCall("ServerInfo", parms);
-
- OSHConsole.WriteLine("Sending ServerInfo request to the server ...", DebugCode.Good);
- // Send the request to the server
- string response = Utilities.GetStreamString(Utilities.SendRequest(XmlRpcGenerator.Generate(call), XML_PRC_USERAGENT));
- if (!response.Contains("ERROR:"))
- {
- // No error occur, get and decode the response.
- XmlRpcMethodCall[] calls = XmlRpcGenerator.DecodeMethodResponse(response);
- if (calls.Length > 0)
- {
- if (calls[0].Parameters.Count > 0)
- {
- var mainStruct = (XmlRpcValueStruct)calls[0].Parameters[0];
- // Create the response, we'll need it later
- var R = new MethodResponseServerInfo();
-
- // To make sure response is not currepted by server, do it in loop
- foreach (XmlRpcStructMember MEMBER in mainStruct.Members)
- {
- switch (MEMBER.Name)
- {
- case "status":
- R.Status = (string)MEMBER.Data.Data;
- OSHConsole.WriteLine(">" + MEMBER.Name + "= " + MEMBER.Data.Data.ToString());
- break;
- case "seconds":
- R.Seconds = (double)MEMBER.Data.Data;
- OSHConsole.WriteLine(">" + MEMBER.Name + "= " + MEMBER.Data.Data.ToString());
- break;
- case "xmlrpc_version":
- R.xmlrpc_version = (string)MEMBER.Data.Data;
- OSHConsole.WriteLine(">" + MEMBER.Name + "= " + MEMBER.Data.Data.ToString());
- break;
- case "xmlrpc_url":
- R.xmlrpc_url = (string)MEMBER.Data.Data;
- OSHConsole.WriteLine(">" + MEMBER.Name + "= " + MEMBER.Data.Data.ToString());
- break;
- case "application":
- R.application = (string)MEMBER.Data.Data;
- OSHConsole.WriteLine(">" + MEMBER.Name + "= " + MEMBER.Data.Data.ToString());
- break;
- case "contact":
- R.contact = (string)MEMBER.Data.Data;
- OSHConsole.WriteLine(">" + MEMBER.Name + "= " + MEMBER.Data.Data.ToString());
- break;
- case "website_url":
- R.website_url = (string)MEMBER.Data.Data;
- OSHConsole.WriteLine(">" + MEMBER.Name + "= " + MEMBER.Data.Data.ToString());
- break;
- case "users_online_total":
- R.users_online_total = (int)MEMBER.Data.Data;
- OSHConsole.WriteLine(">" + MEMBER.Name + "= " + MEMBER.Data.Data.ToString());
- break;
- case "users_online_program":
- R.users_online_program = (int)MEMBER.Data.Data;
- OSHConsole.WriteLine(">" + MEMBER.Name + "= " + MEMBER.Data.Data.ToString());
- break;
- case "users_loggedin":
- R.users_loggedin = (int)MEMBER.Data.Data;
- OSHConsole.WriteLine(">" + MEMBER.Name + "= " + MEMBER.Data.Data.ToString());
- break;
- case "users_max_alltime":
- R.users_max_alltime = (string)MEMBER.Data.Data;
- OSHConsole.WriteLine(">" + MEMBER.Name + "= " + MEMBER.Data.Data.ToString());
- break;
- case "users_registered":
- R.users_registered = (string)MEMBER.Data.Data;
- OSHConsole.WriteLine(">" + MEMBER.Name + "= " + MEMBER.Data.Data.ToString());
- break;
- case "subs_downloads":
- R.subs_downloads = (string)MEMBER.Data.Data;
- OSHConsole.WriteLine(">" + MEMBER.Name + "= " + MEMBER.Data.Data.ToString());
- break;
- case "subs_subtitle_files":
- R.subs_subtitle_files = (string)MEMBER.Data.Data;
- OSHConsole.WriteLine(">" + MEMBER.Name + "= " + MEMBER.Data.Data.ToString());
- break;
- case "movies_total":
- R.movies_total = (string)MEMBER.Data.Data;
- OSHConsole.WriteLine(">" + MEMBER.Name + "= " + MEMBER.Data.Data.ToString());
- break;
- case "movies_aka":
- R.movies_aka = (string)MEMBER.Data.Data;
- OSHConsole.WriteLine(">" + MEMBER.Name + "= " + MEMBER.Data.Data.ToString());
- break;
- case "total_subtitles_languages":
- R.total_subtitles_languages = (string)MEMBER.Data.Data;
- OSHConsole.WriteLine(">" + MEMBER.Name + "= " + MEMBER.Data.Data.ToString());
- break;
- case "last_update_strings":
- //R.total_subtitles_languages = (string)MEMBER.Data.Data;
- OSHConsole.WriteLine(">" + MEMBER.Name + ":");
- var luStruct = (XmlRpcValueStruct)MEMBER.Data;
- foreach (XmlRpcStructMember luMemeber in luStruct.Members)
- {
- R.last_update_strings.Add(luMemeber.Name + " [" + luMemeber.Data.Data.ToString() + "]");
- OSHConsole.WriteLine(" >" + luMemeber.Name + "= " + luMemeber.Data.Data.ToString());
- }
- break;
- }
- }
- // Return the response to user !!
- return R;
- }
- }
- }
- else
- {
- OSHConsole.WriteLine(response, DebugCode.Error);
- return new MethodResponseError("Fail", response);
- }
- return new MethodResponseError("Fail", "ServerInfo call failed !");
- }
- /// <summary>
- /// Report wrong subtitle file <--> video file combination
- /// </summary>
- /// <param name="IDSubMovieFile">Identifier of the subtitle file <--> video file combination </param>
- /// <returns>Status of the call operation. If the call success the response will be 'MethodResponseReportWrongMovieHash'</returns>
- public static IMethodResponse ReportWrongMovieHash(string IDSubMovieFile)
- {
- if (TOKEN == "")
- {
- OSHConsole.WriteLine("Can't do this call, 'token' value not set. Please use Log In method first.", DebugCode.Error);
- return new MethodResponseError("Fail", "Can't do this call, 'token' value not set. Please use Log In method first.");
- }
- // Method call ..
- var parms = new List<IXmlRpcValue>();
- parms.Add(new XmlRpcValueBasic(TOKEN, XmlRpcBasicValueType.String));
- parms.Add(new XmlRpcValueBasic(IDSubMovieFile, XmlRpcBasicValueType.String));
- var call = new XmlRpcMethodCall("ReportWrongMovieHash", parms);
-
- OSHConsole.WriteLine("Sending ReportWrongMovieHash request to the server ...", DebugCode.Good);
- // Send the request to the server
- string response = Utilities.GetStreamString(Utilities.SendRequest(XmlRpcGenerator.Generate(call), XML_PRC_USERAGENT));
- if (!response.Contains("ERROR:"))
- {
- // No error occur, get and decode the response.
- XmlRpcMethodCall[] calls = XmlRpcGenerator.DecodeMethodResponse(response);
- if (calls.Length > 0)
- {
- if (calls[0].Parameters.Count > 0)
- {
- var mainStruct = (XmlRpcValueStruct)calls[0].Parameters[0];
- // Create the response, we'll need it later
- var R = new MethodResponseReportWrongMovieHash();
-
- // To make sure response is not currepted by server, do it in loop
- foreach (XmlRpcStructMember MEMBER in mainStruct.Members)
- {
- switch (MEMBER.Name)
- {
- case "status":
- R.Status = (string)MEMBER.Data.Data;
- OSHConsole.WriteLine(">" + MEMBER.Name + "= " + MEMBER.Data.Data.ToString());
- break;
- case "seconds":
- R.Seconds = (double)MEMBER.Data.Data;
- OSHConsole.WriteLine(">" + MEMBER.Name + "= " + MEMBER.Data.Data.ToString());
- break;
- }
- }
- // Return the response to user !!
- return R;
- }
- }
- }
- else
- {
- OSHConsole.WriteLine(response, DebugCode.Error);
- return new MethodResponseError("Fail", response);
- }
- return new MethodResponseError("Fail", "ReportWrongMovieHash call failed !");
- }
- /// <summary>
- /// This method is needed to report bad movie hash for imdbid. This method should be used for correcting wrong entries,
- /// when using CheckMovieHash2. Pass moviehash and moviebytesize for file, and imdbid as new, corrected one IMDBID
- /// (id number without trailing zeroes). After some reports, moviehash will be linked to new imdbid.
- /// </summary>
- /// <param name="moviehash">The movie hash</param>
- /// <param name="moviebytesize">The movie size in bytes</param>
- /// <param name="imdbid">The movie imbid</param>
- /// <returns>Status of the call operation. If the call success the response will be 'MethodResponseReportWrongImdbMovie'</returns>
- public static IMethodResponse ReportWrongImdbMovie(string moviehash, string moviebytesize, string imdbid)
- {
- if (TOKEN == "")
- {
- OSHConsole.WriteLine("Can't do this call, 'token' value not set. Please use Log In method first.", DebugCode.Error);
- return new MethodResponseError("Fail", "Can't do this call, 'token' value not set. Please use Log In method first.");
- }
- // Method call ..
- var parms = new List<IXmlRpcValue>();
- parms.Add(new XmlRpcValueBasic(TOKEN, XmlRpcBasicValueType.String));
- var s = new XmlRpcValueStruct(new List<XmlRpcStructMember>());
- s.Members.Add(new XmlRpcStructMember("moviehash", new XmlRpcValueBasic(moviehash)));
- s.Members.Add(new XmlRpcStructMember("moviebytesize", new XmlRpcValueBasic(moviebytesize)));
- s.Members.Add(new XmlRpcStructMember("imdbid", new XmlRpcValueBasic(imdbid)));
- parms.Add(s);
- var call = new XmlRpcMethodCall("ReportWrongImdbMovie", parms);
-
- OSHConsole.WriteLine("Sending ReportWrongImdbMovie request to the server ...", DebugCode.Good);
- // Send the request to the server
- string response = Utilities.GetStreamString(Utilities.SendRequest(XmlRpcGenerator.Generate(call), XML_PRC_USERAGENT));
- if (!response.Contains("ERROR:"))
- {
- // No error occur, get and decode the response.
- XmlRpcMethodCall[] calls = XmlRpcGenerator.DecodeMethodResponse(response);
- if (calls.Length > 0)
- {
- if (calls[0].Parameters.Count > 0)
- {
- var mainStruct = (XmlRpcValueStruct)calls[0].Parameters[0];
- // Create the response, we'll need it later
- var R = new MethodResponseAddComment();
-
- // To make sure response is not currepted by server, do it in loop
- foreach (XmlRpcStructMember MEMBER in mainStruct.Members)
- {
- switch (MEMBER.Name)
- {
- case "status": R.Status = (string)MEMBER.Data.Data; OSHConsole.WriteLine(">" + MEMBER.Name + "= " + MEMBER.Data.Data.ToString()); break;
- case "seconds": R.Seconds = (double)MEMBER.Data.Data; OSHConsole.WriteLine(">" + MEMBER.Name + "= " + MEMBER.Data.Data.ToString()); break;
- }
- }
- // Return the response to user !!
- return R;
- }
- }
- }
- else
- {
- OSHConsole.WriteLine(response, DebugCode.Error);
- return new MethodResponseError("Fail", response);
- }
- return new MethodResponseError("Fail", "ReportWrongImdbMovie call failed !");
- }
- /// <summary>
- /// Rate subtitles
- /// </summary>
- /// <param name="idsubtitle">Id of subtitle (NOT subtitle file) user wants to rate </param>
- /// <param name="score">Subtitle rating, must be in interval 1 (worst) to 10 (best). </param>
- /// <returns>Status of the call operation. If the call success the response will be 'MethodResponseSubtitlesVote'</returns>
- public static IMethodResponse SubtitlesVote(int idsubtitle, int score)
- {
- if (TOKEN == "")
- {
- OSHConsole.WriteLine("Can't do this call, 'token' value not set. Please use Log In method first.", DebugCode.Error);
- return new MethodResponseError("Fail", "Can't do this call, 'token' value not set. Please use Log In method first.");
- }
- // Method call ..
- var parms = new List<IXmlRpcValue>();
- parms.Add(new XmlRpcValueBasic(TOKEN, XmlRpcBasicValueType.String));
- var s = new XmlRpcValueStruct(new List<XmlRpcStructMember>());
- s.Members.Add(new XmlRpcStructMember("idsubtitle", new XmlRpcValueBasic(idsubtitle)));
- s.Members.Add(new XmlRpcStructMember("score", new XmlRpcValueBasic(score)));
- parms.Add(s);
- var call = new XmlRpcMethodCall("SubtitlesVote", parms);
-
- OSHConsole.WriteLine("Sending SubtitlesVote request to the server ...", DebugCode.Good);
- // Send the request to the server
- string response = Utilities.GetStreamString(Utilities.SendRequest(XmlRpcGenerator.Generate(call), XML_PRC_USERAGENT));
- if (!response.Contains("ERROR:"))
- {
- // No error occur, get and decode the response.
- XmlRpcMethodCall[] calls = XmlRpcGenerator.DecodeMethodResponse(response);
- if (calls.Length > 0)
- {
- if (calls[0].Parameters.Count > 0)
- {
- var mainStruct = (XmlRpcValueStruct)calls[0].Parameters[0];
- // Create the response, we'll need it later
- var R = new MethodResponseSubtitlesVote();
-
- // To make sure response is not currepted by server, do it in loop
- foreach (XmlRpcStructMember MEMBER in mainStruct.Members)
- {
- switch (MEMBER.Name)
- {
- case "status": R.Status = (string)MEMBER.Data.Data; OSHConsole.WriteLine(">" + MEMBER.Name + "= " + MEMBER.Data.Data.ToString()); break;
- case "seconds": R.Seconds = (double)MEMBER.Data.Data; OSHConsole.WriteLine(">" + MEMBER.Name + "= " + MEMBER.Data.Data.ToString()); break;
- case "data":
- var dataStruct = (XmlRpcValueStruct)MEMBER.Data;
- foreach (XmlRpcStructMember dataMemeber in dataStruct.Members)
- {
- OSHConsole.WriteLine(" >" + dataMemeber.Name + "= " + dataMemeber.Data.Data.ToString());
- switch (dataMemeber.Name)
- {
- case "SubRating": R.SubRating = dataMemeber.Data.Data.ToString(); break;
- case "SubSumVotes": R.SubSumVotes = dataMemeber.Data.Data.ToString(); break;
- case "IDSubtitle": R.IDSubtitle = dataMemeber.Data.Data.ToString(); break;
- }
- }
- break;
- }
- }
- // Return the response to user !!
- return R;
- }
- }
- }
- else
- {
- OSHConsole.WriteLine(response, DebugCode.Error);
- return new MethodResponseError("Fail", response);
- }
- return new MethodResponseError("Fail", "SubtitlesVote call failed !");
- }
- /// <summary>
- /// Add comment to a subtitle
- /// </summary>
- /// <param name="idsubtitle">Subtitle identifier (BEWARE! this is not the ID of subtitle file but of the whole subtitle (a subtitle can contain multiple subtitle files))</param>
- /// <param name="comment">User's comment</param>
- /// <param name="badsubtitle">Optional parameter. If set to 1, subtitles are marked as bad.</param>
- /// <returns>Status of the call operation. If the call success the response will be 'MethodResponseAddComment'</returns>
- public static IMethodResponse AddComment(int idsubtitle, string comment, int badsubtitle)
- {
- if (TOKEN == "")
- {
- OSHConsole.WriteLine("Can't do this call, 'token' value not set. Please use Log In method first.", DebugCode.Error);
- return new MethodResponseError("Fail", "Can't do this call, 'token' value not set. Please use Log In method first.");
- }
- // Method call ..
- var parms = new List<IXmlRpcValue>();
- parms.Add(new XmlRpcValueBasic(TOKEN, XmlRpcBasicValueType.String));
- var s = new XmlRpcValueStruct(new List<XmlRpcStructMember>());
- s.Members.Add(new XmlRpcStructMember("idsubtitle", new XmlRpcValueBasic(idsubtitle)));
- s.Members.Add(new XmlRpcStructMember("comment", new XmlRpcValueBasic(comment)));
- s.Members.Add(new XmlRpcStructMember("badsubtitle", new XmlRpcValueBasic(badsubtitle)));
- parms.Add(s);
- var call = new XmlRpcMethodCall("AddComment", parms);
-
- OSHConsole.WriteLine("Sending AddComment request to the server ...", DebugCode.Good);
- // Send the request to the server
- string response = Utilities.GetStreamString(Utilities.SendRequest(XmlRpcGenerator.Generate(call), XML_PRC_USERAGENT));
- if (!response.Contains("ERROR:"))
- {
- // No error occur, get and decode the response.
- XmlRpcMethodCall[] calls = XmlRpcGenerator.DecodeMethodResponse(response);
- if (calls.Length > 0)
- {
- if (calls[0].Parameters.Count > 0)
- {
- var mainStruct = (XmlRpcValueStruct)calls[0].Parameters[0];
- // Create the response, we'll need it later
- var R = new MethodResponseAddComment();
-
- // To make sure response is not currepted by server, do it in loop
- foreach (var MEMBER in mainStruct.Members)
- {
- switch (MEMBER.Name)
- {
- case "status": R.Status = (string)MEMBER.Data.Data; OSHConsole.WriteLine(">" + MEMBER.Name + "= " + MEMBER.Data.Data.ToString()); break;
- case "seconds": R.Seconds = (double)MEMBER.Data.Data; OSHConsole.WriteLine(">" + MEMBER.Name + "= " + MEMBER.Data.Data.ToString()); break;
- }
- }
- // Return the response to user !!
- return R;
- }
- }
- }
- else
- {
- OSHConsole.WriteLine(response, DebugCode.Error);
- return new MethodResponseError("Fail", response);
- }
- return new MethodResponseError("Fail", "AddComment call failed !");
- }
- /// <summary>
- /// Add new request for subtitles, user must be logged in
- /// </summary>
- /// <param name="sublanguageid">The subtitle language id 3 length</param>
- /// <param name="idmovieimdb">http://www.imdb.com/</param>
- /// <param name="comment">The comment</param>
- /// <returns>Status of the call operation. If the call success the response will be 'MethodResponseAddRequest'</returns>
- public static IMethodResponse AddRequest(string sublanguageid, string idmovieimdb, string comment)
- {
- if (TOKEN == "")
- {
- OSHConsole.WriteLine("Can't do this call, 'token' value not set. Please use Log In method first.", DebugCode.Error);
- return new MethodResponseError("Fail", "Can't do this call, 'token' value not set. Please use Log In method first.");
- }
- // Method call ..
- var parms = new List<IXmlRpcValue>();
- parms.Add(new XmlRpcValueBasic(TOKEN, XmlRpcBasicValueType.String));
- var s = new XmlRpcValueStruct(new List<XmlRpcStructMember>());
- s.Members.Add(new XmlRpcStructMember("sublanguageid", new XmlRpcValueBasic(sublanguageid)));
- s.Members.Add(new XmlRpcStructMember("idmovieimdb", new XmlRpcValueBasic(idmovieimdb)));
- s.Members.Add(new XmlRpcStructMember("comment", new XmlRpcValueBasic(comment)));
- parms.Add(s);
- var call = new XmlRpcMethodCall("AddRequest", parms);
-
- OSHConsole.WriteLine("Sending AddRequest request to the server ...", DebugCode.Good);
- // Send the request to the server
- string response = Utilities.GetStreamString(Utilities.SendRequest(XmlRpcGenerator.Generate(call), XML_PRC_USERAGENT));
- if (!response.Contains("ERROR:"))
- {
- // No error occur, get and decode the response.
- XmlRpcMethodCall[] calls = XmlRpcGenerator.DecodeMethodResponse(response);
- if (calls.Length > 0)
- {
- if (calls[0].Parameters.Count > 0)
- {
- var mainStruct = (XmlRpcValueStruct)calls[0].Parameters[0];
- // Create the response, we'll need it later
- var R = new MethodResponseAddRequest();
-
- // To make sure response is not currepted by server, do it in loop
- foreach (XmlRpcStructMember MEMBER in mainStruct.Members)
- {
- switch (MEMBER.Name)
- {
- case "status": R.Status = (string)MEMBER.Data.Data; OSHConsole.WriteLine(">" + MEMBER.Name + "= " + MEMBER.Data.Data.ToString()); break;
- case "seconds": R.Seconds = (double)MEMBER.Data.Data; OSHConsole.WriteLine(">" + MEMBER.Name + "= " + MEMBER.Data.Data.ToString()); break;
- case "data":
- var dataStruct = (XmlRpcValueStruct)MEMBER.Data;
- foreach (XmlRpcStructMember dataMemeber in dataStruct.Members)
- {
- switch (dataMemeber.Name)
- {
- case "request_url": R.request_url = dataMemeber.Data.Data.ToString(); OSHConsole.WriteLine(">" + dataMemeber.Name + "= " + dataMemeber.Data.Data.ToString()); break;
- }
- }
- break;
- }
- }
- // Return the response to user !!
- return R;
- }
- }
- }
- else
- {
- OSHConsole.WriteLine(response, DebugCode.Error);
- return new MethodResponseError("Fail", response);
- }
- return new MethodResponseError("Fail", "AddRequest call failed !");
- }
- /*User interface*/
- /// <summary>
- /// Get list of supported subtitle languages
- /// </summary>
- /// <param name="language">ISO639-1 2-letter language code of user's interface language. </param>
- /// <returns>Status of the call operation. If the call success the response will be 'MethodResponseGetSubLanguages'</returns>
- public static IMethodResponse GetSubLanguages(string language)
- {
- if (TOKEN == "")
- {
- OSHConsole.WriteLine("Can't do this call, 'token' value not set. Please use Log In method first.", DebugCode.Error);
- return new MethodResponseError("Fail", "Can't do this call, 'token' value not set. Please use Log In method first.");
- }
- // Method call ..
- var parms = new List<IXmlRpcValue>();
- parms.Add(new XmlRpcValueBasic(TOKEN));
- parms.Add(new XmlRpcValueBasic(language));
- var call = new XmlRpcMethodCall("GetSubLanguages", parms);
-
- OSHConsole.WriteLine("Sending GetSubLanguages request to the server ...", DebugCode.Good);
- // Send the request to the server
- string response = Utilities.GetStreamString(Utilities.SendRequest(XmlRpcGenerator.Generate(call), XML_PRC_USERAGENT));
- if (!response.Contains("ERROR:"))
- {
- // No error occur, get and decode the response.
- XmlRpcMethodCall[] calls = XmlRpcGenerator.DecodeMethodResponse(response);
- if (calls.Length > 0)
- {
- if (calls[0].Parameters.Count > 0)
- {
- var mainStruct = (XmlRpcValueStruct)calls[0].Parameters[0];
- // Create the response, we'll need it later
- var R = new MethodResponseGetSubLanguages();
-
- // To make sure response is not currepted by server, do it in loop
- foreach (XmlRpcStructMember MEMBER in mainStruct.Members)
- {
- switch (MEMBER.Name)
- {
- case "status": R.Status = (string)MEMBER.Data.Data; OSHConsole.WriteLine(">" + MEMBER.Name + "= " + MEMBER.Data.Data.ToString()); break;
- case "seconds": R.Seconds = (double)MEMBER.Data.Data; OSHConsole.WriteLine(">" + MEMBER.Name + "= " + MEMBER.Data.Data.ToString()); break;
- case "data":// array of structs
- var array = (XmlRpcValueArray)MEMBER.Data;
- foreach (IXmlRpcValue value in array.Values)
- {
- if (value is XmlRpcValueStruct)
- {
- var valueStruct = (XmlRpcValueStruct)value;
- var lang = new SubtitleLanguage();
- OSHConsole.WriteLine(">SubLanguage:");
- foreach (XmlRpcStructMember langMemeber in valueStruct.Members)
- {
- OSHConsole.WriteLine(" >" + langMemeber.Name + "= " + langMemeber.Data.Data.ToString());
- switch (langMemeber.Name)
- {
- case "SubLanguageID": lang.SubLanguageID = langMemeber.Data.Data.ToString(); break;
- case "LanguageName": lang.LanguageName = langMemeber.Data.Data.ToString(); break;
- case "ISO639": lang.ISO639 = langMemeber.Data.Data.ToString(); break;
- }
- }
- R.Languages.Add(lang);
- }
- else
- {
- OSHConsole.WriteLine(">" + MEMBER.Name + "= " +
- MEMBER.Data.Data.ToString() + " [Struct expected !]", DebugCode.Warning);
- }
- }
- break;
- }
- }
- // Return the response to user !!
- return R;
- }
- }
- }
- else
- {
- OSHConsole.WriteLine(response, DebugCode.Error);
- return new MethodResponseError("Fail", response);
- }
- return new MethodResponseError("Fail", "GetSubLanguages call failed !");
- }
- /// <summary>
- /// Detect language for given strings
- /// </summary>
- /// <param name="texts">Array of strings you want language detected for</param>
- /// <param name="encodingUsed">The encoding that will be used to get buffer of given strings. (this is not OS official parameter)</param>
- /// <returns>Status of the call operation. If the call success the response will be 'MethodResponseDetectLanguage'</returns>
- public static IMethodResponse DetectLanguage(string[] texts, Encoding encodingUsed)
- {
- if (TOKEN == "")
- {
- OSHConsole.WriteLine("Can't do this call, 'token' value not set. Please use Log In method first.", DebugCode.Error);
- return new MethodResponseError("Fail", "Can't do this call, 'token' value not set. Please use Log In method first.");
- }
- // Method call ..
- var parms = new List<IXmlRpcValue>();
- parms.Add(new XmlRpcValueBasic(TOKEN, XmlRpcBasicValueType.String));
- // We need to gzip texts then code them with base 24
- var decodedTexts = new List<string>();
- foreach (string text in texts)
- {
- // compress
- Stream str = new MemoryStream();
- byte[] stringData = encodingUsed.GetBytes(text);
- str.Write(stringData, 0, stringData.Length);
- str.Position = 0;
- byte[] data = Utilities.Compress(str);
- //base 64
- decodedTexts.Add(Convert.ToBase64String(data));
- }
- parms.Add(new XmlRpcValueArray(decodedTexts.ToArray()));
- var call = new XmlRpcMethodCall("DetectLanguage", parms);
-
- OSHConsole.WriteLine("Sending DetectLanguage request to the server ...", DebugCode.Good);
- // Send the request to the server
- string response = Utilities.GetStreamString(Utilities.SendRequest(XmlRpcGenerator.Generate(call), XML_PRC_USERAGENT));
- if (!response.Contains("ERROR:"))
- {
- // No error occur, get and decode the response.
- XmlRpcMethodCall[] calls = XmlRpcGenerator.DecodeMethodResponse(response);
- if (calls.Length > 0)
- {
- if (calls[0].Parameters.Count > 0)
- {
- var mainStruct = (XmlRpcValueStruct)calls[0].Parameters[0];
- // Create the response, we'll need it later
- var R = new MethodResponseDetectLanguage();
-
- // To make sure response is not currepted by server, do it in loop
- foreach (XmlRpcStructMember MEMBER in mainStruct.Members)
- {
- switch (MEMBER.Name)
- {
- case "status": R.Status = (string)MEMBER.Data.Data; OSHConsole.WriteLine(">" + MEMBER.Name + "= " + MEMBER.Data.Data.ToString()); break;
- case "seconds": R.Seconds = (double)MEMBER.Data.Data; OSHConsole.WriteLine(">" + MEMBER.Name + "= " + MEMBER.Data.Data.ToString()); break;
- case "data":
- if (MEMBER.Data is XmlRpcValueStruct)
- {
- OSHConsole.WriteLine(">Languages:");
- var dataStruct = (XmlRpcValueStruct)MEMBER.Data;
- foreach (XmlRpcStructMember dataMember in dataStruct.Members)
- {
- var lang = new DetectLanguageResult();
- lang.InputSample = dataMember.Name;
- lang.LanguageID = dataMember.Data.Data.ToString();
- R.Results.Add(lang);
- OSHConsole.WriteLine(" >" + dataMember.Name + " (" + dataMember.Data.Data.ToString() + ")");
- }
- }
- else
- {
- OSHConsole.WriteLine(">Languages ?? Struct expected but server return another type!!", DebugCode.Warning);
- }
- break;
- }
- }
- // Return the response to user !!
- return R;
- }
- }
- }
- else
- {
- OSHConsole.WriteLine(response, DebugCode.Error);
- return new MethodResponseError("Fail", response);
- }
- return new MethodResponseError("Fail", "DetectLanguage call failed !");
- }
- /// <summary>
- /// Get available translations for given program
- /// </summary>
- /// <param name="program">Name of the program/client application you want translations for. Currently supported values: subdownloader, oscar</param>
- /// <returns>Status of the call operation. If the call success the response will be 'MethodResponseGetAvailableTranslations'</returns>
- public static IMethodResponse GetAvailableTranslations(string program)
- {
- if (TOKEN == "")
- {
- OSHConsole.WriteLine("Can't do this call, 'token' value not set. Please use Log In method first.", DebugCode.Error);
- return new MethodResponseError("Fail", "Can't do this call, 'token' value not set. Please use Log In method first.");
- }
- // Method call ..
- var parms = new List<IXmlRpcValue>();
- parms.Add(new XmlRpcValueBasic(TOKEN));
- parms.Add(new XmlRpcValueBasic(program));
- var call = new XmlRpcMethodCall("GetAvailableTranslations", parms);
-
- OSHConsole.WriteLine("Sending GetAvailableTranslations request to the server ...", DebugCode.Good);
- // Send the request to the server
- string response = Utilities.GetStreamString(Utilities.SendRequest(XmlRpcGenerator.Generate(call), XML_PRC_USERAGENT));
- if (!response.Contains("ERROR:"))
- {
- // No error occur, get and decode the response.
- XmlRpcMethodCall[] calls = XmlRpcGenerator.DecodeMethodResponse(response);
- if (calls.Length > 0)
- {
- if (calls[0].Parameters.Count > 0)
- {
- var mainStruct = (XmlRpcValueStruct)calls[0].Parameters[0];
- // Create the response, we'll need it later
- var R = new MethodResponseGetAvailableTranslations();
-
- // To make sure response is not currepted by server, do it in loop
- foreach (XmlRpcStructMember MEMBER in mainStruct.Members)
- {
- switch (MEMBER.Name)
- {
- case "status": R.Status = (string)MEMBER.Data.Data; OSHConsole.WriteLine(">" + MEMBER.Name + "= " + MEMBER.Data.Data.ToString()); break;
- case "seconds": R.Seconds = (double)MEMBER.Data.Data; OSHConsole.WriteLine(">" + MEMBER.Name + "= " + MEMBER.Data.Data.ToString()); break;
- case "data":
- var dataStruct = (XmlRpcValueStruct)MEMBER.Data;
- OSHConsole.WriteLine(">data:");
- foreach (XmlRpcStructMember dataMember in dataStruct.Members)
- {
- if (dataMember.Data is XmlRpcValueStruct)
- {
- var resStruct = (XmlRpcValueStruct)dataMember.Data;
- var res = new GetAvailableTranslationsResult();
- res.LanguageID = dataMember.Name;
- OSHConsole.WriteLine(" >LanguageID: " + dataMember.Name);
- foreach (XmlRpcStructMember resMember in resStruct.Members)
- {
- switch (resMember.Name)
- {
- case "LastCreated": res.LastCreated = resMember.Data.Data.ToString(); OSHConsole.WriteLine(" >" + resMember.Name + "= " + resMember.Data.Data.ToString()); break;
- case "StringsNo": res.StringsNo = resMember.Data.Data.ToString(); OSHConsole.WriteLine(" >" + resMember.Name + "= " + resMember.Data.Data.ToString()); break;
- }
- R.Results.Add(res);
- }
- }
- else
- {
- OSHConsole.WriteLine(" >Struct expected !!", DebugCode.Warning);
- }
- }
- break;
- }
- }
- // Return the response to user !!
- return R;
- }
- }
- }
- else
- {
- OSHConsole.WriteLine(response, DebugCode.Error);
- return new MethodResponseError("Fail", response);
- }
- return new MethodResponseError("Fail", "GetAvailableTranslations call failed !");
- }
- /// <summary>
- /// Get a translation for given program and language
- /// </summary>
- /// <param name="iso639">language ​ISO639-1 2-letter code </param>
- /// <param name="format">available formats: [gnugettext compatible: mo, po] and [additional: txt, xml]</param>
- /// <param name="program">Name of the program/client application you want translations for. (currently supported values: subdownloader, oscar)</param>
- /// <returns>Status of the call operation. If the call success the response will be 'MethodResponseGetTranslation'</returns>
- public static IMethodResponse GetTranslation(string iso639, string format, string program)
- {
- if (TOKEN == "")
- {
- OSHConsole.WriteLine("Can't do this call, 'token' value not set. Please use Log In method first.", DebugCode.Error);
- return new MethodResponseError("Fail", "Can't do this call, 'token' value not set. Please use Log In method first.");
- }
- // Method call ..
- var parms = new List<IXmlRpcValue>();
- parms.Add(new XmlRpcValueBasic(TOKEN));
- parms.Add(new XmlRpcValueBasic(iso639));
- parms.Add(new XmlRpcValueBasic(format));
- parms.Add(new XmlRpcValueBasic(program));
- var call = new XmlRpcMethodCall("GetTranslation", parms);
-
- OSHConsole.WriteLine("Sending GetTranslation request to the server ...", DebugCode.Good);
- // Send the request to the server
- //File.WriteAllText(".\\REQUEST_GetTranslation.xml", Encoding.ASCII.GetString(XmlRpcGenerator.Generate(call)));
- string response = Utilities.GetStreamString(Utilities.SendRequest(XmlRpcGenerator.Generate(call), XML_PRC_USERAGENT));
- if (!response.Contains("ERROR:"))
- {
- // No error occur, get and decode the response.
- XmlRpcMethodCall[] calls = XmlRpcGenerator.DecodeMethodResponse(response);
- if (calls.Length > 0)
- {
- if (calls[0].Parameters.Count > 0)
- {
- var mainStruct = (XmlRpcValueStruct)calls[0].Parameters[0];
- // Create the response, we'll need it later
- var R = new MethodResponseGetTranslation();
-
- // To make sure response is not currepted by server, do it in loop
- foreach (XmlRpcStructMember MEMBER in mainStruct.Members)
- {
- switch (MEMBER.Name)
- {
- case "status": R.Status = (string)MEMBER.Data.Data; OSHConsole.WriteLine(">" + MEMBER.Name + "= " + MEMBER.Data.Data.ToString()); break;
- case "seconds": R.Seconds = (double)MEMBER.Data.Data; OSHConsole.WriteLine(">" + MEMBER.Name + "= " + MEMBER.Data.Data.ToString()); break;
- case "data": R.ContentData = (string)MEMBER.Data.Data; OSHConsole.WriteLine(">" + MEMBER.Name + "= " + MEMBER.Data.Data.ToString()); break;
- }
- }
- // Return the response to user !!
- return R;
- }
- }
- }
- else
- {
- OSHConsole.WriteLine(response, DebugCode.Error);
- return new MethodResponseError("Fail", response);
- }
- return new MethodResponseError("Fail", "GetTranslation call failed !");
- }
- /// <summary>
- /// Check for the latest version of given application
- /// </summary>
- /// <param name="program">name of the program/client application you want to check. (Currently supported values: subdownloader, oscar)</param>
- /// <returns>Status of the call operation. If the call success the response will be 'MethodResponseAutoUpdate'</returns>
- public static IMethodResponse AutoUpdate(string program)
- {
- /*if (TOKEN == "")
- {
- OSHConsole.WriteLine("Can't do this call, 'token' value not set. Please use Log In method first.", DebugCode.Error);
- return new MethodResponseError("Fail", "Can't do this call, 'token' value not set. Please use Log In method first.");
- }*/
- // Method call ..
- var parms = new List<IXmlRpcValue>();
- // parms.Add(new XmlRpcValueBasic(TOKEN));
- parms.Add(new XmlRpcValueBasic(program));
- // parms.Add(new XmlRpcValueBasic(XML_PRC_USERAGENT));
-
- var call = new XmlRpcMethodCall("AutoUpdate", parms);
- OSHConsole.WriteLine("Sending AutoUpdate request to the server ...", DebugCode.Good);
- // Send the request to the server
- string response = Utilities.GetStreamString(Utilities.SendRequest(XmlRpcGenerator.Generate(call), XML_PRC_USERAGENT));
- if (!response.Contains("ERROR:"))
- {
- // No error occur, get and decode the response.
- XmlRpcMethodCall[] calls = XmlRpcGenerator.DecodeMethodResponse(response);
- if (calls.Length > 0)
- {
- if (calls[0].Parameters.Count > 0)
- {
- var mainStruct = (XmlRpcValueStruct)calls[0].Parameters[0];
- // Create the response, we'll need it later
- var R = new MethodResponseAutoUpdate();
-
- // To make sure response is not currepted by server, do it in loop
- foreach (XmlRpcStructMember MEMBER in mainStruct.Members)
- {
- switch (MEMBER.Name)
- {
- case "status": R.Status = (string)MEMBER.Data.Data; OSHConsole.WriteLine(">" + MEMBER.Name + "= " + MEMBER.Data.Data.ToString()); break;
- case "seconds": R.Seconds = (double)MEMBER.Data.Data; OSHConsole.WriteLine(">" + MEMBER.Name + "= " + MEMBER.Data.Data.ToString()); break;
- case "version": R.version = (string)MEMBER.Data.Data; OSHConsole.WriteLine(">" + MEMBER.Name + "= " + MEMBER.Data.Data.ToString()); break;
- case "url_windows": R.url_windows = (string)MEMBER.Data.Data; OSHConsole.WriteLine(">" + MEMBER.Name + "= " + MEMBER.Data.Data.ToString()); break;
- case "url_linux": R.url_linux = (string)MEMBER.Data.Data; OSHConsole.WriteLine(">" + MEMBER.Name + "= " + MEMBER.Data.Data.ToString()); break;
- case "comments": R.comments = (string)MEMBER.Data.Data; OSHConsole.WriteLine(">" + MEMBER.Name + "= " + MEMBER.Data.Data.ToString()); break;
- }
- }
- // Return the response to user !!
- return R;
- }
- }
- }
- else
- {
- OSHConsole.WriteLine(response, DebugCode.Error);
- return new MethodResponseError("Fail", response);
- }
- return new MethodResponseError("Fail", "AutoUpdate call failed !");
- }
- /*Checking*/
- /// <summary>
- /// Check if video file hashes are already stored in the database
- /// </summary>
- /// <param name="hashes">Array of video file hashes</param>
- /// <returns>Status of the call operation. If the call success the response will be 'MethodResponseCheckMovieHash'</returns>
- public static IMethodResponse CheckMovieHash(string[] hashes)
- {
- if (TOKEN == "")
- {
- OSHConsole.WriteLine("Can't do this call, 'token' value not set. Please use Log In method first.", DebugCode.Error);
- return new MethodResponseError("Fail", "Can't do this call, 'token' value not set. Please use Log In method first.");
- }
- // Method call ..
- var parms = new List<IXmlRpcValue>();
- parms.Add(new XmlRpcValueBasic(TOKEN));
- parms.Add(new XmlRpcValueArray(hashes));
- var call = new XmlRpcMethodCall("CheckMovieHash", parms);
-
- OSHConsole.WriteLine("Sending CheckMovieHash request to the server ...", DebugCode.Good);
- // Send the request to the server
- string response = Utilities.GetStreamString(Utilities.SendRequest(XmlRpcGenerator.Generate(call), XML_PRC_USERAGENT));
- if (!response.Contains("ERROR:"))
- {
- // No error occur, get and decode the response.
- XmlRpcMethodCall[] calls = XmlRpcGenerator.DecodeMethodResponse(response);
- if (calls.Length > 0)
- {
- if (calls[0].Parameters.Count > 0)
- {
- var mainStruct = (XmlRpcValueStruct)calls[0].Parameters[0];
- // Create the response, we'll need it later
- var R = new MethodResponseCheckMovieHash();
-
- // To make sure response is not currepted by server, do it in loop
- foreach (XmlRpcStructMember MEMBER in mainStruct.Members)
- {
- switch (MEMBER.Name)
- {
- case "status": R.Status = (string)MEMBER.Data.Data; OSHConsole.WriteLine(">" + MEMBER.Name + "= " + MEMBER.Data.Data.ToString()); break;
- case "seconds": R.Seconds = (double)MEMBER.Data.Data; OSHConsole.WriteLine(">" + MEMBER.Name + "= " + MEMBER.Data.Data.ToString()); break;
- case "data":
- var dataStruct = (XmlRpcValueStruct)MEMBER.Data;
- OSHConsole.WriteLine(">Data:");
- foreach (XmlRpcStructMember dataMember in dataStruct.Members)
- {
- var res = new CheckMovieHashResult();
- res.Name = dataMember.Name;
- OSHConsole.WriteLine(" >" + res.Name + ":");
- var movieStruct = (XmlRpcValueStruct)dataMember.Data;
- foreach (XmlRpcStructMember movieMember in movieStruct.Members)
- {
- switch (movieMember.Name)
- {
- case "MovieHash": res.MovieHash = movieMember.Data.Data.ToString(); OSHConsole.WriteLine(" >" + movieMember.Name + "= " + movieMember.Data.Data.ToString()); break;
- case "MovieImdbID": res.MovieImdbID = movieMember.Data.Data.ToString(); OSHConsole.WriteLine(" >" + movieMember.Name + "= " + movieMember.Data.Data.ToString()); break;
- case "MovieName": res.MovieName = movieMember.Data.Data.ToString(); OSHConsole.WriteLine(" >" + movieMember.Name + "= " + movieMember.Data.Data.ToString()); break;
- case "MovieYear": res.MovieYear = movieMember.Data.Data.ToString(); OSHConsole.WriteLine(" >" + movieMember.Name + "= " + movieMember.Data.Data.ToString()); break;
- }
- }
- R.Results.Add(res);
- }
- break;
- }
- }
- // Return the response to user !!
- return R;
- }
- }
- }
- else
- {
- OSHConsole.WriteLine(response, DebugCode.Error);
- return new MethodResponseError("Fail", response);
- }
- return new MethodResponseError("Fail", "CheckMovieHash call failed !");
- }
- /// <summary>
- /// Check if video file hashes are already stored in the database. This method returns matching !MovieImdbID, MovieName, MovieYear, SeriesSeason, SeriesEpisode,
- /// MovieKind if available for each $moviehash, always sorted by SeenCount DESC.
- /// </summary>
- /// <param name="hashes">Array of video file hashes</param>
- /// <returns>Status of the call operation. If the call success the response will be 'MethodResponseCheckMovieHash2'</returns>
- public static IMethodResponse CheckMovieHash2(string[] hashes)
- {
- if (TOKEN == "")
- {
- OSHConsole.WriteLine("Can't do this call, 'token' value not set. Please use Log In method first.", DebugCode.Error);
- return new MethodResponseError("Fail", "Can't do this call, 'token' value not set. Please use Log In method first.");
- }
- // Method call ..
- var parms = new List<IXmlRpcValue>();
- parms.Add(new XmlRpcValueBasic(TOKEN));
- parms.Add(new XmlRpcValueArray(hashes));
- var call = new XmlRpcMethodCall("CheckMovieHash2", parms);
-
- OSHConsole.WriteLine("Sending CheckMovieHash2 request to the server ...", DebugCode.Good);
- // Send the request to the server
- string response = Utilities.GetStreamString(Utilities.SendRequest(XmlRpcGenerator.Generate(call), XML_PRC_USERAGENT));
- if (!response.Contains("ERROR:"))
- {
- // No error occur, get and decode the response.
- XmlRpcMethodCall[] calls = XmlRpcGenerator.DecodeMethodResponse(response);
- if (calls.Length > 0)
- {
- if (calls[0].Parameters.Count > 0)
- {
- var mainStruct = (XmlRpcValueStruct)calls[0].Parameters[0];
- // Create the response, we'll need it later
- var R = new MethodResponseCheckMovieHash2();
-
- // To make sure response is not currepted by server, do it in loop
- foreach (XmlRpcStructMember MEMBER in mainStruct.Members)
- {
- switch (MEMBER.Name)
- {
- case "status": R.Status = (string)MEMBER.Data.Data; OSHConsole.WriteLine(">" + MEMBER.Name + "= " + MEMBER.Data.Data.ToString()); break;
- case "seconds": R.Seconds = (double)MEMBER.Data.Data; OSHConsole.WriteLine(">" + MEMBER.Name + "= " + MEMBER.Data.Data.ToString()); break;
- case "data":
- var dataStruct = (XmlRpcValueStruct)MEMBER.Data;
- OSHConsole.WriteLine(">Data:");
- foreach (XmlRpcStructMember dataMember in dataStruct.Members)
- {
- var res = new CheckMovieHash2Result();
- res.Name = dataMember.Name;
- OSHConsole.WriteLine(" >" + res.Name + ":");
-
- var dataArray = (XmlRpcValueArray)dataMember.Data;
- foreach (XmlRpcValueStruct movieStruct in dataArray.Values)
- {
- var d = new CheckMovieHash2Data();
- foreach (XmlRpcStructMember movieMember in movieStruct.Members)
- {
- switch (movieMember.Name)
- {
- case "MovieHash": d.MovieHash = movieMember.Data.Data.ToString(); OSHConsole.WriteLine(" >" + movieMember.Name + "= " + movieMember.Data.Data.ToString()); break;
- case "MovieImdbID": d.MovieImdbID = movieMember.Data.Data.ToString(); OSHConsole.WriteLine(" >" + movieMember.Name + "= " + movieMember.Data.Data.ToString()); break;
- case "MovieName": d.MovieName = movieMember.Data.Data.ToString(); OSHConsole.WriteLine(" >" + movieMember.Name + "= " + movieMember.Data.Data.ToString()); break;
- case "MovieYear": d.MovieYear = movieMember.Data.Data.ToString(); OSHConsole.WriteLine(" >" + movieMember.Name + "= " + movieMember.Data.Data.ToString()); break;
- case "MovieKind": d.MovieKind = movieMember.Data.Data.ToString(); OSHConsole.WriteLine(" >" + movieMember.Name + "= " + movieMember.Data.Data.ToString()); break;
- case "SeriesSeason": d.SeriesSeason = movieMember.Data.Data.ToString(); OSHConsole.WriteLine(" >" + movieMember.Name + "= " + movieMember.Data.Data.ToString()); break;
- case "SeriesEpisode": d.SeriesEpisode = movieMember.Data.Data.ToString(); OSHConsole.WriteLine(" >" + movieMember.Name + "= " + movieMember.Data.Data.ToString()); break;
- case "SeenCount": d.MovieYear = movieMember.Data.Data.ToString(); OSHConsole.WriteLine(" >" + movieMember.Name + "= " + movieMember.Data.Data.ToString()); break;
- }
- }
- res.Items.Add(d);
- }
- R.Results.Add(res);
- }
- break;
- }
- }
- // Return the response to user !!
- return R;
- }
- }
- }
- else
- {
- OSHConsole.WriteLine(response, DebugCode.Error);
- return new MethodResponseError("Fail", response);
- }
- return new MethodResponseError("Fail", "CheckMovieHash2 call failed !");
- }
- /// <summary>
- /// Check if given subtitle files are already stored in the database
- /// </summary>
- /// <param name="hashes">Array of subtitle file hashes (MD5 hashes of subtitle file contents) </param>
- /// <returns>Status of the call operation. If the call success the response will be 'MethodResponseCheckSubHash'</returns>
- public static IMethodResponse CheckSubHash(string[] hashes)
- {
- if (TOKEN == "")
- {
- OSHConsole.WriteLine("Can't do this call, 'token' value not set. Please use Log In method first.", DebugCode.Error);
- return new MethodResponseError("Fail", "Can't do this call, 'token' value not set. Please use Log In method first.");
- }
- // Method call ..
- var parms = new List<IXmlRpcValue>();
- parms.Add(new XmlRpcValueBasic(TOKEN));
- parms.Add(new XmlRpcValueArray(hashes));
- var call = new XmlRpcMethodCall("CheckSubHash", parms);
-
- OSHConsole.WriteLine("Sending CheckSubHash request to the server ...", DebugCode.Good);
- // Send the request to the server
- string response = Utilities.GetStreamString(Utilities.SendRequest(XmlRpcGenerator.Generate(call), XML_PRC_USERAGENT));
- if (!response.Contains("ERROR:"))
- {
- // No error occur, get and decode the response.
- XmlRpcMethodCall[] calls = XmlRpcGenerator.DecodeMethodResponse(response);
- if (calls.Length > 0)
- {
- if (calls[0].Parameters.Count > 0)
- {
- var mainStruct = (XmlRpcValueStruct)calls[0].Parameters[0];
- // Create the response, we'll need it later
- var R = new MethodResponseCheckSubHash();
-
- // To make sure response is not currepted by server, do it in loop
- foreach (XmlRpcStructMember MEMBER in mainStruct.Members)
- {
- switch (MEMBER.Name)
- {
- case "status": R.Status = (string)MEMBER.Data.Data; OSHConsole.WriteLine(">" + MEMBER.Name + "= " + MEMBER.Data.Data.ToString()); break;
- case "seconds": R.Seconds = (double)MEMBER.Data.Data; OSHConsole.WriteLine(">" + MEMBER.Name + "= " + MEMBER.Data.Data.ToString()); break;
- case "data":
- OSHConsole.WriteLine(">Data:");
- var dataStruct = (XmlRpcValueStruct)MEMBER.Data;
- foreach (XmlRpcStructMember dataMember in dataStruct.Members)
- {
- OSHConsole.WriteLine(" >" + dataMember.Name + "= " + dataMember.Data.Data.ToString());
- var r = new CheckSubHashResult();
- r.Hash = dataMember.Name;
- r.SubID = dataMember.Data.Data.ToString();
- R.Results.Add(r);
- }
- break;
- }
- }
- // Return the response to user !!
- return R;
- }
- }
- }
- else
- {
- OSHConsole.WriteLine(response, DebugCode.Error);
- return new MethodResponseError("Fail", response);
- }
- return new MethodResponseError("Fail", "CheckSubHash call failed !");
- }
- /*Upload*/
- /// <summary>
- /// Try to upload subtitles, perform pre-upload checking (i.e. check if subtitles already exist on server)
- /// </summary>
- /// <param name="subs">The subtitle parameters collection to try to upload</param>
- /// <returns>Status of the call operation. If the call success the response will be 'MethodResponseTryUploadSubtitles'</returns>
- public static IMethodResponse TryUploadSubtitles(TryUploadSubtitlesParameters[] subs)
- {
- if (TOKEN == "")
- {
- OSHConsole.WriteLine("Can't do this call, 'token' value not set. Please use Log In method first.", DebugCode.Error);
- return new MethodResponseError("Fail", "Can't do this call, 'token' value not set. Please use Log In method first.");
- }
- // Method call ..
- var parms = new List<IXmlRpcValue>();
- parms.Add(new XmlRpcValueBasic(TOKEN, XmlRpcBasicValueType.String));
- var s = new XmlRpcValueStruct(new List<XmlRpcStructMember>());
- int i = 1;
- foreach (var cd in subs)
- {
- var member = new XmlRpcStructMember("cd" + i, null);
- var memberStruct = new XmlRpcValueStruct(new List<XmlRpcStructMember>());
- memberStruct.Members.Add(new XmlRpcStructMember("subhash", new XmlRpcValueBasic(cd.subhash)));
- memberStruct.Members.Add(new XmlRpcStructMember("subfilename", new XmlRpcValueBasic(cd.subfilename)));
- memberStruct.Members.Add(new XmlRpcStructMember("moviehash", new XmlRpcValueBasic(cd.moviehash)));
- memberStruct.Members.Add(new XmlRpcStructMember("moviebytesize", new XmlRpcValueBasic(cd.moviebytesize)));
- memberStruct.Members.Add(new XmlRpcStructMember("moviefps", new XmlRpcValueBasic(cd.moviefps)));
- memberStruct.Members.Add(new XmlRpcStructMember("movietimems", new XmlRpcValueBasic(cd.movietimems)));
- memberStruct.Members.Add(new XmlRpcStructMember("movieframes", new XmlRpcValueBasic(cd.movieframes)));
- memberStruct.Members.Add(new XmlRpcStructMember("moviefilename", new XmlRpcValueBasic(cd.moviefilename)));
- member.Data = memberStruct;
- s.Members.Add(member);
- i++;
- }
- parms.Add(s);
- var call = new XmlRpcMethodCall("TryUploadSubtitles", parms);
-
- OSHConsole.WriteLine("Sending TryUploadSubtitles request to the server ...", DebugCode.Good);
- // Send the request to the server
- string response = Utilities.GetStreamString(Utilities.SendRequest(XmlRpcGenerator.Generate(call), XML_PRC_USERAGENT));
- if (!response.Contains("ERROR:"))
- {
- // No error occur, get and decode the response.
- XmlRpcMethodCall[] calls = XmlRpcGenerator.DecodeMethodResponse(response);
- if (calls.Length > 0)
- {
- if (calls[0].Parameters.Count > 0)
- {
- var mainStruct = (XmlRpcValueStruct)calls[0].Parameters[0];
- // Create the response, we'll need it later
- var R = new MethodResponseTryUploadSubtitles();
-
- // To make sure response is not currepted by server, do it in loop
- foreach (XmlRpcStructMember MEMBER in mainStruct.Members)
- {
- switch (MEMBER.Name)
- {
- case "status": R.Status = (string)MEMBER.Data.Data; OSHConsole.WriteLine(">" + MEMBER.Name + "= " + MEMBER.Data.Data.ToString()); break;
- case "seconds": R.Seconds = (double)MEMBER.Data.Data; OSHConsole.WriteLine(">" + MEMBER.Name + "= " + MEMBER.Data.Data.ToString()); break;
- case "alreadyindb": R.AlreadyInDB = (int)MEMBER.Data.Data; OSHConsole.WriteLine(">" + MEMBER.Name + "= " + MEMBER.Data.Data.ToString()); break;
- case "data":
- if (MEMBER.Data is XmlRpcValueArray)
- {
- OSHConsole.WriteLine("Results: ");
-
- var rarray = (XmlRpcValueArray)MEMBER.Data;
- foreach (IXmlRpcValue subStruct in rarray.Values)
- {
- if (subStruct == null) continue;
- if (!(subStruct is XmlRpcValueStruct)) continue;
-
- var result = new SubtitleSearchResult();
- foreach (XmlRpcStructMember submember in ((XmlRpcValueStruct)subStruct).Members)
- {
- // To avoid errors of arranged info or missing ones, let's do it with switch..
- switch (submember.Name)
- {
- case "IDMovie": result.IDMovie = submember.Data.Data.ToString(); break;
- case "IDMovieImdb": result.IDMovieImdb = submember.Data.Data.ToString(); break;
- case "IDSubMovieFile": result.IDSubMovieFile = submember.Data.Data.ToString(); break;
- case "IDSubtitle": result.IDSubtitle = submember.Data.Data.ToString(); break;
- case "IDSubtitleFile": result.IDSubtitleFile = submember.Data.Data.ToString(); break;
- case "ISO639": result.ISO639 = submember.Data.Data.ToString(); break;
- case "LanguageName": result.LanguageName = submember.Data.Data.ToString(); break;
- case "MovieByteSize": result.MovieByteSize = submember.Data.Data.ToString(); break;
- case "MovieHash": result.MovieHash = submember.Data.Data.ToString(); break;
- case "MovieImdbRating": result.MovieImdbRating = submember.Data.Data.ToString(); break;
- case "MovieName": result.MovieName = submember.Data.Data.ToString(); break;
- case "MovieNameEng": result.MovieNameEng = submember.Data.Data.ToString(); break;
- case "MovieReleaseName": result.MovieReleaseName = submember.Data.Data.ToString(); break;
- case "MovieTimeMS": result.MovieTimeMS = submember.Data.Data.ToString(); break;
- case "MovieYear": result.MovieYear = submember.Data.Data.ToString(); break;
- case "SubActualCD": result.SubActualCD = submember.Data.Data.ToString(); break;
- case "SubAddDate": result.SubAddDate = submember.Data.Data.ToString(); break;
- case "SubAuthorComment": result.SubAuthorComment = submember.Data.Data.ToString(); break;
- case "SubBad": result.SubBad = submember.Data.Data.ToString(); break;
- case "SubDownloadLink": result.SubDownloadLink = submember.Data.Data.ToString(); break;
- case "SubDownloadsCnt": result.SubDownloadsCnt = submember.Data.Data.ToString(); break;
- case "SubFileName": result.SubFileName = submember.Data.Data.ToString(); break;
- case "SubFormat": result.SubFormat = submember.Data.Data.ToString(); break;
- case "SubHash": result.SubHash = submember.Data.Data.ToString(); break;
- case "SubLanguageID": result.SubLanguageID = submember.Data.Data.ToString(); break;
- case "SubRating": result.SubRating = submember.Data.Data.ToString(); break;
- case "SubSize": result.SubSize = submember.Data.Data.ToString(); break;
- case "SubSumCD": result.SubSumCD = submember.Data.Data.ToString(); break;
- case "UserID": result.UserID = submember.Data.Data.ToString(); break;
- case "UserNickName": result.UserNickName = submember.Data.Data.ToString(); break;
- case "ZipDownloadLink": result.ZipDownloadLink = submember.Data.Data.ToString(); break;
- }
- }
- R.Results.Add(result);
- OSHConsole.WriteLine(">" + result.ToString());
- }
- }
- else// Unknown data ?
- {
- OSHConsole.WriteLine("Data= " + MEMBER.Data.Data.ToString(), DebugCode.Warning);
- }
- break;
- }
- }
- // Return the response to user !!
- return R;
- }
- }
- }
- else
- {
- OSHConsole.WriteLine(response, DebugCode.Error);
- return new MethodResponseError("Fail", response);
- }
- return new MethodResponseError("Fail", "TryUploadSubtitles call failed !");
- }
- /// <summary>
- /// Upload given subtitles to OSDb server
- /// </summary>
- /// <param name="info">The pamaters of upload method</param>
- /// <returns>Status of the call operation. If the call success the response will be 'MethodResponseUploadSubtitles'</returns>
- public static IMethodResponse UploadSubtitles(UploadSubtitleInfoParameters info)
- {
- if (TOKEN == "")
- {
- OSHConsole.WriteLine("Can't do this call, 'token' value not set. Please use Log In method first.", DebugCode.Error);
- return new MethodResponseError("Fail", "Can't do this call, 'token' value not set. Please use Log In method first.");
- }
- // Method call ..
- var parms = new List<IXmlRpcValue>();
- parms.Add(new XmlRpcValueBasic(TOKEN));
- // Main struct
- var s = new XmlRpcValueStruct(new List<XmlRpcStructMember>());
-
- // Base info member as struct
- var member = new XmlRpcStructMember("baseinfo", null);
- var memberStruct = new XmlRpcValueStruct(new List<XmlRpcStructMember>());
- memberStruct.Members.Add(new XmlRpcStructMember("idmovieimdb", new XmlRpcValueBasic(info.idmovieimdb)));
- memberStruct.Members.Add(new XmlRpcStructMember("sublanguageid", new XmlRpcValueBasic(info.sublanguageid)));
- memberStruct.Members.Add(new XmlRpcStructMember("moviereleasename", new XmlRpcValueBasic(info.moviereleasename)));
- memberStruct.Members.Add(new XmlRpcStructMember("movieaka", new XmlRpcValueBasic(info.movieaka)));
- memberStruct.Members.Add(new XmlRpcStructMember("subauthorcomment", new XmlRpcValueBasic(info.subauthorcomment)));
- // memberStruct.Members.Add(new XmlRpcStructMember("hearingimpaired", new XmlRpcValueBasic(info.hearingimpaired)));
- // memberStruct.Members.Add(new XmlRpcStructMember("highdefinition", new XmlRpcValueBasic(info.highdefinition)));
- // memberStruct.Members.Add(new XmlRpcStructMember("automatictranslation", new XmlRpcValueBasic(info.automatictranslation)));
- member.Data = memberStruct;
- s.Members.Add(member);
-
- // CDS members
- int i = 1;
- foreach (UploadSubtitleParameters cd in info.CDS)
- {
- var member2 = new XmlRpcStructMember("cd" + i, null);
- var memberStruct2 = new XmlRpcValueStruct(new List<XmlRpcStructMember>());
- memberStruct2.Members.Add(new XmlRpcStructMember("subhash", new XmlRpcValueBasic(cd.subhash)));
- memberStruct2.Members.Add(new XmlRpcStructMember("subfilename", new XmlRpcValueBasic(cd.subfilename)));
- memberStruct2.Members.Add(new XmlRpcStructMember("moviehash", new XmlRpcValueBasic(cd.moviehash)));
- memberStruct2.Members.Add(new XmlRpcStructMember("moviebytesize", new XmlRpcValueBasic(cd.moviebytesize)));
- memberStruct2.Members.Add(new XmlRpcStructMember("moviefps", new XmlRpcValueBasic(cd.moviefps)));
- memberStruct2.Members.Add(new XmlRpcStructMember("movietimems", new XmlRpcValueBasic(cd.movietimems)));
- memberStruct2.Members.Add(new XmlRpcStructMember("movieframes", new XmlRpcValueBasic(cd.movieframes)));
- memberStruct2.Members.Add(new XmlRpcStructMember("moviefilename", new XmlRpcValueBasic(cd.moviefilename)));
- memberStruct2.Members.Add(new XmlRpcStructMember("subcontent", new XmlRpcValueBasic(cd.subcontent)));
- member2.Data = memberStruct2;
- s.Members.Add(member2);
- i++;
- }
-
- // add main struct to parameters
- parms.Add(s);
- // add user agent
- //parms.Add(new XmlRpcValueBasic(XML_PRC_USERAGENT));
- var call = new XmlRpcMethodCall("UploadSubtitles", parms);
- OSHConsole.WriteLine("Sending UploadSubtitles request to the server ...", DebugCode.Good);
- // Send the request to the server
- string response = Utilities.GetStreamString(Utilities.SendRequest(XmlRpcGenerator.Generate(call), XML_PRC_USERAGENT));
- if (!response.Contains("ERROR:"))
- {
- // No error occur, get and decode the response.
- XmlRpcMethodCall[] calls = XmlRpcGenerator.DecodeMethodResponse(response);
- if (calls.Length > 0)
- {
- if (calls[0].Parameters.Count > 0)
- {
- var mainStruct = (XmlRpcValueStruct)calls[0].Parameters[0];
- // Create the response, we'll need it later
- var R = new MethodResponseUploadSubtitles();
-
- // To make sure response is not currepted by server, do it in loop
- foreach (XmlRpcStructMember MEMBER in mainStruct.Members)
- {
- switch (MEMBER.Name)
- {
- case "status": R.Status = (string)MEMBER.Data.Data; OSHConsole.WriteLine(">" + MEMBER.Name + "= " + MEMBER.Data.Data.ToString()); break;
- case "seconds": R.Seconds = (double)MEMBER.Data.Data; OSHConsole.WriteLine(">" + MEMBER.Name + "= " + MEMBER.Data.Data.ToString()); break;
- case "data": R.Data = (string)MEMBER.Data.Data; OSHConsole.WriteLine(">" + MEMBER.Name + "= " + MEMBER.Data.Data.ToString()); break;
- case "subtitles": R.SubTitles = (bool)MEMBER.Data.Data; OSHConsole.WriteLine(">" + MEMBER.Name + "= " + MEMBER.Data.Data.ToString()); break;
- }
- }
- // Return the response to user !!
- return R;
- }
- }
- }
- else
- {
- OSHConsole.WriteLine(response, DebugCode.Error);
- return new MethodResponseError("Fail", response);
- }
- return new MethodResponseError("Fail", "UploadSubtitles call failed !");
- }
- }
-}
diff --git a/OpenSubtitlesHandler/OpenSubtitlesHandler.csproj b/OpenSubtitlesHandler/OpenSubtitlesHandler.csproj
deleted file mode 100644
index eabd3e070..000000000
--- a/OpenSubtitlesHandler/OpenSubtitlesHandler.csproj
+++ /dev/null
@@ -1,13 +0,0 @@
-<Project Sdk="Microsoft.NET.Sdk">
-
- <ItemGroup>
- <ProjectReference Include="..\MediaBrowser.Common\MediaBrowser.Common.csproj" />
- <ProjectReference Include="..\MediaBrowser.Model\MediaBrowser.Model.csproj" />
- </ItemGroup>
-
- <PropertyGroup>
- <TargetFramework>netstandard2.0</TargetFramework>
- <GenerateAssemblyInfo>false</GenerateAssemblyInfo>
- </PropertyGroup>
-
-</Project>
diff --git a/OpenSubtitlesHandler/OtherTypes/GetAvailableTranslationsResult.cs b/OpenSubtitlesHandler/OtherTypes/GetAvailableTranslationsResult.cs
deleted file mode 100644
index 39d048545..000000000
--- a/OpenSubtitlesHandler/OtherTypes/GetAvailableTranslationsResult.cs
+++ /dev/null
@@ -1,39 +0,0 @@
-/* This file is part of OpenSubtitles Handler
- A library that handle OpenSubtitles.org XML-RPC methods.
-
- Copyright © Ala Ibrahim Hadid 2013
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-namespace OpenSubtitlesHandler
-{
- public struct GetAvailableTranslationsResult
- {
- private string _language;
- private string _LastCreated;
- private string _StringsNo;
-
- public string LanguageID { get { return _language; } set { _language = value; } }
- public string LastCreated { get { return _LastCreated; } set { _LastCreated = value; } }
- public string StringsNo { get { return _StringsNo; } set { _StringsNo = value; } }
- /// <summary>
- /// LanguageID (LastCreated)
- /// </summary>
- /// <returns></returns>
- public override string ToString()
- {
- return _language + " (" + _LastCreated + ")";
- }
- }
-}
diff --git a/OpenSubtitlesHandler/OtherTypes/GetCommentsResult.cs b/OpenSubtitlesHandler/OtherTypes/GetCommentsResult.cs
deleted file mode 100644
index 8f4aa9db4..000000000
--- a/OpenSubtitlesHandler/OtherTypes/GetCommentsResult.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-/* This file is part of OpenSubtitles Handler
- A library that handle OpenSubtitles.org XML-RPC methods.
-
- Copyright © Ala Ibrahim Hadid 2013
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-namespace OpenSubtitlesHandler
-{
- public struct GetCommentsResult
- {
- private string _IDSubtitle;
- private string _UserID;
- private string _UserNickName;
- private string _Comment;
- private string _Created;
-
- public string IDSubtitle { get { return _IDSubtitle; } set { _IDSubtitle = value; } }
- public string UserID { get { return _UserID; } set { _UserID = value; } }
- public string UserNickName { get { return _UserNickName; } set { _UserNickName = value; } }
- public string Comment { get { return _Comment; } set { _Comment = value; } }
- public string Created { get { return _Created; } set { _Created = value; } }
- }
-}
diff --git a/OpenSubtitlesHandler/Properties/AssemblyInfo.cs b/OpenSubtitlesHandler/Properties/AssemblyInfo.cs
deleted file mode 100644
index b5ae23021..000000000
--- a/OpenSubtitlesHandler/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-using System.Reflection;
-using System.Resources;
-using System.Runtime.InteropServices;
-
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle("OpenSubtitlesHandler")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("Jellyfin Project")]
-[assembly: AssemblyProduct("Jellyfin: The Free Software Media System")]
-[assembly: AssemblyCopyright("Copyright © 2013 Ala Ibrahim Hadid. Copyright © 2019 Jellyfin Contributors. Code released under the GNU General Public License Version 2")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-[assembly: NeutralResourcesLanguage("en")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
-
-[assembly: AssemblyVersion("1.0.3.0")]
-[assembly: AssemblyFileVersion("2019.1.20.3")]
diff --git a/OpenSubtitlesHandler/Readme.txt b/OpenSubtitlesHandler/Readme.txt
deleted file mode 100644
index d5814aec1..000000000
--- a/OpenSubtitlesHandler/Readme.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-OpenSubtitlesHandler
-====================
-This project is for OpenSubtitles.org integration‏. The point is to allow user to access OpenSubtitles.org database directly
-within ASM without the need to open internet browser.
-The plan: Implement the "OSDb protocol" http://trac.opensubtitles.org/projects/opensubtitles/wiki/OSDb
-
-Copyright:
-=========
-This library ann all its content are written by Ala Ibrahim Hadid.
-Copyright © Ala Ibrahim Hadid 2013
-mailto:ahdsoftwares@hotmail.com
-
-Resources:
-==========
-* GetHash.dll: this dll is used to compute hash for movie.
- For more information please visit http://trac.opensubtitles.org/projects/opensubtitles/wiki/HashSourceCodes#C2
-
-XML_RPC:
-========
-This class is created to generate XML-RPC requests as XML String. All you need is to call XML_RPC.Generate() method.
diff --git a/OpenSubtitlesHandler/SubtitleTypes/CheckSubHashResult.cs b/OpenSubtitlesHandler/SubtitleTypes/CheckSubHashResult.cs
deleted file mode 100644
index a2fbe8773..000000000
--- a/OpenSubtitlesHandler/SubtitleTypes/CheckSubHashResult.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-/* This file is part of OpenSubtitles Handler
- A library that handle OpenSubtitles.org XML-RPC methods.
-
- Copyright © Ala Ibrahim Hadid 2013
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-namespace OpenSubtitlesHandler
-{
- public struct CheckSubHashResult
- {
- private string _hash;
- private string _id;
-
- public string Hash { get { return _hash; } set { _hash = value; } }
- public string SubID { get { return _id; } set { _id = value; } }
- }
-}
diff --git a/OpenSubtitlesHandler/SubtitleTypes/SubtitleDownloadResult.cs b/OpenSubtitlesHandler/SubtitleTypes/SubtitleDownloadResult.cs
deleted file mode 100644
index e4194994c..000000000
--- a/OpenSubtitlesHandler/SubtitleTypes/SubtitleDownloadResult.cs
+++ /dev/null
@@ -1,43 +0,0 @@
-/* This file is part of OpenSubtitles Handler
- A library that handle OpenSubtitles.org XML-RPC methods.
-
- Copyright © Ala Ibrahim Hadid 2013
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-namespace OpenSubtitlesHandler
-{
- public struct SubtitleDownloadResult
- {
- private string idsubtitlefile;
- private string data;
-
- public string IdSubtitleFile
- { get { return idsubtitlefile; } set { idsubtitlefile = value; } }
- /// <summary>
- /// Get or set the data of subtitle file. To decode, decode the string to base64 and then decompress with GZIP.
- /// </summary>
- public string Data
- { get { return data; } set { data = value; } }
- /// <summary>
- /// IdSubtitleFile
- /// </summary>
- /// <returns></returns>
- public override string ToString()
- {
- return idsubtitlefile.ToString();
- }
- }
-}
diff --git a/OpenSubtitlesHandler/SubtitleTypes/SubtitleLanguage.cs b/OpenSubtitlesHandler/SubtitleTypes/SubtitleLanguage.cs
deleted file mode 100644
index b2dc15413..000000000
--- a/OpenSubtitlesHandler/SubtitleTypes/SubtitleLanguage.cs
+++ /dev/null
@@ -1,39 +0,0 @@
-/* This file is part of OpenSubtitles Handler
- A library that handle OpenSubtitles.org XML-RPC methods.
-
- Copyright © Ala Ibrahim Hadid 2013
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-namespace OpenSubtitlesHandler
-{
- public struct SubtitleLanguage
- {
- private string _SubLanguageID;
- private string _LanguageName;
- private string _ISO639;
-
- public string SubLanguageID { get { return _SubLanguageID; } set { _SubLanguageID = value; } }
- public string LanguageName { get { return _LanguageName; } set { _LanguageName = value; } }
- public string ISO639 { get { return _ISO639; } set { _ISO639 = value; } }
- /// <summary>
- /// LanguageName [SubLanguageID]
- /// </summary>
- /// <returns>LanguageName [SubLanguageID]</returns>
- public override string ToString()
- {
- return _LanguageName + " [" + _SubLanguageID + "]";
- }
- }
-}
diff --git a/OpenSubtitlesHandler/SubtitleTypes/SubtitleSearchParameters.cs b/OpenSubtitlesHandler/SubtitleTypes/SubtitleSearchParameters.cs
deleted file mode 100644
index 5c8f8c01a..000000000
--- a/OpenSubtitlesHandler/SubtitleTypes/SubtitleSearchParameters.cs
+++ /dev/null
@@ -1,82 +0,0 @@
-/* This file is part of OpenSubtitles Handler
- A library that handle OpenSubtitles.org XML-RPC methods.
-
- Copyright © Ala Ibrahim Hadid 2013
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-namespace OpenSubtitlesHandler
-{
- /// <summary>
- /// Paramaters for subtitle search call
- /// </summary>
- public struct SubtitleSearchParameters
- {
- public SubtitleSearchParameters(string subLanguageId, string query = "", string season = "", string episode = "", string movieHash = "", long movieByteSize = 0, string imdbid = "")
- {
- this.subLanguageId = subLanguageId;
- this.movieHash = movieHash;
- this.movieByteSize = movieByteSize;
- this.imdbid = imdbid;
- this._episode = episode;
- this._season = season;
- this._query = query;
- }
-
- private string subLanguageId;
- private string movieHash;
- private long movieByteSize;
- private string imdbid;
- private string _query;
- private string _episode;
-
- public string Episode
- {
- get { return _episode; }
- set { _episode = value; }
- }
-
- public string Season
- {
- get { return _season; }
- set { _season = value; }
- }
-
- private string _season;
-
- public string Query
- {
- get { return _query; }
- set { _query = value; }
- }
-
- /// <summary>
- /// List of language ISO639-3 language codes to search for, divided by ',' (e.g. 'cze,eng,slo')
- /// </summary>
- public string SubLangaugeID { get { return subLanguageId; } set { subLanguageId = value; } }
- /// <summary>
- /// Video file hash as calculated by one of the implementation functions as seen on http://trac.opensubtitles.org/projects/opensubtitles/wiki/HashSourceCodes
- /// </summary>
- public string MovieHash { get { return movieHash; } set { movieHash = value; } }
- /// <summary>
- /// Size of video file in bytes
- /// </summary>
- public long MovieByteSize { get { return movieByteSize; } set { movieByteSize = value; } }
- /// <summary>
- /// ​IMDb ID of movie this video is part of, belongs to.
- /// </summary>
- public string IMDbID { get { return imdbid; } set { imdbid = value; } }
- }
-}
diff --git a/OpenSubtitlesHandler/SubtitleTypes/SubtitleSearchResult.cs b/OpenSubtitlesHandler/SubtitleTypes/SubtitleSearchResult.cs
deleted file mode 100644
index a4a8dd3e6..000000000
--- a/OpenSubtitlesHandler/SubtitleTypes/SubtitleSearchResult.cs
+++ /dev/null
@@ -1,136 +0,0 @@
-/* This file is part of OpenSubtitles Handler
- A library that handle OpenSubtitles.org XML-RPC methods.
-
- Copyright © Ala Ibrahim Hadid 2013
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-namespace OpenSubtitlesHandler
-{
- /// <summary>
- /// The subtitle search result that comes with server response on SearchSubtitles successed call
- /// </summary>
- public struct SubtitleSearchResult
- {
- private string _IDSubMovieFile;
- private string _MovieHash;
- private string _MovieByteSize;
- private string _MovieTimeMS;
- private string _IDSubtitleFile;
- private string _SubFileName;
- private string _SubActualCD;
- private string _SubSize;
- private string _SubHash;
- private string _IDSubtitle;
- private string _UserID;
- private string _SubLanguageID;
- private string _SubFormat;
- private string _SeriesSeason;
- private string _SeriesEpisode;
- private string _SubSumCD;
- private string _SubAuthorComment;
- private string _SubAddDate;
- private string _SubBad;
- private string _SubRating;
- private string _SubDownloadsCnt;
- private string _MovieReleaseName;
- private string _IDMovie;
- private string _IDMovieImdb;
- private string _MovieName;
- private string _MovieNameEng;
- private string _MovieYear;
- private string _MovieImdbRating;
- private string _UserNickName;
- private string _ISO639;
- private string _LanguageName;
- private string _SubDownloadLink;
- private string _ZipDownloadLink;
-
- public string IDSubMovieFile
- { get { return _IDSubMovieFile; } set { _IDSubMovieFile = value; } }
- public string MovieHash
- { get { return _MovieHash; } set { _MovieHash = value; } }
- public string MovieByteSize
- { get { return _MovieByteSize; } set { _MovieByteSize = value; } }
- public string MovieTimeMS
- { get { return _MovieTimeMS; } set { _MovieTimeMS = value; } }
- public string IDSubtitleFile
- { get { return _IDSubtitleFile; } set { _IDSubtitleFile = value; } }
- public string SubFileName
- { get { return _SubFileName; } set { _SubFileName = value; } }
- public string SubActualCD
- { get { return _SubActualCD; } set { _SubActualCD = value; } }
- public string SubSize
- { get { return _SubSize; } set { _SubSize = value; } }
- public string SubHash
- { get { return _SubHash; } set { _SubHash = value; } }
- public string IDSubtitle
- { get { return _IDSubtitle; } set { _IDSubtitle = value; } }
- public string UserID
- { get { return _UserID; } set { _UserID = value; } }
- public string SubLanguageID
- { get { return _SubLanguageID; } set { _SubLanguageID = value; } }
- public string SubFormat
- { get { return _SubFormat; } set { _SubFormat = value; } }
- public string SubSumCD
- { get { return _SubSumCD; } set { _SubSumCD = value; } }
- public string SubAuthorComment
- { get { return _SubAuthorComment; } set { _SubAuthorComment = value; } }
- public string SubAddDate
- { get { return _SubAddDate; } set { _SubAddDate = value; } }
- public string SubBad
- { get { return _SubBad; } set { _SubBad = value; } }
- public string SubRating
- { get { return _SubRating; } set { _SubRating = value; } }
- public string SubDownloadsCnt
- { get { return _SubDownloadsCnt; } set { _SubDownloadsCnt = value; } }
- public string MovieReleaseName
- { get { return _MovieReleaseName; } set { _MovieReleaseName = value; } }
- public string IDMovie
- { get { return _IDMovie; } set { _IDMovie = value; } }
- public string IDMovieImdb
- { get { return _IDMovieImdb; } set { _IDMovieImdb = value; } }
- public string MovieName
- { get { return _MovieName; } set { _MovieName = value; } }
- public string MovieNameEng
- { get { return _MovieNameEng; } set { _MovieNameEng = value; } }
- public string MovieYear
- { get { return _MovieYear; } set { _MovieYear = value; } }
- public string MovieImdbRating
- { get { return _MovieImdbRating; } set { _MovieImdbRating = value; } }
- public string UserNickName
- { get { return _UserNickName; } set { _UserNickName = value; } }
- public string ISO639
- { get { return _ISO639; } set { _ISO639 = value; } }
- public string LanguageName
- { get { return _LanguageName; } set { _LanguageName = value; } }
- public string SubDownloadLink
- { get { return _SubDownloadLink; } set { _SubDownloadLink = value; } }
- public string ZipDownloadLink
- { get { return _ZipDownloadLink; } set { _ZipDownloadLink = value; } }
- public string SeriesSeason
- { get { return _SeriesSeason; } set { _SeriesSeason = value; } }
- public string SeriesEpisode
- { get { return _SeriesEpisode; } set { _SeriesEpisode = value; } }
- /// <summary>
- /// SubFileName + " (" + SubFormat + ")"
- /// </summary>
- /// <returns></returns>
- public override string ToString()
- {
- return _SubFileName + " (" + _SubFormat + ")";
- }
- }
-}
diff --git a/OpenSubtitlesHandler/SubtitleTypes/TryUploadSubtitlesParameters.cs b/OpenSubtitlesHandler/SubtitleTypes/TryUploadSubtitlesParameters.cs
deleted file mode 100644
index 11f3a706c..000000000
--- a/OpenSubtitlesHandler/SubtitleTypes/TryUploadSubtitlesParameters.cs
+++ /dev/null
@@ -1,47 +0,0 @@
-/* This file is part of OpenSubtitles Handler
- A library that handle OpenSubtitles.org XML-RPC methods.
-
- Copyright © Ala Ibrahim Hadid 2013
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-namespace OpenSubtitlesHandler
-{
- public class TryUploadSubtitlesParameters
- {
- private string _subhash = "";
- private string _subfilename = "";
- private string _moviehash = "";
- private string _moviebytesize = "";
- private int _movietimems = 0;
- private int _movieframes = 0;
- private double _moviefps = 0;
- private string _moviefilename = "";
-
- public string subhash { get { return _subhash; } set { _subhash = value; } }
- public string subfilename { get { return _subfilename; } set { _subfilename = value; } }
- public string moviehash { get { return _moviehash; } set { _moviehash = value; } }
- public string moviebytesize { get { return _moviebytesize; } set { _moviebytesize = value; } }
- public int movietimems { get { return _movietimems; } set { _movietimems = value; } }
- public int movieframes { get { return _movieframes; } set { _movieframes = value; } }
- public double moviefps { get { return _moviefps; } set { _moviefps = value; } }
- public string moviefilename { get { return _moviefilename; } set { _moviefilename = value; } }
-
- public override string ToString()
- {
- return _subfilename + " (" + _subhash + ")";
- }
- }
-}
diff --git a/OpenSubtitlesHandler/SubtitleTypes/UploadSubtitleInfoParameter.cs b/OpenSubtitlesHandler/SubtitleTypes/UploadSubtitleInfoParameter.cs
deleted file mode 100644
index 133cc1d23..000000000
--- a/OpenSubtitlesHandler/SubtitleTypes/UploadSubtitleInfoParameter.cs
+++ /dev/null
@@ -1,46 +0,0 @@
-/* This file is part of OpenSubtitles Handler
- A library that handle OpenSubtitles.org XML-RPC methods.
-
- Copyright © Ala Ibrahim Hadid 2013
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-using System.Collections.Generic;
-
-namespace OpenSubtitlesHandler
-{
- public class UploadSubtitleInfoParameters
- {
- private string _idmovieimdb;
- private string _moviereleasename;
- private string _movieaka;
- private string _sublanguageid;
- private string _subauthorcomment;
- private bool _hearingimpaired;
- private bool _highdefinition;
- private bool _automatictranslation;
- private List<UploadSubtitleParameters> cds;
-
- public string idmovieimdb { get { return _idmovieimdb; } set { _idmovieimdb = value; } }
- public string moviereleasename { get { return _moviereleasename; } set { _moviereleasename = value; } }
- public string movieaka { get { return _movieaka; } set { _movieaka = value; } }
- public string sublanguageid { get { return _sublanguageid; } set { _sublanguageid = value; } }
- public string subauthorcomment { get { return _subauthorcomment; } set { _subauthorcomment = value; } }
- public bool hearingimpaired { get { return _hearingimpaired; } set { _hearingimpaired = value; } }
- public bool highdefinition { get { return _highdefinition; } set { _highdefinition = value; } }
- public bool automatictranslation { get { return _automatictranslation; } set { _automatictranslation = value; } }
- public List<UploadSubtitleParameters> CDS { get { return cds; } set { cds = value; } }
- }
-}
diff --git a/OpenSubtitlesHandler/SubtitleTypes/UploadSubtitleParameters.cs b/OpenSubtitlesHandler/SubtitleTypes/UploadSubtitleParameters.cs
deleted file mode 100644
index 9910dadc5..000000000
--- a/OpenSubtitlesHandler/SubtitleTypes/UploadSubtitleParameters.cs
+++ /dev/null
@@ -1,52 +0,0 @@
-/* This file is part of OpenSubtitles Handler
- A library that handle OpenSubtitles.org XML-RPC methods.
-
- Copyright © Ala Ibrahim Hadid 2013
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-namespace OpenSubtitlesHandler
-{
- public struct UploadSubtitleParameters
- {
- private string _subhash;
- private string _subfilename;
- private string _moviehash;
- private double _moviebytesize;
- private int _movietimems;
- private int _movieframes;
- private double _moviefps;
- private string _moviefilename;
- private string _subcontent;
-
- public string subhash { get { return _subhash; } set { _subhash = value; } }
- public string subfilename { get { return _subfilename; } set { _subfilename = value; } }
- public string moviehash { get { return _moviehash; } set { _moviehash = value; } }
- public double moviebytesize { get { return _moviebytesize; } set { _moviebytesize = value; } }
- public int movietimems { get { return _movietimems; } set { _movietimems = value; } }
- public int movieframes { get { return _movieframes; } set { _movieframes = value; } }
- public double moviefps { get { return _moviefps; } set { _moviefps = value; } }
- public string moviefilename { get { return _moviefilename; } set { _moviefilename = value; } }
- /// <summary>
- /// Sub content. Note: this value must be the subtitle file gziped and then base64 decoded.
- /// </summary>
- public string subcontent { get { return _subcontent; } set { _subcontent = value; } }
-
- public override string ToString()
- {
- return _subfilename + " (" + _subhash + ")";
- }
- }
-}
diff --git a/OpenSubtitlesHandler/Utilities.cs b/OpenSubtitlesHandler/Utilities.cs
deleted file mode 100644
index 429e28a8f..000000000
--- a/OpenSubtitlesHandler/Utilities.cs
+++ /dev/null
@@ -1,174 +0,0 @@
-/* This file is part of OpenSubtitles Handler
- A library that handle OpenSubtitles.org XML-RPC methods.
-
- Copyright © Ala Ibrahim Hadid 2013
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Text;
-using System.Threading;
-using System.Threading.Tasks;
-using MediaBrowser.Common.Net;
-using MediaBrowser.Model.Cryptography;
-
-namespace OpenSubtitlesHandler
-{
- /// <summary>
- /// Include helper methods. All member are statics.
- /// </summary>
- public sealed class Utilities
- {
- public static ICryptoProvider CryptographyProvider { get; set; }
- public static IHttpClient HttpClient { get; set; }
- private static string XML_RPC_SERVER = "https://api.opensubtitles.org/xml-rpc";
- //private static string XML_RPC_SERVER = "https://92.240.234.122/xml-rpc";
- private static string HostHeader = "api.opensubtitles.org:443";
-
- /// <summary>
- /// Compute movie hash
- /// </summary>
- /// <returns>The hash as Hexadecimal string</returns>
- public static string ComputeHash(Stream stream)
- {
- byte[] hash = MovieHasher.ComputeMovieHash(stream);
- return MovieHasher.ToHexadecimal(hash);
- }
- /// <summary>
- /// Decompress data using GZip
- /// </summary>
- /// <param name="dataToDecompress">The stream that hold the data</param>
- /// <returns>Bytes array of decompressed data</returns>
- public static byte[] Decompress(Stream dataToDecompress)
- {
- using (var target = new MemoryStream())
- {
- using (var decompressionStream = new System.IO.Compression.GZipStream(dataToDecompress, System.IO.Compression.CompressionMode.Decompress))
- {
- decompressionStream.CopyTo(target);
- }
- return target.ToArray();
- }
- }
-
- /// <summary>
- /// Compress data using GZip (the retunred buffer will be WITHOUT HEADER)
- /// </summary>
- /// <param name="dataToCompress">The stream that hold the data</param>
- /// <returns>Bytes array of compressed data WITHOUT HEADER bytes</returns>
- public static byte[] Compress(Stream dataToCompress)
- {
- /*using (var compressed = new MemoryStream())
- {
- using (var compressor = new System.IO.Compression.GZipStream(compressed,
- System.IO.Compression.CompressionMode.Compress))
- {
- dataToCompress.CopyTo(compressor);
- }
- // Get the compressed bytes only after closing the GZipStream
- return compressed.ToArray();
- }*/
- //using (var compressedOutput = new MemoryStream())
- //{
- // using (var compressedStream = new ZlibStream(compressedOutput,
- // Ionic.Zlib.CompressionMode.Compress,
- // CompressionLevel.Default, false))
- // {
- // var buffer = new byte[4096];
- // int byteCount;
- // do
- // {
- // byteCount = dataToCompress.Read(buffer, 0, buffer.Length);
-
- // if (byteCount > 0)
- // {
- // compressedStream.Write(buffer, 0, byteCount);
- // }
- // } while (byteCount > 0);
- // }
- // return compressedOutput.ToArray();
- //}
-
- throw new NotImplementedException();
- }
-
- /// <summary>
- /// Handle server response stream and decode it as given encoding string.
- /// </summary>
- /// <returns>The string of the stream after decode using given encoding</returns>
- public static string GetStreamString(Stream responseStream)
- {
- using (responseStream)
- {
- // Handle response, should be XML text.
- var data = new List<byte>();
- while (true)
- {
- int r = responseStream.ReadByte();
- if (r < 0)
- break;
- data.Add((byte)r);
- }
- var bytes = data.ToArray();
- return Encoding.ASCII.GetString(bytes, 0, bytes.Length);
- }
- }
-
- public static byte[] GetASCIIBytes(string text)
- {
- return Encoding.ASCII.GetBytes(text);
- }
-
- /// <summary>
- /// Send a request to the server
- /// </summary>
- /// <param name="request">The request buffer to send as bytes array.</param>
- /// <param name="userAgent">The user agent value.</param>
- /// <returns>Response of the server or stream of error message as string started with 'ERROR:' keyword.</returns>
- public static Stream SendRequest(byte[] request, string userAgent)
- {
- return SendRequestAsync(request, userAgent, CancellationToken.None).Result;
- }
-
- public static async Task<Stream> SendRequestAsync(byte[] request, string userAgent, CancellationToken cancellationToken)
- {
- var options = new HttpRequestOptions
- {
- RequestContentBytes = request,
- RequestContentType = "text/xml",
- UserAgent = userAgent,
- Host = HostHeader,
- Url = XML_RPC_SERVER,
-
- // Response parsing will fail with this enabled
- EnableHttpCompression = false,
-
- CancellationToken = cancellationToken,
- BufferContent = false
- };
-
- if (string.IsNullOrEmpty(options.UserAgent))
- {
- options.UserAgent = "xmlrpc-epi-php/0.2 (PHP)";
- }
-
- var result = await HttpClient.Post(options).ConfigureAwait(false);
-
- return result.Content;
- }
-
- }
-}
diff --git a/OpenSubtitlesHandler/XML-RPC/Docs/XML-RPC.txt b/OpenSubtitlesHandler/XML-RPC/Docs/XML-RPC.txt
deleted file mode 100644
index a4de38cde..000000000
--- a/OpenSubtitlesHandler/XML-RPC/Docs/XML-RPC.txt
+++ /dev/null
@@ -1,225 +0,0 @@
-XML-RPC Specification
-
-Tue, Jun 15, 1999; by Dave Winer.
-
-Updated 6/30/03 DW
-
-Updated 10/16/99 DW
-
-Updated 1/21/99 DW
-
-This specification documents the XML-RPC protocol implemented in UserLand Frontier 5.1.
-
-For a non-technical explanation, see XML-RPC for Newbies.
-
-This page provides all the information that an implementor needs.
-
-Overview
-
-XML-RPC is a Remote Procedure Calling protocol that works over the Internet.
-
-An XML-RPC message is an HTTP-POST request. The body of the request is in XML. A procedure executes on the server and the value it returns is also formatted in XML.
-
-Procedure parameters can be scalars, numbers, strings, dates, etc.; and can also be complex record and list structures.
-
-Request example
-
-Here's an example of an XML-RPC request:
-
-POST /RPC2 HTTP/1.0
-User-Agent: Frontier/5.1.2 (WinNT)
-Host: betty.userland.com
-Content-Type: text/xml
-Content-length: 181
-
-<?xml version="1.0"?>
- <methodCall>
- <methodName>examples.getStateName</methodName>
- <params>
- <param>
- <value>
- <i4>41</i4>
- </value>
- </param>
- </params>
- </methodCall>
-
-Header requirements
-
-The format of the URI in the first line of the header is not specified. For example, it could be empty, a single slash, if the server is only handling XML-RPC calls. However, if the server is handling a mix of incoming HTTP requests, we allow the URI to help route the request to the code that handles XML-RPC requests. (In the example, the URI is /RPC2, telling the server to route the request to the "RPC2" responder.)
-
-A User-Agent and Host must be specified.
-
-The Content-Type is text/xml.
-
-The Content-Length must be specified and must be correct.
-
-Payload format
-
-The payload is in XML, a single <methodCall> structure.
-
-The <methodCall> must contain a <methodName> sub-item, a string, containing the name of the method to be called. The string may only contain identifier characters, upper and lower-case A-Z, the numeric characters, 0-9, underscore, dot, colon and slash. It's entirely up to the server to decide how to interpret the characters in a methodName.
-
-For example, the methodName could be the name of a file containing a script that executes on an incoming request. It could be the name of a cell in a database table. Or it could be a path to a file contained within a hierarchy of folders and files.
-
-If the procedure call has parameters, the <methodCall> must contain a <params> sub-item. The <params> sub-item can contain any number of <param>s, each of which has a <value>.
-
-Scalar <value>s
-
-<value>s can be scalars, type is indicated by nesting the value inside one of the tags listed in this table:
-
-Tag Type Example
-<i4> or <int> four-byte signed integer -12
-<boolean> 0 (false) or 1 (true) 1
-<string> string hello world
-<double> double-precision signed floating point number -12.214
-<dateTime.iso8601> date/time 19980717T14:08:55
-<base64> base64-encoded binary eW91IGNhbid0IHJlYWQgdGhpcyE=
-
-If no type is indicated, the type is string.
-
-<struct>s
-
-A value can also be of type <struct>.
-
-A <struct> contains <member>s and each <member> contains a <name> and a <value>.
-
-Here's an example of a two-element <struct>:
-
-<struct>
- <member>
- <name>lowerBound</name>
- <value><i4>18</i4></value>
- </member>
- <member>
- <name>upperBound</name>
- <value><i4>139</i4></value>
- </member>
- </struct>
-
-<struct>s can be recursive, any <value> may contain a <struct> or any other type, including an <array>, described below.
-
-<array>s
-
-A value can also be of type <array>.
-
-An <array> contains a single <data> element, which can contain any number of <value>s.
-
-Here's an example of a four-element array:
-
-<array>
- <data>
- <value><i4>12</i4></value>
- <value><string>Egypt</string></value>
- <value><boolean>0</boolean></value>
- <value><i4>-31</i4></value>
- </data>
- </array>
-
-<array> elements do not have names.
-
-You can mix types as the example above illustrates.
-
-<arrays>s can be recursive, any value may contain an <array> or any other type, including a <struct>, described above.
-
-Response example
-
-Here's an example of a response to an XML-RPC request:
-
-HTTP/1.1 200 OK
-Connection: close
-Content-Length: 158
-Content-Type: text/xml
-Date: Fri, 17 Jul 1998 19:55:08 GMT
-Server: UserLand Frontier/5.1.2-WinNT
-
-<?xml version="1.0"?> <methodResponse> <params> <param> <value><string>South Dakota</string></value> </param> </params> </methodResponse>
-
-Response format
-
-Unless there's a lower-level error, always return 200 OK.
-
-The Content-Type is text/xml. Content-Length must be present and correct.
-
-The body of the response is a single XML structure, a <methodResponse>, which can contain a single <params> which contains a single <param> which contains a single <value>.
-
-The <methodResponse> could also contain a <fault> which contains a <value> which is a <struct> containing two elements, one named <faultCode>, an <int> and one named <faultString>, a <string>.
-
-A <methodResponse> can not contain both a <fault> and a <params>.
-
-Fault example
-
-HTTP/1.1 200 OK
-Connection: close
-Content-Length: 426
-Content-Type: text/xml
-Date: Fri, 17 Jul 1998 19:55:02 GMT
-Server: UserLand Frontier/5.1.2-WinNT
-
-<?xml version="1.0"?> <methodResponse> <fault> <value> <struct> <member> <name>faultCode</name> <value><int>4</int></value> </member> <member> <name>faultString</name> <value><string>Too many parameters.</string></value> </member> </struct> </value> </fault> </methodResponse>
-
-Strategies/Goals
-
-Firewalls. The goal of this protocol is to lay a compatible foundation across different environments, no new power is provided beyond the capabilities of the CGI interface. Firewall software can watch for POSTs whose Content-Type is text/xml.
-
-Discoverability. We wanted a clean, extensible format that's very simple. It should be possible for an HTML coder to be able to look at a file containing an XML-RPC procedure call, understand what it's doing, and be able to modify it and have it work on the first or second try.
-
-Easy to implement. We also wanted it to be an easy to implement protocol that could quickly be adapted to run in other environments or on other operating systems.
-
-Updated 1/21/99 DW
-
-The following questions came up on the UserLand discussion group as XML-RPC was being implemented in Python.
-
- The Response Format section says "The body of the response is a single XML structure, a <methodResponse>, which can contain a single <params>..." This is confusing. Can we leave out the <params>?
-
- No you cannot leave it out if the procedure executed successfully. There are only two options, either a response contains a <params> structure or it contains a <fault> structure. That's why we used the word "can" in that sentence.
-
- Is "boolean" a distinct data type, or can boolean values be interchanged with integers (e.g. zero=false, non-zero=true)?
-
- Yes, boolean is a distinct data type. Some languages/environments allow for an easy coercion from zero to false and one to true, but if you mean true, send a boolean type with the value true, so your intent can't possibly be misunderstood.
-
- What is the legal syntax (and range) for integers? How to deal with leading zeros? Is a leading plus sign allowed? How to deal with whitespace?
-
- An integer is a 32-bit signed number. You can include a plus or minus at the beginning of a string of numeric characters. Leading zeros are collapsed. Whitespace is not permitted. Just numeric characters preceeded by a plus or minus.
-
- What is the legal syntax (and range) for floating point values (doubles)? How is the exponent represented? How to deal with whitespace? Can infinity and "not a number" be represented?
-
- There is no representation for infinity or negative infinity or "not a number". At this time, only decimal point notation is allowed, a plus or a minus, followed by any number of numeric characters, followed by a period and any number of numeric characters. Whitespace is not allowed. The range of allowable values is implementation-dependent, is not specified.
-
- What characters are allowed in strings? Non-printable characters? Null characters? Can a "string" be used to hold an arbitrary chunk of binary data?
-
- Any characters are allowed in a string except < and &, which are encoded as &lt; and &amp;. A string can be used to encode binary data.
-
- Does the "struct" element keep the order of keys. Or in other words, is the struct "foo=1, bar=2" equivalent to "bar=2, foo=1" or not?
-
- The struct element does not preserve the order of the keys. The two structs are equivalent.
-
- Can the <fault> struct contain other members than <faultCode> and <faultString>? Is there a global list of faultCodes? (so they can be mapped to distinct exceptions for languages like Python and Java)?
-
- A <fault> struct may not contain members other than those specified. This is true for all other structures. We believe the specification is flexible enough so that all reasonable data-transfer needs can be accomodated within the specified structures. If you believe strongly that this is not true, please post a message on the discussion group.
-
- There is no global list of fault codes. It is up to the server implementer, or higher-level standards to specify fault codes.
-
- What timezone should be assumed for the dateTime.iso8601 type? UTC? localtime?
-
- Don't assume a timezone. It should be specified by the server in its documentation what assumptions it makes about timezones.
-
-Additions
-
- <base64> type. 1/21/99 DW.
-
-Updated 6/30/03 DW
-
-Removed "ASCII" from definition of string.
-
-Changed copyright dates, below, to 1999-2003 from 1998-99.
-
-Copyright and disclaimer
-
-© Copyright 1998-2003 UserLand Software. All Rights Reserved.
-
-This document and translations of it may be copied and furnished to others, and derivative works that comment on or otherwise explain it or assist in its implementation may be prepared, copied, published and distributed, in whole or in part, without restriction of any kind, provided that the above copyright notice and these paragraphs are included on all such copies and derivative works.
-
-This document may not be modified in any way, such as by removing the copyright notice or references to UserLand or other organizations. Further, while these copyright restrictions apply to the written XML-RPC specification, no claim of ownership is made by UserLand to the protocol it describes. Any party may, for commercial or non-commercial purposes, implement this protocol without royalty or license fee to UserLand. The limited permissions granted herein are perpetual and will not be revoked by UserLand or its successors or assigns.
-
-This document and the information contained herein is provided on an "AS IS" basis and USERLAND DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
diff --git a/OpenSubtitlesHandler/XML-RPC/Enums/XmlRpcValueType.cs b/OpenSubtitlesHandler/XML-RPC/Enums/XmlRpcValueType.cs
deleted file mode 100644
index 51e0ee98f..000000000
--- a/OpenSubtitlesHandler/XML-RPC/Enums/XmlRpcValueType.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-/* This file is part of OpenSubtitles Handler
- A library that handle OpenSubtitles.org XML-RPC methods.
-
- Copyright © Ala Ibrahim Hadid 2013
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-namespace XmlRpcHandler
-{
- public enum XmlRpcBasicValueType
- {
- String, Int, Boolean, Double, dateTime_iso8601, base64
- }
-}
diff --git a/OpenSubtitlesHandler/XML-RPC/Types/XmlRpcMethodCall.cs b/OpenSubtitlesHandler/XML-RPC/Types/XmlRpcMethodCall.cs
deleted file mode 100644
index 7cc1a164f..000000000
--- a/OpenSubtitlesHandler/XML-RPC/Types/XmlRpcMethodCall.cs
+++ /dev/null
@@ -1,63 +0,0 @@
-/* This file is part of OpenSubtitles Handler
- A library that handle OpenSubtitles.org XML-RPC methods.
-
- Copyright © Ala Ibrahim Hadid 2013
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-using System.Collections.Generic;
-
-namespace XmlRpcHandler
-{
- /// <summary>
- /// A method call
- /// </summary>
- public struct XmlRpcMethodCall
- {
- /// <summary>
- /// A method call
- /// </summary>
- /// <param name="name">The name of this method</param>
- public XmlRpcMethodCall(string name)
- {
- this.name = name;
- this.parameters = new List<IXmlRpcValue>();
- }
- /// <summary>
- /// A method call
- /// </summary>
- /// <param name="name">The name of this method</param>
- /// <param name="parameters">A list of parameters</param>
- public XmlRpcMethodCall(string name, List<IXmlRpcValue> parameters)
- {
- this.name = name;
- this.parameters = parameters;
- }
-
- private string name;
- private List<IXmlRpcValue> parameters;
-
- /// <summary>
- /// Get or set the name of this method
- /// </summary>
- public string Name
- { get { return name; } set { name = value; } }
- /// <summary>
- /// Get or set the parameters to be sent
- /// </summary>
- public List<IXmlRpcValue> Parameters
- { get { return parameters; } set { parameters = value; } }
- }
-}
diff --git a/OpenSubtitlesHandler/XML-RPC/Values/IXmlRpcValue.cs b/OpenSubtitlesHandler/XML-RPC/Values/IXmlRpcValue.cs
deleted file mode 100644
index c918790cb..000000000
--- a/OpenSubtitlesHandler/XML-RPC/Values/IXmlRpcValue.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-/* This file is part of OpenSubtitles Handler
- A library that handle OpenSubtitles.org XML-RPC methods.
-
- Copyright © Ala Ibrahim Hadid 2013
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-namespace XmlRpcHandler
-{
- public abstract class IXmlRpcValue
- {
- public IXmlRpcValue()
- { }
- public IXmlRpcValue(object data)
- {
- this.data = data;
- }
- private object data;
- /// <summary>
- /// Get or set the data of this value
- /// </summary>
- public virtual object Data { get { return data; } set { data = value; } }
- }
-}
diff --git a/OpenSubtitlesHandler/XML-RPC/Values/XmlRpcStructMember.cs b/OpenSubtitlesHandler/XML-RPC/Values/XmlRpcStructMember.cs
deleted file mode 100644
index 2aad7ebff..000000000
--- a/OpenSubtitlesHandler/XML-RPC/Values/XmlRpcStructMember.cs
+++ /dev/null
@@ -1,43 +0,0 @@
-/* This file is part of OpenSubtitles Handler
- A library that handle OpenSubtitles.org XML-RPC methods.
-
- Copyright © Ala Ibrahim Hadid 2013
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-namespace XmlRpcHandler
-{
- public class XmlRpcStructMember
- {
- public XmlRpcStructMember(string name, IXmlRpcValue data)
- {
- this.name = name;
- this.data = data;
- }
- private string name;
- private IXmlRpcValue data;
-
- /// <summary>
- /// Get or set the name of this member
- /// </summary>
- public string Name
- { get { return name; } set { name = value; } }
- /// <summary>
- /// Get or set the data of this member
- /// </summary>
- public IXmlRpcValue Data
- { get { return data; } set { data = value; } }
- }
-}
diff --git a/OpenSubtitlesHandler/XML-RPC/Values/XmlRpcValueArray.cs b/OpenSubtitlesHandler/XML-RPC/Values/XmlRpcValueArray.cs
deleted file mode 100644
index d10a80175..000000000
--- a/OpenSubtitlesHandler/XML-RPC/Values/XmlRpcValueArray.cs
+++ /dev/null
@@ -1,121 +0,0 @@
-/* This file is part of OpenSubtitles Handler
- A library that handle OpenSubtitles.org XML-RPC methods.
-
- Copyright © Ala Ibrahim Hadid 2013
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-using System;
-using System.Collections.Generic;
-
-namespace XmlRpcHandler
-{
- public class XmlRpcValueArray : IXmlRpcValue
- {
- public XmlRpcValueArray() :
- base()
- {
- values = new List<IXmlRpcValue>();
- }
- public XmlRpcValueArray(object data) :
- base(data)
- {
- values = new List<IXmlRpcValue>();
- }
- public XmlRpcValueArray(string[] texts) :
- base()
- {
- values = new List<IXmlRpcValue>();
- foreach (string val in texts)
- {
- values.Add(new XmlRpcValueBasic(val));
- }
- }
- public XmlRpcValueArray(int[] ints) :
- base()
- {
- values = new List<IXmlRpcValue>();
- foreach (int val in ints)
- {
- values.Add(new XmlRpcValueBasic(val));
- }
- }
- public XmlRpcValueArray(double[] doubles) :
- base()
- {
- values = new List<IXmlRpcValue>();
- foreach (double val in doubles)
- {
- values.Add(new XmlRpcValueBasic(val));
- }
- }
- public XmlRpcValueArray(bool[] bools) :
- base()
- {
- values = new List<IXmlRpcValue>();
- foreach (bool val in bools)
- {
- values.Add(new XmlRpcValueBasic(val));
- }
- }
- public XmlRpcValueArray(long[] base24s) :
- base()
- {
- values = new List<IXmlRpcValue>();
- foreach (long val in base24s)
- {
- values.Add(new XmlRpcValueBasic(val));
- }
- }
- public XmlRpcValueArray(DateTime[] dates) :
- base()
- {
- values = new List<IXmlRpcValue>();
- foreach (var val in dates)
- {
- values.Add(new XmlRpcValueBasic(val));
- }
- }
- public XmlRpcValueArray(XmlRpcValueBasic[] basicValues) :
- base()
- {
- values = new List<IXmlRpcValue>();
- foreach (var val in basicValues)
- {
- values.Add(val);
- }
- }
- public XmlRpcValueArray(XmlRpcValueStruct[] structs) :
- base()
- {
- values = new List<IXmlRpcValue>();
- foreach (var val in structs)
- {
- values.Add(val);
- }
- }
- public XmlRpcValueArray(XmlRpcValueArray[] arrays) :
- base()
- {
- values = new List<IXmlRpcValue>();
- foreach (var val in arrays)
- {
- values.Add(val);
- }
- }
- private List<IXmlRpcValue> values;
-
- public List<IXmlRpcValue> Values { get { return values; } set { values = value; } }
- }
-}
diff --git a/OpenSubtitlesHandler/XML-RPC/Values/XmlRpcValueBasic.cs b/OpenSubtitlesHandler/XML-RPC/Values/XmlRpcValueBasic.cs
deleted file mode 100644
index f2811b988..000000000
--- a/OpenSubtitlesHandler/XML-RPC/Values/XmlRpcValueBasic.cs
+++ /dev/null
@@ -1,99 +0,0 @@
-/* This file is part of OpenSubtitles Handler
- A library that handle OpenSubtitles.org XML-RPC methods.
-
- Copyright © Ala Ibrahim Hadid 2013
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-using System;
-
-namespace XmlRpcHandler
-{
- public class XmlRpcValueBasic : IXmlRpcValue
- {
- public XmlRpcValueBasic()
- : base()
- { }
- public XmlRpcValueBasic(string data)
- : base(data)
- { this.type = XmlRpcBasicValueType.String; }
- public XmlRpcValueBasic(int data)
- : base(data)
- { this.type = XmlRpcBasicValueType.Int; }
- public XmlRpcValueBasic(double data)
- : base(data)
- { this.type = XmlRpcBasicValueType.Double; }
- public XmlRpcValueBasic(DateTime data)
- : base(data)
- { this.type = XmlRpcBasicValueType.dateTime_iso8601; }
- public XmlRpcValueBasic(bool data)
- : base(data)
- { this.type = XmlRpcBasicValueType.Boolean; }
- public XmlRpcValueBasic(long data)
- : base(data)
- { this.type = XmlRpcBasicValueType.base64; }
- public XmlRpcValueBasic(object data, XmlRpcBasicValueType type)
- : base(data)
- { this.type = type; }
-
- private XmlRpcBasicValueType type = XmlRpcBasicValueType.String;
- /// <summary>
- /// Get or set the type of this basic value
- /// </summary>
- public XmlRpcBasicValueType ValueType { get { return type; } set { type = value; } }
- /*Oprators. help a lot.*/
- public static implicit operator string(XmlRpcValueBasic f)
- {
- if (f.type == XmlRpcBasicValueType.String)
- return f.Data.ToString();
- else
- throw new Exception("Unable to convert, this value is not string type.");
- }
- public static implicit operator int(XmlRpcValueBasic f)
- {
- if (f.type == XmlRpcBasicValueType.String)
- return (int)f.Data;
- else
- throw new Exception("Unable to convert, this value is not int type.");
- }
- public static implicit operator double(XmlRpcValueBasic f)
- {
- if (f.type == XmlRpcBasicValueType.String)
- return (double)f.Data;
- else
- throw new Exception("Unable to convert, this value is not double type.");
- }
- public static implicit operator bool(XmlRpcValueBasic f)
- {
- if (f.type == XmlRpcBasicValueType.String)
- return (bool)f.Data;
- else
- throw new Exception("Unable to convert, this value is not bool type.");
- }
- public static implicit operator long(XmlRpcValueBasic f)
- {
- if (f.type == XmlRpcBasicValueType.String)
- return (long)f.Data;
- else
- throw new Exception("Unable to convert, this value is not long type.");
- }
- public static implicit operator DateTime(XmlRpcValueBasic f)
- {
- if (f.type == XmlRpcBasicValueType.String)
- return (DateTime)f.Data;
- else
- throw new Exception("Unable to convert, this value is not DateTime type.");
- }
- }
-}
diff --git a/OpenSubtitlesHandler/XML-RPC/Values/XmlRpcValueStruct.cs b/OpenSubtitlesHandler/XML-RPC/Values/XmlRpcValueStruct.cs
deleted file mode 100644
index 4863e38e8..000000000
--- a/OpenSubtitlesHandler/XML-RPC/Values/XmlRpcValueStruct.cs
+++ /dev/null
@@ -1,43 +0,0 @@
-/* This file is part of OpenSubtitles Handler
- A library that handle OpenSubtitles.org XML-RPC methods.
-
- Copyright © Ala Ibrahim Hadid 2013
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-using System.Collections.Generic;
-
-namespace XmlRpcHandler
-{
- /// <summary>
- /// Represents XML-RPC struct
- /// </summary>
- public class XmlRpcValueStruct : IXmlRpcValue
- {
- /// <summary>
- /// Represents XML-RPC struct
- /// </summary>
- /// <param name="members"></param>
- public XmlRpcValueStruct(List<XmlRpcStructMember> members)
- { this.members = members; }
-
- private List<XmlRpcStructMember> members;
- /// <summary>
- /// Get or set the members collection
- /// </summary>
- public List<XmlRpcStructMember> Members
- { get { return members; } set { members = value; } }
- }
-}
diff --git a/OpenSubtitlesHandler/XML-RPC/XmlRpcGenerator.cs b/OpenSubtitlesHandler/XML-RPC/XmlRpcGenerator.cs
deleted file mode 100644
index a79a278fa..000000000
--- a/OpenSubtitlesHandler/XML-RPC/XmlRpcGenerator.cs
+++ /dev/null
@@ -1,350 +0,0 @@
-/* This file is part of OpenSubtitles Handler
- A library that handle OpenSubtitles.org XML-RPC methods.
-
- Copyright © Ala Ibrahim Hadid 2013
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-using System;
-using System.Collections.Generic;
-using System.Globalization;
-using System.IO;
-using System.Text;
-using System.Xml;
-using OpenSubtitlesHandler;
-
-namespace XmlRpcHandler
-{
- /// <summary>
- /// A class for making XML-RPC requests. The requests then can be sent directly as http request.
- /// </summary>
- public class XmlRpcGenerator
- {
- /// <summary>
- /// Generate XML-RPC request using method call.
- /// </summary>
- /// <param name="method">The method call</param>
- /// <returns>The request in xml.</returns>
- public static byte[] Generate(XmlRpcMethodCall method)
- { return Generate(new XmlRpcMethodCall[] { method }); }
- /// <summary>
- /// Generate XML-RPC request using method calls array.
- /// </summary>
- /// <param name="methods">The method calls array</param>
- /// <returns>The request in utf8 xml string as buffer</returns>
- public static byte[] Generate(XmlRpcMethodCall[] methods)
- {
- if (methods == null)
- throw new Exception("No method to write !");
- if (methods.Length == 0)
- throw new Exception("No method to write !");
- // Create xml
- var sett = new XmlWriterSettings();
- sett.Indent = true;
-
- sett.Encoding = Encoding.UTF8;
-
- using (var ms = new MemoryStream())
- {
- using (var XMLwrt = XmlWriter.Create(ms, sett))
- {
- // Let's write the methods
- foreach (XmlRpcMethodCall method in methods)
- {
- XMLwrt.WriteStartElement("methodCall");//methodCall
- XMLwrt.WriteStartElement("methodName");//methodName
- XMLwrt.WriteString(method.Name);
- XMLwrt.WriteEndElement();//methodName
- XMLwrt.WriteStartElement("params");//params
- // Write values
- foreach (IXmlRpcValue p in method.Parameters)
- {
- XMLwrt.WriteStartElement("param");//param
- if (p is XmlRpcValueBasic)
- {
- WriteBasicValue(XMLwrt, (XmlRpcValueBasic)p);
- }
- else if (p is XmlRpcValueStruct)
- {
- WriteStructValue(XMLwrt, (XmlRpcValueStruct)p);
- }
- else if (p is XmlRpcValueArray)
- {
- WriteArrayValue(XMLwrt, (XmlRpcValueArray)p);
- }
- XMLwrt.WriteEndElement();//param
- }
-
- XMLwrt.WriteEndElement();//params
- XMLwrt.WriteEndElement();//methodCall
- }
- XMLwrt.Flush();
- return ms.ToArray();
- }
- }
- }
- /// <summary>
- /// Decode response then return the values
- /// </summary>
- /// <param name="xmlResponse">The response xml string as provided by server as methodResponse</param>
- /// <returns></returns>
- public static XmlRpcMethodCall[] DecodeMethodResponse(string xmlResponse)
- {
- var methods = new List<XmlRpcMethodCall>();
- var sett = new XmlReaderSettings();
- sett.DtdProcessing = DtdProcessing.Ignore;
- sett.IgnoreWhitespace = true;
- MemoryStream str;
- if (xmlResponse.Contains(@"encoding=""utf-8"""))
- {
- str = new MemoryStream(Encoding.UTF8.GetBytes(xmlResponse));
- }
- else
- {
- str = new MemoryStream(Utilities.GetASCIIBytes(xmlResponse));
- }
- using (str)
- {
- using (var XMLread = XmlReader.Create(str, sett))
- {
- var call = new XmlRpcMethodCall("methodResponse");
- // Read parameters
- while (XMLread.Read())
- {
- if (XMLread.Name == "param" && XMLread.IsStartElement())
- {
- IXmlRpcValue val = ReadValue(XMLread);
- if (val != null)
- call.Parameters.Add(val);
- }
- }
- methods.Add(call);
- return methods.ToArray();
- }
- }
- }
-
- private static void WriteBasicValue(XmlWriter XMLwrt, XmlRpcValueBasic val)
- {
- XMLwrt.WriteStartElement("value");//value
- switch (val.ValueType)
- {
- case XmlRpcBasicValueType.String:
- XMLwrt.WriteStartElement("string");
- if (val.Data != null)
- XMLwrt.WriteString(val.Data.ToString());
- XMLwrt.WriteEndElement();
- break;
- case XmlRpcBasicValueType.Int:
- XMLwrt.WriteStartElement("int");
- if (val.Data != null)
- XMLwrt.WriteString(val.Data.ToString());
- XMLwrt.WriteEndElement();
- break;
- case XmlRpcBasicValueType.Boolean:
- XMLwrt.WriteStartElement("boolean");
- if (val.Data != null)
- XMLwrt.WriteString(((bool)val.Data) ? "1" : "0");
- XMLwrt.WriteEndElement();
- break;
- case XmlRpcBasicValueType.Double:
- XMLwrt.WriteStartElement("double");
- if (val.Data != null)
- XMLwrt.WriteString(val.Data.ToString());
- XMLwrt.WriteEndElement();
- break;
- case XmlRpcBasicValueType.dateTime_iso8601:
- XMLwrt.WriteStartElement("dateTime.iso8601");
- // Get date time format
- if (val.Data != null)
- {
- var time = (DateTime)val.Data;
- string dt = time.Year + time.Month.ToString("D2") + time.Day.ToString("D2") +
- "T" + time.Hour.ToString("D2") + ":" + time.Minute.ToString("D2") + ":" +
- time.Second.ToString("D2");
- XMLwrt.WriteString(dt);
- }
- XMLwrt.WriteEndElement();
- break;
- case XmlRpcBasicValueType.base64:
- XMLwrt.WriteStartElement("base64");
- if (val.Data != null)
- XMLwrt.WriteString(Convert.ToBase64String(BitConverter.GetBytes((long)val.Data)));
- XMLwrt.WriteEndElement();
- break;
- }
- XMLwrt.WriteEndElement();//value
- }
- private static void WriteStructValue(XmlWriter XMLwrt, XmlRpcValueStruct val)
- {
- XMLwrt.WriteStartElement("value");//value
- XMLwrt.WriteStartElement("struct");//struct
- foreach (XmlRpcStructMember member in val.Members)
- {
- XMLwrt.WriteStartElement("member");//member
-
- XMLwrt.WriteStartElement("name");//name
- XMLwrt.WriteString(member.Name);
- XMLwrt.WriteEndElement();//name
-
- if (member.Data is XmlRpcValueBasic)
- {
- WriteBasicValue(XMLwrt, (XmlRpcValueBasic)member.Data);
- }
- else if (member.Data is XmlRpcValueStruct)
- {
- WriteStructValue(XMLwrt, (XmlRpcValueStruct)member.Data);
- }
- else if (member.Data is XmlRpcValueArray)
- {
- WriteArrayValue(XMLwrt, (XmlRpcValueArray)member.Data);
- }
-
- XMLwrt.WriteEndElement();//member
- }
- XMLwrt.WriteEndElement();//struct
- XMLwrt.WriteEndElement();//value
- }
- private static void WriteArrayValue(XmlWriter XMLwrt, XmlRpcValueArray val)
- {
- XMLwrt.WriteStartElement("value");//value
- XMLwrt.WriteStartElement("array");//array
- XMLwrt.WriteStartElement("data");//data
- foreach (IXmlRpcValue o in val.Values)
- {
- if (o is XmlRpcValueBasic)
- {
- WriteBasicValue(XMLwrt, (XmlRpcValueBasic)o);
- }
- else if (o is XmlRpcValueStruct)
- {
- WriteStructValue(XMLwrt, (XmlRpcValueStruct)o);
- }
- else if (o is XmlRpcValueArray)
- {
- WriteArrayValue(XMLwrt, (XmlRpcValueArray)o);
- }
- }
- XMLwrt.WriteEndElement();//data
- XMLwrt.WriteEndElement();//array
- XMLwrt.WriteEndElement();//value
- }
- private static readonly CultureInfo UsCulture = new CultureInfo("en-US");
-
- private static string ReadString(XmlReader reader)
- {
- if (reader.NodeType == XmlNodeType.Element)
- {
- return reader.ReadElementContentAsString();
- }
- return reader.ReadContentAsString();
- }
-
- private static IXmlRpcValue ReadValue(XmlReader xmlReader, bool skipRead = false)
- {
- while (skipRead || xmlReader.Read())
- {
- if (xmlReader.Name == "value" && xmlReader.IsStartElement())
- {
- xmlReader.Read();
- if (xmlReader.Name == "string" && xmlReader.IsStartElement())
- {
- return new XmlRpcValueBasic(ReadString(xmlReader), XmlRpcBasicValueType.String);
- }
- else if (xmlReader.Name == "int" && xmlReader.IsStartElement())
- {
- return new XmlRpcValueBasic(int.Parse(ReadString(xmlReader), UsCulture), XmlRpcBasicValueType.Int);
- }
- else if (xmlReader.Name == "boolean" && xmlReader.IsStartElement())
- {
- return new XmlRpcValueBasic(ReadString(xmlReader) == "1", XmlRpcBasicValueType.Boolean);
- }
- else if (xmlReader.Name == "double" && xmlReader.IsStartElement())
- {
- return new XmlRpcValueBasic(double.Parse(ReadString(xmlReader), UsCulture), XmlRpcBasicValueType.Double);
- }
- else if (xmlReader.Name == "dateTime.iso8601" && xmlReader.IsStartElement())
- {
- string date = ReadString(xmlReader);
- int year = int.Parse(date.Substring(0, 4), UsCulture);
- int month = int.Parse(date.Substring(4, 2), UsCulture);
- int day = int.Parse(date.Substring(6, 2), UsCulture);
- int hour = int.Parse(date.Substring(9, 2), UsCulture);
- int minute = int.Parse(date.Substring(12, 2), UsCulture);//19980717T14:08:55
- int sec = int.Parse(date.Substring(15, 2), UsCulture);
- var time = new DateTime(year, month, day, hour, minute, sec);
- return new XmlRpcValueBasic(time, XmlRpcBasicValueType.dateTime_iso8601);
- }
- else if (xmlReader.Name == "base64" && xmlReader.IsStartElement())
- {
- return new XmlRpcValueBasic(BitConverter.ToInt64(Convert.FromBase64String(ReadString(xmlReader)), 0)
- , XmlRpcBasicValueType.Double);
- }
- else if (xmlReader.Name == "struct" && xmlReader.IsStartElement())
- {
- var strct = new XmlRpcValueStruct(new List<XmlRpcStructMember>());
- // Read members...
- while (xmlReader.Read())
- {
- if (xmlReader.Name == "member" && xmlReader.IsStartElement())
- {
- var member = new XmlRpcStructMember("", null);
- xmlReader.Read();// read name
- member.Name = ReadString(xmlReader);
-
- IXmlRpcValue val = ReadValue(xmlReader, true);
- if (val != null)
- {
- member.Data = val;
- strct.Members.Add(member);
- }
- }
- else if (xmlReader.Name == "struct" && !xmlReader.IsStartElement())
- {
- return strct;
- }
- }
- return strct;
- }
- else if (xmlReader.Name == "array" && xmlReader.IsStartElement())
- {
- var array = new XmlRpcValueArray();
- // Read members...
- while (xmlReader.Read())
- {
- if (xmlReader.Name == "array" && !xmlReader.IsStartElement())
- {
- return array;
- }
- else
- {
- IXmlRpcValue val = ReadValue(xmlReader);
- if (val != null)
- array.Values.Add(val);
- }
- }
- return array;
- }
- }
- else break;
-
- if (skipRead)
- {
- return null;
- }
- }
- return null;
- }
- }
-}
diff --git a/RSSDP/Properties/AssemblyInfo.cs b/RSSDP/Properties/AssemblyInfo.cs
index d2bb7c6f3..55f7b6a83 100644
--- a/RSSDP/Properties/AssemblyInfo.cs
+++ b/RSSDP/Properties/AssemblyInfo.cs
@@ -9,8 +9,8 @@ using System.Runtime.InteropServices;
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Jellyfin Project")]
-[assembly: AssemblyProduct("Jellyfin: The Free Software Media System")]
-[assembly: AssemblyCopyright("Copyright © 2015 Troy Willmot. Code released under the MIT license. Copyright © 2019 Jellyfin Contributors. Code released under the GNU General Public License Version 2")]
+[assembly: AssemblyProduct("Jellyfin Server")]
+[assembly: AssemblyCopyright("Copyright © 2015 Troy Willmot. Code released under the MIT license. Copyright © 2019 Jellyfin Contributors. Code released under the GNU General Public License")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: NeutralResourcesLanguage("en")]
diff --git a/deployment/debian-package-x64/pkg-src/conf/jellyfin b/deployment/debian-package-x64/pkg-src/conf/jellyfin
index 58fe79332..bc00c37e2 100644
--- a/deployment/debian-package-x64/pkg-src/conf/jellyfin
+++ b/deployment/debian-package-x64/pkg-src/conf/jellyfin
@@ -13,17 +13,16 @@
#
# Program directories
-JELLYFIN_DATA_DIRECTORY="/var/lib/jellyfin"
-JELLYFIN_CONFIG_DIRECTORY="/etc/jellyfin"
-JELLYFIN_LOG_DIRECTORY="/var/log/jellyfin"
-JELLYFIN_CACHE_DIRECTORY="/var/cache/jellyfin"
+JELLYFIN_DATA_DIR="/var/lib/jellyfin"
+JELLYFIN_CONFIG_DIR="/etc/jellyfin"
+JELLYFIN_LOG_DIR="/var/log/jellyfin"
+JELLYFIN_CACHE_DIR="/var/cache/jellyfin"
# Restart script for in-app server control
JELLYFIN_RESTART_OPT="--restartpath=/usr/lib/jellyfin/restart.sh"
# ffmpeg binary paths, overriding the system values
JELLYFIN_FFMPEG_OPT="--ffmpeg=/usr/share/jellyfin-ffmpeg/ffmpeg"
-JELLYFIN_FFPROBE_OPT="--ffprobe=/usr/share/jellyfin-ffmpeg/ffprobe"
# [OPTIONAL] run Jellyfin as a headless service
#JELLYFIN_SERVICE_OPT="--service"
@@ -38,4 +37,4 @@ JELLYFIN_FFPROBE_OPT="--ffprobe=/usr/share/jellyfin-ffmpeg/ffprobe"
# Application username
JELLYFIN_USER="jellyfin"
# Full application command
-JELLYFIN_ARGS="--datadir=$JELLYFIN_DATA_DIRECTORY --configdir=$JELLYFIN_CONFIG_DIRECTORY --logdir=$JELLYFIN_LOG_DIRECTORY --cachedir=$JELLYFIN_CACHE_DIRECTORY $JELLYFIN_RESTART_OPT $JELLYFIN_FFMPEG_OPT $JELLYFIN_FFPROBE_OPT $JELLYFIN_SERVICE_OPT $JELLFIN_NOWEBAPP_OPT"
+JELLYFIN_ARGS="$JELLYFIN_RESTART_OPT $JELLYFIN_FFMPEG_OPT $JELLYFIN_SERVICE_OPT $JELLFIN_NOWEBAPP_OPT"
diff --git a/deployment/debian-package-x64/pkg-src/jellyfin.init b/deployment/debian-package-x64/pkg-src/jellyfin.init
index d103fb0f1..7f5642bac 100644
--- a/deployment/debian-package-x64/pkg-src/jellyfin.init
+++ b/deployment/debian-package-x64/pkg-src/jellyfin.init
@@ -8,42 +8,54 @@
# Description: Runs Jellyfin Server
### END INIT INFO
+set -e
+
# Carry out specific functions when asked to by the system
-pidfile="/var/run/jellyfin.pid"
-pid=`cat $pidfile`
+if test -f /etc/default/jellyfin; then
+ . /etc/default/jellyfin
+fi
+
+. /lib/lsb/init-functions
+
+PIDFILE="/run/jellyfin.pid"
case "$1" in
start)
- if [ "$pid" == "" ]; then
- echo "Starting Jellyfin..."
- . /etc/default/jellyfin
- nohup su -u $JELLYFIN_USER -c /usr/bin/jellyfin $JELLYFIN_ARGS
- echo ?? > $pidfile
- else
- echo "Jellyfin already running"
- fi
+ log_daemon_msg "Starting Jellyfin Media Server" "jellyfin" || true
+
+ if start-stop-daemon --start --quiet --oknodo --background --pidfile $PIDFILE --make-pidfile --user $JELLYFIN_USER --chuid $JELLYFIN_USER --exec /usr/bin/jellyfin -- $JELLYFIN_ARGS; then
+ log_end_msg 0 || true
+ else
+ log_end_msg 1 || true
+ fi
;;
+
stop)
- if [ "$pid" != "" ]; then
- echo "Stopping Jellyfin..."
- kill $pid
- sleep 2
- rm -f $pidfile
- else
- echo "Jellyfin not running"
- fi
+ log_daemon_msg "Stopping Jellyfin Media Server" "jellyfin" || true
+ if start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE --remove-pidfile; then
+ log_end_msg 0 || true
+ else
+ log_end_msg 1 || true
+ fi
;;
+
+ restart)
+ log_daemon_msg "Restarting Jellyfin Media Server" "jellyfin" || true
+ start-stop-daemon --stop --quiet --oknodo --retry 30 --pidfile $PIDFILE --remove-pidfile
+ if start-stop-daemon --start --quiet --oknodo --background --pidfile $PIDFILE --make-pidfile --user $JELLYFIN_USER --chuid $JELLYFIN_USER --exec /usr/bin/jellyfin -- $JELLYFIN_ARGS; then
+ log_end_msg 0 || true
+ else
+ log_end_msg 1 || true
+ fi
+ ;;
+
status)
- if [ "$pid" != "" ]; then
- echo "Jellyfin running as $pid"
- ps -f $pid
- else
- echo "Jellyfin is not running"
- fi
+ status_of_proc -p $PIDFILE /usr/bin/jellyfin jellyfin && exit 0 || exit $?
;;
+
*)
- echo "Usage: $0 {start|stop}"
+ echo "Usage: $0 {start|stop|restart|status}"
exit 1
;;
esac
diff --git a/deployment/debian-package-x64/pkg-src/jellyfin.service b/deployment/debian-package-x64/pkg-src/jellyfin.service
index 9c6c6667f..1305e238b 100644
--- a/deployment/debian-package-x64/pkg-src/jellyfin.service
+++ b/deployment/debian-package-x64/pkg-src/jellyfin.service
@@ -6,7 +6,7 @@ After = network.target
Type = simple
EnvironmentFile = /etc/default/jellyfin
User = jellyfin
-ExecStart = /usr/bin/jellyfin --datadir=${JELLYFIN_DATA_DIRECTORY} --configdir=${JELLYFIN_CONFIG_DIRECTORY} --logdir=${JELLYFIN_LOG_DIRECTORY} --cachedir=${JELLYFIN_CACHE_DIRECTORY} ${JELLYFIN_RESTART_OPT} ${JELLYFIN_FFMPEG_OPT} ${JELLYFIN_FFPROBE_OPT} ${JELLYFIN_SERVICE_OPT} ${JELLYFIN_NOWEBAPP_OPT}
+ExecStart = /usr/bin/jellyfin ${JELLYFIN_RESTART_OPT} ${JELLYFIN_FFMPEG_OPT} ${JELLYFIN_SERVICE_OPT} ${JELLYFIN_NOWEBAPP_OPT}
Restart = on-failure
TimeoutSec = 15
diff --git a/deployment/fedora-package-x64/pkg-src/jellyfin.env b/deployment/fedora-package-x64/pkg-src/jellyfin.env
index abfa670e4..de48f13af 100644
--- a/deployment/fedora-package-x64/pkg-src/jellyfin.env
+++ b/deployment/fedora-package-x64/pkg-src/jellyfin.env
@@ -15,17 +15,16 @@
#
# Program directories
-JELLYFIN_DATA_DIRECTORY="/var/lib/jellyfin"
-JELLYFIN_CONFIG_DIRECTORY="/etc/jellyfin"
-JELLYFIN_LOG_DIRECTORY="/var/log/jellyfin"
-JELLYFIN_CACHE_DIRECTORY="/var/cache/jellyfin"
+JELLYFIN_DATA_DIR="/var/lib/jellyfin"
+JELLYFIN_CONFIG_DIR="/etc/jellyfin"
+JELLYFIN_LOG_DIR="/var/log/jellyfin"
+JELLYFIN_CACHE_DIR="/var/cache/jellyfin"
# In-App service control
JELLYFIN_RESTART_OPT="--restartpath=/usr/libexec/jellyfin/restart.sh"
# [OPTIONAL] ffmpeg binary paths, overriding the UI-configured values
#JELLYFIN_FFMPEG_OPT="--ffmpeg=/usr/bin/ffmpeg"
-#JELLYFIN_FFPROBE_OPT="--ffprobe=/usr/bin/ffprobe"
# [OPTIONAL] run Jellyfin as a headless service
#JELLYFIN_SERVICE_OPT="--service"
diff --git a/deployment/fedora-package-x64/pkg-src/jellyfin.service b/deployment/fedora-package-x64/pkg-src/jellyfin.service
index d58df9d94..f3dc594b1 100644
--- a/deployment/fedora-package-x64/pkg-src/jellyfin.service
+++ b/deployment/fedora-package-x64/pkg-src/jellyfin.service
@@ -5,7 +5,7 @@ Description=Jellyfin is a free software media system that puts you in control of
[Service]
EnvironmentFile=/etc/sysconfig/jellyfin
WorkingDirectory=/var/lib/jellyfin
-ExecStart=/usr/bin/jellyfin --datadir=${JELLYFIN_DATA_DIRECTORY} --configdir=${JELLYFIN_CONFIG_DIRECTORY} --logdir=${JELLYFIN_LOG_DIRECTORY} --cachedir=${JELLYFIN_CACHE_DIRECTORY} ${JELLYFIN_RESTART_OPT} ${JELLYFIN_FFMPEG_OPT} ${JELLYFIN_FFPROBE_OPT} ${JELLYFIN_SERVICE_OPT} ${JELLYFIN_NOWEBAPP_OPT}
+ExecStart=/usr/bin/jellyfin ${JELLYFIN_RESTART_OPT} ${JELLYFIN_FFMPEG_OPT} ${JELLYFIN_SERVICE_OPT} ${JELLYFIN_NOWEBAPP_OPT}
TimeoutSec=15
Restart=on-failure
User=jellyfin
diff --git a/jellyfin.ruleset b/jellyfin.ruleset
index 4381349ca..262121a32 100644
--- a/jellyfin.ruleset
+++ b/jellyfin.ruleset
@@ -1,6 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<RuleSet Name="Rules for Jellyfin.Server" Description="Code analysis rules for Jellyfin.Server.csproj" ToolsVersion="14.0">
<Rules AnalyzerId="StyleCop.Analyzers" RuleNamespace="StyleCop.Analyzers">
+ <!-- disable warning SA1202: 'public' members must come before 'private' members -->
+ <Rule Id="SA1202" Action="Info" />
+ <!-- disable warning SA1204: Static members must appear before non-static members -->
+ <Rule Id="SA1204" Action="Info" />
+
<!-- disable warning SA1101: Prefix local calls with 'this.' -->
<Rule Id="SA1101" Action="None" />
<!-- disable warning SA1130: Use lambda syntax -->
@@ -15,6 +20,9 @@
<Rule Id="SA1633" Action="None" />
</Rules>
<Rules AnalyzerId="Microsoft.CodeAnalysis.FxCopAnalyzers" RuleNamespace="Microsoft.Design">
+ <!-- disable warning CA1822: Member does not access instance data and can be marked as static -->
+ <Rule Id="CA1822" Action="Info" />
+
<!-- disable warning CA1054: Change the type of parameter url from string to System.Uri -->
<Rule Id="CA1054" Action="None" />
</Rules>
diff --git a/new-file-header.txt b/new-file-header.txt
deleted file mode 100644
index 4247a8e24..000000000
--- a/new-file-header.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-### This header should be used to start new files.
-### It provides an explicit per-file license reference that should be present on all new files.
-### To use this header, delete these lines and the following empty line, modify <filename> to
-### the proper full path, and then add new code following the header and a single empty line.
-
-// <filename>
-// Part of the Jellyfin project (https://jellyfin.media)
-//
-// All copyright belongs to the Jellyfin contributors; a full list can
-// be found in the file CONTRIBUTORS.md
-//
-// This program is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, version 2.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program. If not, see <https://www.gnu.org/licenses/>.