From 218015063b18aaaae2de51f2e77cf451757dc874 Mon Sep 17 00:00:00 2001 From: Joshua Boniface Date: Mon, 7 Oct 2019 22:29:31 -0400 Subject: [PATCH 001/177] Port former create_tarball into COPR Makefile This script was removed in #1793; instead of restoring it, instead implement its functionality directly in the COPR Makefile. --- .copr/Makefile | 44 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/.copr/Makefile b/.copr/Makefile index 84b98a0116..6c1f9a3c43 100644 --- a/.copr/Makefile +++ b/.copr/Makefile @@ -2,7 +2,49 @@ srpm: dnf -y install git git submodule update --init --recursive cd deployment/fedora-package-x64; \ - ./create_tarball.sh; \ + WORKDIR="$( pwd )"; \ + VERSION="$( sed -ne '/^Version:/s/.* *//p' "${WORKDIR}"/pkg-src/jellyfin.spec )"; \ + package_temporary_dir="${WORKDIR}/pkg-dist-tmp"; \ + pkg_src_dir="${WORKDIR}/pkg-src"; \ + GNU_TAR=1; \ + tar \ + --transform "s,^\.,jellyfin-${VERSION}," \ + --exclude='.git*' \ + --exclude='**/.git' \ + --exclude='**/.hg' \ + --exclude='**/.vs' \ + --exclude='**/.vscode' \ + --exclude='deployment' \ + --exclude='**/bin' \ + --exclude='**/obj' \ + --exclude='**/.nuget' \ + --exclude='*.deb' \ + --exclude='*.rpm' \ + -czf "${SOURCE_DIR}/SOURCES/pkg-src/jellyfin-${VERSION}.tar.gz" \ + -C ${SOURCE_DIR} ./ || GNU_TAR=0; \ + if [ $GNU_TAR -eq 0 ]; then + package_temporary_dir="$( mktemp -d )"; \ + mkdir -p "${package_temporary_dir}/jellyfin"; \ + tar \ + --exclude='.git*' \ + --exclude='**/.git' \ + --exclude='**/.hg' \ + --exclude='**/.vs' \ + --exclude='**/.vscode' \ + --exclude='deployment' \ + --exclude='**/bin' \ + --exclude='**/obj' \ + --exclude='**/.nuget' \ + --exclude='*.deb' \ + --exclude='*.rpm' \ + -czf "${package_temporary_dir}/jellyfin/jellyfin-${VERSION}.tar.gz" \ + -C ${SOURCE_DIR} ./; \ + mkdir -p "${package_temporary_dir}/jellyfin-${VERSION}"; \ + tar -xzf "${package_temporary_dir}/jellyfin/jellyfin-${VERSION}.tar.gz" -C "${package_temporary_dir}/jellyfin-${VERSION}"; \ + rm -f "${package_temporary_dir}/jellyfin/jellyfin-${VERSION}.tar.gz"; \ + tar -czf "${SOURCE_DIR}/SOURCES/pkg-src/jellyfin-${VERSION}.tar.gz" -C "${package_temporary_dir}" "jellyfin-${VERSION}"; \ + rm -rf ${package_temporary_dir}; \ + fi; \ rpmbuild -bs pkg-src/jellyfin.spec \ --define "_sourcedir $$PWD/pkg-src/" \ --define "_srcrpmdir $(outdir)" From 8da012c8c507b6a177cfff233cfdac3490f79847 Mon Sep 17 00:00:00 2001 From: Narfinger Date: Thu, 10 Oct 2019 12:09:16 +0900 Subject: [PATCH 002/177] add tests for Emby.Naming/TV/EpisodePathParser.cs This should in the future help to detect working and non working name matchings --- MediaBrowser.sln | 7 ++++++ .../EpisodePathParserTest.cs | 25 +++++++++++++++++++ .../Jellyfin.Naming.Tests.csproj | 20 +++++++++++++++ 3 files changed, 52 insertions(+) create mode 100644 tests/Jellyfin.Naming.Tests/EpisodePathParserTest.cs create mode 100644 tests/Jellyfin.Naming.Tests/Jellyfin.Naming.Tests.csproj diff --git a/MediaBrowser.sln b/MediaBrowser.sln index dd4e9f8a69..260b10eb91 100644 --- a/MediaBrowser.sln +++ b/MediaBrowser.sln @@ -59,6 +59,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Jellyfin.Common.Tests", "te EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Jellyfin.MediaEncoding.Tests", "tests\Jellyfin.MediaEncoding.Tests\Jellyfin.MediaEncoding.Tests.csproj", "{28464062-0939-4AA7-9F7B-24DDDA61A7C0}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Jellyfin.Naming.Tests", "tests\Jellyfin.Naming.Tests\Jellyfin.Naming.Tests.csproj", "{3998657B-1CCC-49DD-A19F-275DC8495F57}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -165,6 +167,10 @@ Global {28464062-0939-4AA7-9F7B-24DDDA61A7C0}.Debug|Any CPU.Build.0 = Debug|Any CPU {28464062-0939-4AA7-9F7B-24DDDA61A7C0}.Release|Any CPU.ActiveCfg = Release|Any CPU {28464062-0939-4AA7-9F7B-24DDDA61A7C0}.Release|Any CPU.Build.0 = Release|Any CPU + {3998657B-1CCC-49DD-A19F-275DC8495F57}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3998657B-1CCC-49DD-A19F-275DC8495F57}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3998657B-1CCC-49DD-A19F-275DC8495F57}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3998657B-1CCC-49DD-A19F-275DC8495F57}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -193,5 +199,6 @@ Global GlobalSection(NestedProjects) = preSolution {DF194677-DFD3-42AF-9F75-D44D5A416478} = {FBBB5129-006E-4AD7-BAD5-8B7CA1D10ED6} {28464062-0939-4AA7-9F7B-24DDDA61A7C0} = {FBBB5129-006E-4AD7-BAD5-8B7CA1D10ED6} + {3998657B-1CCC-49DD-A19F-275DC8495F57} = {FBBB5129-006E-4AD7-BAD5-8B7CA1D10ED6} EndGlobalSection EndGlobal diff --git a/tests/Jellyfin.Naming.Tests/EpisodePathParserTest.cs b/tests/Jellyfin.Naming.Tests/EpisodePathParserTest.cs new file mode 100644 index 0000000000..596bb3253a --- /dev/null +++ b/tests/Jellyfin.Naming.Tests/EpisodePathParserTest.cs @@ -0,0 +1,25 @@ +namespace Emby.Naming.TV +{ + using Emby.Naming.Common; + using Xunit; + + public class EpisodePathParserTest + { + [Theory] + [InlineData("/media/Foo/Foo-S01E01", "Foo", 1, 1)] + [InlineData("/media/Foo - S04E011", "Foo", 4, 11)] + [InlineData("/media/Foo/Foo s01x01", "Foo", 1, 1)] + [InlineData("/media/Foo/Foo s01x03 - the bar of foo", "Foo", 1, 3)] + public void ParseEpisodesCorrectly(string path, string name, int season, int episode) + { + NamingOptions o = new NamingOptions(); + EpisodePathParser p = new EpisodePathParser(o); + var res = p.Parse(path, false); + + Assert.True(res.Success); + Assert.Equal(name, res.SeriesName); + Assert.Equal(season, res.SeasonNumber); + Assert.Equal(episode, res.EpisodeNumber); + } + } +} \ No newline at end of file diff --git a/tests/Jellyfin.Naming.Tests/Jellyfin.Naming.Tests.csproj b/tests/Jellyfin.Naming.Tests/Jellyfin.Naming.Tests.csproj new file mode 100644 index 0000000000..f5e1513489 --- /dev/null +++ b/tests/Jellyfin.Naming.Tests/Jellyfin.Naming.Tests.csproj @@ -0,0 +1,20 @@ + + + + netcoreapp3.0 + + false + + + + + + + + + + + + + + From 45f906c5564d8ecbc3d6d1cabcd78e929a9fb7e1 Mon Sep 17 00:00:00 2001 From: Narfinger Date: Fri, 11 Oct 2019 11:46:51 +0900 Subject: [PATCH 003/177] added a couple more tests --- .../EpisodePathParserTest.cs | 30 ++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/tests/Jellyfin.Naming.Tests/EpisodePathParserTest.cs b/tests/Jellyfin.Naming.Tests/EpisodePathParserTest.cs index 596bb3253a..c4e1ff3541 100644 --- a/tests/Jellyfin.Naming.Tests/EpisodePathParserTest.cs +++ b/tests/Jellyfin.Naming.Tests/EpisodePathParserTest.cs @@ -9,7 +9,7 @@ namespace Emby.Naming.TV [InlineData("/media/Foo/Foo-S01E01", "Foo", 1, 1)] [InlineData("/media/Foo - S04E011", "Foo", 4, 11)] [InlineData("/media/Foo/Foo s01x01", "Foo", 1, 1)] - [InlineData("/media/Foo/Foo s01x03 - the bar of foo", "Foo", 1, 3)] + [InlineData("/media/Foo (2019)/Season 4/Foo (2019).S04E03", "Foo (2019)", 4, 3)] public void ParseEpisodesCorrectly(string path, string name, int season, int episode) { NamingOptions o = new NamingOptions(); @@ -20,6 +20,34 @@ namespace Emby.Naming.TV Assert.Equal(name, res.SeriesName); Assert.Equal(season, res.SeasonNumber); Assert.Equal(episode, res.EpisodeNumber); + + //testing other paths delimeter + var res2 = p.Parse(path.Replace("/", "\\"), false); + Assert.True(res2.Success); + Assert.Equal(name, res2.SeriesName); + Assert.Equal(season, res2.SeasonNumber); + Assert.Equal(episode, res2.EpisodeNumber); + } + + [Theory] + [InlineData("/media/Foo/Foo 889.avi", "Foo", 889)] + public void ParseEpisodeWithoutSeason(string path, string name, int episode) + { + NamingOptions o = new NamingOptions(); + EpisodePathParser p = new EpisodePathParser(o); + var res = p.Parse(path, false, null, null, true); + + Assert.True(res.Success); + Assert.Equal(name, res.SeriesName); + Assert.True(res.SeasonNumber == null); + Assert.Equal(episode, res.EpisodeNumber); + + //testing other paths delimeter + var res2 = p.Parse(path.Replace("/", "\\"), false, null, null, true); + Assert.True(res2.Success); + Assert.Equal(name, res2.SeriesName); + Assert.True(res2.SeasonNumber == null); + Assert.Equal(episode, res2.EpisodeNumber); } } } \ No newline at end of file From c8ffa2fb1d2c56306fa9bca19d73c9842ba5b0b4 Mon Sep 17 00:00:00 2001 From: Anthony Lavado Date: Sat, 12 Oct 2019 03:03:33 -0400 Subject: [PATCH 004/177] Set service install default to no --- deployment/windows/jellyfin.nsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deployment/windows/jellyfin.nsi b/deployment/windows/jellyfin.nsi index e33efde916..8b6c1e01e7 100644 --- a/deployment/windows/jellyfin.nsi +++ b/deployment/windows/jellyfin.nsi @@ -321,7 +321,7 @@ SectionEnd Function .onInit ; Setting up defaults - StrCpy $_INSTALLSERVICE_ "Yes" + StrCpy $_INSTALLSERVICE_ "No" StrCpy $_SERVICESTART_ "Yes" StrCpy $_SERVICEACCOUNTTYPE_ "NetworkService" StrCpy $_EXISTINGINSTALLATION_ "No" From 04c4ad731e36fc36d5e924cc7adf0e12f25cf1b5 Mon Sep 17 00:00:00 2001 From: Anthony Lavado Date: Sat, 12 Oct 2019 03:56:46 -0400 Subject: [PATCH 005/177] Begin to add setup type dialog --- deployment/windows/dialogs/setuptype.nsddef | 12 +++++ deployment/windows/dialogs/setuptype.nsdinc | 56 +++++++++++++++++++++ deployment/windows/jellyfin.nsi | 20 +++++++- 3 files changed, 87 insertions(+), 1 deletion(-) create mode 100644 deployment/windows/dialogs/setuptype.nsddef create mode 100644 deployment/windows/dialogs/setuptype.nsdinc diff --git a/deployment/windows/dialogs/setuptype.nsddef b/deployment/windows/dialogs/setuptype.nsddef new file mode 100644 index 0000000000..ff59f62152 --- /dev/null +++ b/deployment/windows/dialogs/setuptype.nsddef @@ -0,0 +1,12 @@ + + + + \ No newline at end of file diff --git a/deployment/windows/dialogs/setuptype.nsdinc b/deployment/windows/dialogs/setuptype.nsdinc new file mode 100644 index 0000000000..0b171da282 --- /dev/null +++ b/deployment/windows/dialogs/setuptype.nsdinc @@ -0,0 +1,56 @@ +; ========================================================= +; This file was generated by NSISDialogDesigner 1.4.4.0 +; http://coolsoft.altervista.org/nsisdialogdesigner +; +; Do not edit it manually, use NSISDialogDesigner instead! +; ========================================================= + +; handle variables +Var hCtl_setuptype +Var hCtl_setuptype_InstallasaServiceLabel +Var hCtl_setuptype_InstallasaService +Var hCtl_setuptype_BasicInstallLabel +Var hCtl_setuptype_BasicInstall +Var hCtl_setuptype_Font1 + + +; dialog create function +Function fnc_setuptype_Create + + ; custom font definitions + CreateFont $hCtl_setuptype_Font1 "Microsoft Sans Serif" "8.25" "700" + + ; === setuptype (type: Dialog) === + nsDialogs::Create 1018 + Pop $hCtl_setuptype + ${If} $hCtl_setuptype == error + Abort + ${EndIf} + !insertmacro MUI_HEADER_TEXT "This controls how Jellyfin is installed." "Setup Type" + + ; === InstallasaServiceLabel (type: Label) === + ${NSD_CreateLabel} 8u 71u 280u 28u "Install Jellyfin as a service. This method is recommended for Advanced Users. Additional setup is required to access network shares." + Pop $hCtl_setuptype_InstallasaServiceLabel + + ; === InstallasaService (type: RadioButton) === + ${NSD_CreateRadioButton} 8u 54u 280u 15u "Install as a Service (Advanced Users)" + Pop $hCtl_setuptype_InstallasaService + ${NSD_AddStyle} $hCtl_setuptype_InstallasaService ${WS_GROUP} + + ; === BasicInstallLabel (type: Label) === + ${NSD_CreateLabel} 8u 24u 280u 28u "The basic install will run Jellyfin in your current user account.$\nThis is recommended for new users and those with existing Jellyfin installs older than 10.4." + Pop $hCtl_setuptype_BasicInstallLabel + + ; === BasicInstall (type: RadioButton) === + ${NSD_CreateRadioButton} 8u 7u 280u 15u "Basic Install (Recommended)" + Pop $hCtl_setuptype_BasicInstall + SendMessage $hCtl_setuptype_BasicInstall ${WM_SETFONT} $hCtl_setuptype_Font1 0 + ${NSD_Check} $hCtl_setuptype_BasicInstall + +FunctionEnd + +; dialog show function +Function fnc_setuptype_Show + Call fnc_setuptype_Create + nsDialogs::Show +FunctionEnd diff --git a/deployment/windows/jellyfin.nsi b/deployment/windows/jellyfin.nsi index 8b6c1e01e7..847666554e 100644 --- a/deployment/windows/jellyfin.nsi +++ b/deployment/windows/jellyfin.nsi @@ -16,6 +16,7 @@ ShowUninstDetails show ; Global variables that we'll use Var _JELLYFINVERSION_ Var _JELLYFINDATADIR_ + Var _SETUPTYPE_ Var _INSTALLSERVICE_ Var _SERVICESTART_ Var _SERVICEACCOUNTTYPE_ @@ -86,6 +87,9 @@ ShowUninstDetails show !insertmacro MUI_PAGE_WELCOME ; License Page !insertmacro MUI_PAGE_LICENSE "$%InstallLocation%\LICENSE" ; picking up generic GPL + +; Setup Type Page + Page custom ShowSetupTypePage SetupTypePage_Config ; Components Page !insertmacro MUI_PAGE_COMPONENTS !define MUI_PAGE_CUSTOMFUNCTION_PRE HideInstallDirectoryPage ; Controls when to hide / show @@ -102,6 +106,7 @@ ShowUninstDetails show !insertmacro MUI_PAGE_DIRECTORY ; Custom Dialogs + !include "dialogs\setuptype.nsdinc" !include "dialogs\service-config.nsdinc" !include "dialogs\confirmation.nsdinc" @@ -170,7 +175,7 @@ Section "!Jellyfin Server (required)" InstallJellyfinServer WriteRegExpandStr HKLM "${REG_UNINST_KEY}" "UninstallString" '"$INSTDIR\Uninstall.exe"' WriteRegStr HKLM "${REG_UNINST_KEY}" "DisplayIcon" '"$INSTDIR\Uninstall.exe",0' WriteRegStr HKLM "${REG_UNINST_KEY}" "Publisher" "The Jellyfin Project" - WriteRegStr HKLM "${REG_UNINST_KEY}" "URLInfoAbout" "https://jellyfin.media/" + WriteRegStr HKLM "${REG_UNINST_KEY}" "URLInfoAbout" "https://jellyfin.org/" WriteRegStr HKLM "${REG_UNINST_KEY}" "DisplayVersion" "$_JELLYFINVERSION_" WriteRegDWORD HKLM "${REG_UNINST_KEY}" "NoModify" 1 WriteRegDWORD HKLM "${REG_UNINST_KEY}" "NoRepair" 1 @@ -413,6 +418,19 @@ Function HideConfirmationPage ${EndIf} FunctionEnd +Function HideSetupTypePage + ${If} $_EXISTINGINSTALLATION_ == "Yes" ; Existing installation detected, so don't ask for InstallFolder + Abort + ${EndIf} +FunctionEnd + +; Setup Type dialog show function +Function ShowSetupTypePage + Call HideSetupTypePage + Call fnc_setuptype_Create + nsDialogs::Show +FunctionEnd + ; Service Config dialog show function Function ShowServiceConfigPage Call HideServiceConfigPage From 05fb84ba2236b0fd0727caf29fad4986059c8b8e Mon Sep 17 00:00:00 2001 From: Anthony Lavado Date: Sat, 12 Oct 2019 04:39:34 -0400 Subject: [PATCH 006/177] Make service setup an optional component, remove setuptype page config for now --- deployment/windows/jellyfin.nsi | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/deployment/windows/jellyfin.nsi b/deployment/windows/jellyfin.nsi index 847666554e..b8de4a4401 100644 --- a/deployment/windows/jellyfin.nsi +++ b/deployment/windows/jellyfin.nsi @@ -89,7 +89,8 @@ ShowUninstDetails show !insertmacro MUI_PAGE_LICENSE "$%InstallLocation%\LICENSE" ; picking up generic GPL ; Setup Type Page - Page custom ShowSetupTypePage SetupTypePage_Config + Page custom ShowSetupTypePage ;SetupTypePage_Config + ; Components Page !insertmacro MUI_PAGE_COMPONENTS !define MUI_PAGE_CUSTOMFUNCTION_PRE HideInstallDirectoryPage ; Controls when to hide / show @@ -184,7 +185,7 @@ Section "!Jellyfin Server (required)" InstallJellyfinServer WriteUninstaller "$INSTDIR\Uninstall.exe" SectionEnd -Section "Jellyfin Server Service" InstallService +Section /o "Jellyfin Server Service" InstallService ExecWait '"$INSTDIR\nssm.exe" statuscode JellyfinServer' $0 DetailPrint "Jellyfin Server service statuscode, $0" From 6746f708f2c2f306ea04270b93cfed2e28eb36c9 Mon Sep 17 00:00:00 2001 From: Vasily Date: Thu, 3 Oct 2019 16:17:35 +0300 Subject: [PATCH 007/177] Revert "Revert "Fix premature stop when streaming"" This reverts commit 575b96d03a2cf98a0e5dd9d9f7329adca34c0311. --- .../Playback/Hls/DynamicHlsService.cs | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs b/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs index f5f7536843..8fa6c3dac0 100644 --- a/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs +++ b/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs @@ -965,14 +965,6 @@ namespace MediaBrowser.Api.Playback.Hls var outputTsArg = Path.Combine(Path.GetDirectoryName(outputPath), Path.GetFileNameWithoutExtension(outputPath)) + "%d" + GetSegmentFileExtension(state.Request); - var timeDeltaParam = string.Empty; - - if (isEncoding && state.TargetFramerate > 0) - { - float startTime = 1 / (state.TargetFramerate.Value * 2); - timeDeltaParam = string.Format(CultureInfo.InvariantCulture, "-segment_time_delta {0:F3}", startTime); - } - var segmentFormat = GetSegmentFileExtension(state.Request).TrimStart('.'); if (string.Equals(segmentFormat, "ts", StringComparison.OrdinalIgnoreCase)) { @@ -980,7 +972,7 @@ namespace MediaBrowser.Api.Playback.Hls } return string.Format( - "{0} {1} -map_metadata -1 -map_chapters -1 -threads {2} {3} {4} {5} -f segment -max_delay 5000000 -avoid_negative_ts disabled -start_at_zero -segment_time {6} {10} -individual_header_trailer 0 -segment_format {11} -segment_list_type m3u8 -segment_start_number {7} -segment_list \"{8}\" -y \"{9}\"", + "{0} {1} -map_metadata -1 -map_chapters -1 -threads {2} {3} {4} {5} -f hls -max_delay 5000000 -avoid_negative_ts disabled -start_at_zero -hls_time {6} -individual_header_trailer 0 -hls_segment_type {7} -start_number {8} -hls_segment_filename \"{9}\" -hls_playlist_type vod -hls_list_size 0 -y \"{10}\"", inputModifier, EncodingHelper.GetInputArgument(state, encodingOptions), threads, @@ -988,11 +980,10 @@ namespace MediaBrowser.Api.Playback.Hls GetVideoArguments(state, encodingOptions), GetAudioArguments(state, encodingOptions), state.SegmentLength.ToString(CultureInfo.InvariantCulture), + segmentFormat, startNumberParam, - outputPath, outputTsArg, - timeDeltaParam, - segmentFormat + outputPath ).Trim(); } } From c1f9107b8be9b3cbd26e15773998c7ac6598e7f9 Mon Sep 17 00:00:00 2001 From: Vasily Date: Thu, 3 Oct 2019 18:50:39 +0300 Subject: [PATCH 008/177] Add more logging Trying to fix hls muxer plus ffmpeg 4.1+ combo Try to fix waiting for segment being ready This is needed because hls muxer in ffmpeg >= 4.1 creates the playlist only when it finishes transcoding. Also cleaned up logs a bit. Lower log level for "StartFfmpeg finished" to debug --- .../Playback/BaseStreamingService.cs | 7 ++- .../Playback/Hls/DynamicHlsService.cs | 47 ++++++++----------- deployment/debian-package-x64/docker-build.sh | 1 + 3 files changed, 27 insertions(+), 28 deletions(-) diff --git a/MediaBrowser.Api/Playback/BaseStreamingService.cs b/MediaBrowser.Api/Playback/BaseStreamingService.cs index 8c4ccfa22c..700883c963 100644 --- a/MediaBrowser.Api/Playback/BaseStreamingService.cs +++ b/MediaBrowser.Api/Playback/BaseStreamingService.cs @@ -289,16 +289,20 @@ namespace MediaBrowser.Api.Playback throw; } + Logger.LogDebug("Launched ffmpeg process"); state.TranscodingJob = transcodingJob; // Important - don't await the log task or we won't be able to kill ffmpeg when the user stops playback _ = new JobLogger(Logger).StartStreamingLog(state, process.StandardError.BaseStream, logStream); // Wait for the file to exist before proceeeding - while (!File.Exists(state.WaitForPath ?? outputPath) && !transcodingJob.HasExited) + var waitFor = state.WaitForPath ?? outputPath; + Logger.LogDebug("Waiting for the creation of '{0}'", waitFor); + while (!File.Exists(waitFor) && !transcodingJob.HasExited) { await Task.Delay(100, cancellationTokenSource.Token).ConfigureAwait(false); } + Logger.LogDebug("File '{0}' created or transcoding has finished", waitFor); if (state.IsInputVideo && transcodingJob.Type == TranscodingJobType.Progressive && !transcodingJob.HasExited) { @@ -314,6 +318,7 @@ namespace MediaBrowser.Api.Playback { StartThrottler(state, transcodingJob); } + Logger.LogDebug("StartFfMpeg() finished successfully"); return transcodingJob; } diff --git a/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs b/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs index 8fa6c3dac0..15dd5add4a 100644 --- a/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs +++ b/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs @@ -243,6 +243,7 @@ namespace MediaBrowser.Api.Playback.Hls request.StartTimeTicks = GetStartPositionTicks(state, requestedIndex); + state.WaitForPath = segmentPath; job = await StartFfMpeg(state, playlistPath, cancellationTokenSource).ConfigureAwait(false); } catch @@ -458,16 +459,15 @@ namespace MediaBrowser.Api.Playback.Hls TranscodingJob transcodingJob, CancellationToken cancellationToken) { - var segmentFileExists = File.Exists(segmentPath); - - // If all transcoding has completed, just return immediately - if (transcodingJob != null && transcodingJob.HasExited && segmentFileExists) + var segmentExists = File.Exists(segmentPath); + if (segmentExists) { - return await GetSegmentResult(state, segmentPath, segmentIndex, transcodingJob).ConfigureAwait(false); - } + if (transcodingJob != null && transcodingJob.HasExited) + { + // Transcoding job is over, so assume all existing files are ready + return await GetSegmentResult(state, segmentPath, segmentIndex, transcodingJob).ConfigureAwait(false); + } - if (segmentFileExists) - { var currentTranscodingIndex = GetCurrentTranscodingIndex(playlistPath, segmentExtension); // If requested segment is less than transcoding position, we can't transcode backwards, so assume it's ready @@ -477,33 +477,26 @@ namespace MediaBrowser.Api.Playback.Hls } } - var segmentFilename = Path.GetFileName(segmentPath); - + var nextSegmentPath = GetSegmentPath(state, playlistPath, segmentIndex + 1); while (!cancellationToken.IsCancellationRequested) { - try + // To be considered ready, the segment file has to exist AND + // either the transcoding job should be done or next segment should also exit + if (segmentExists) { - var text = File.ReadAllText(playlistPath, Encoding.UTF8); - - // If it appears in the playlist, it's done - if (text.IndexOf(segmentFilename, StringComparison.OrdinalIgnoreCase) != -1) + if ((transcodingJob != null && transcodingJob.HasExited) || File.Exists(nextSegmentPath)) { - if (!segmentFileExists) - { - segmentFileExists = File.Exists(segmentPath); - } - if (segmentFileExists) - { - return await GetSegmentResult(state, segmentPath, segmentIndex, transcodingJob).ConfigureAwait(false); - } - //break; + return await GetSegmentResult(state, segmentPath, segmentIndex, transcodingJob).ConfigureAwait(false); } } - catch (IOException) + else { - // May get an error if the file is locked + segmentExists = File.Exists(segmentPath); + if (segmentExists) + { + continue; // avoid unnecessary waiting if segment just became available + } } - await Task.Delay(100, cancellationToken).ConfigureAwait(false); } diff --git a/deployment/debian-package-x64/docker-build.sh b/deployment/debian-package-x64/docker-build.sh index 97bc45a060..5911923d78 100755 --- a/deployment/debian-package-x64/docker-build.sh +++ b/deployment/debian-package-x64/docker-build.sh @@ -20,6 +20,7 @@ if [[ -n ${web_branch} ]]; then checkout -b origin/${web_branch} fi yarn install +yarn build mkdir -p ${web_target} mv dist/* ${web_target}/ popd From 7aea9266d05ddd0673c390e102833c154b3ff9f6 Mon Sep 17 00:00:00 2001 From: Vasily Date: Tue, 8 Oct 2019 16:34:43 +0300 Subject: [PATCH 009/177] Stop waiting for a segment to become ready if there's no alive transcode Remove extra quotes in logging Fix typo in comment --- .../Playback/BaseStreamingService.cs | 4 ++-- .../Playback/Hls/DynamicHlsService.cs | 22 +++++++++++++++---- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/MediaBrowser.Api/Playback/BaseStreamingService.cs b/MediaBrowser.Api/Playback/BaseStreamingService.cs index 700883c963..2e9c1c3d4c 100644 --- a/MediaBrowser.Api/Playback/BaseStreamingService.cs +++ b/MediaBrowser.Api/Playback/BaseStreamingService.cs @@ -297,12 +297,12 @@ namespace MediaBrowser.Api.Playback // Wait for the file to exist before proceeeding var waitFor = state.WaitForPath ?? outputPath; - Logger.LogDebug("Waiting for the creation of '{0}'", waitFor); + Logger.LogDebug("Waiting for the creation of {0}", waitFor); while (!File.Exists(waitFor) && !transcodingJob.HasExited) { await Task.Delay(100, cancellationTokenSource.Token).ConfigureAwait(false); } - Logger.LogDebug("File '{0}' created or transcoding has finished", waitFor); + Logger.LogDebug("File {0} created or transcoding has finished", waitFor); if (state.IsInputVideo && transcodingJob.Type == TranscodingJobType.Progressive && !transcodingJob.HasExited) { diff --git a/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs b/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs index 15dd5add4a..a06a2f84d9 100644 --- a/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs +++ b/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs @@ -192,6 +192,7 @@ namespace MediaBrowser.Api.Playback.Hls if (File.Exists(segmentPath)) { job = ApiEntryPoint.Instance.OnTranscodeBeginRequest(playlistPath, TranscodingJobType); + Logger.LogDebug("returning {0} [it exists, try 1]", segmentPath); return await GetSegmentResult(state, playlistPath, segmentPath, segmentExtension, requestedIndex, job, cancellationToken).ConfigureAwait(false); } @@ -207,6 +208,7 @@ namespace MediaBrowser.Api.Playback.Hls job = ApiEntryPoint.Instance.OnTranscodeBeginRequest(playlistPath, TranscodingJobType); transcodingLock.Release(); released = true; + Logger.LogDebug("returning {0} [it exists, try 2]", segmentPath); return await GetSegmentResult(state, playlistPath, segmentPath, segmentExtension, requestedIndex, job, cancellationToken).ConfigureAwait(false); } else @@ -278,7 +280,7 @@ namespace MediaBrowser.Api.Playback.Hls // await Task.Delay(50, cancellationToken).ConfigureAwait(false); //} - Logger.LogInformation("returning {0}", segmentPath); + Logger.LogDebug("returning {0} [general case]", segmentPath); job = job ?? ApiEntryPoint.Instance.OnTranscodeBeginRequest(playlistPath, TranscodingJobType); return await GetSegmentResult(state, playlistPath, segmentPath, segmentExtension, requestedIndex, job, cancellationToken).ConfigureAwait(false); } @@ -465,6 +467,7 @@ namespace MediaBrowser.Api.Playback.Hls if (transcodingJob != null && transcodingJob.HasExited) { // Transcoding job is over, so assume all existing files are ready + Logger.LogDebug("serving up {0} as transcode is over", segmentPath); return await GetSegmentResult(state, segmentPath, segmentIndex, transcodingJob).ConfigureAwait(false); } @@ -473,19 +476,21 @@ namespace MediaBrowser.Api.Playback.Hls // If requested segment is less than transcoding position, we can't transcode backwards, so assume it's ready if (segmentIndex < currentTranscodingIndex) { + Logger.LogDebug("serving up {0} as transcode index {1} is past requested point {2}", segmentPath, segmentIndex, currentTranscodingIndex); return await GetSegmentResult(state, segmentPath, segmentIndex, transcodingJob).ConfigureAwait(false); } } var nextSegmentPath = GetSegmentPath(state, playlistPath, segmentIndex + 1); - while (!cancellationToken.IsCancellationRequested) + while (!cancellationToken.IsCancellationRequested && transcodingJob != null && !transcodingJob.HasExited) { // To be considered ready, the segment file has to exist AND - // either the transcoding job should be done or next segment should also exit + // either the transcoding job should be done or next segment should also exist if (segmentExists) { - if ((transcodingJob != null && transcodingJob.HasExited) || File.Exists(nextSegmentPath)) + if (transcodingJob.HasExited || File.Exists(nextSegmentPath)) { + Logger.LogDebug("serving up {0} as it deemed ready", segmentPath); return await GetSegmentResult(state, segmentPath, segmentIndex, transcodingJob).ConfigureAwait(false); } } @@ -501,6 +506,14 @@ namespace MediaBrowser.Api.Playback.Hls } cancellationToken.ThrowIfCancellationRequested(); + if (!File.Exists(segmentPath)) + { + Logger.LogWarning("cannot serve {0} as transcoding quit before we got there", segmentPath); + } + else + { + Logger.LogDebug("serving {0} as it's on disk and transcoding stopped", segmentPath); + } return await GetSegmentResult(state, segmentPath, segmentIndex, transcodingJob).ConfigureAwait(false); } @@ -514,6 +527,7 @@ namespace MediaBrowser.Api.Playback.Hls FileShare = FileShareMode.ReadWrite, OnComplete = () => { + Logger.LogDebug("finished serving {0}", segmentPath); if (transcodingJob != null) { transcodingJob.DownloadPositionTicks = Math.Max(transcodingJob.DownloadPositionTicks ?? segmentEndingPositionTicks, segmentEndingPositionTicks); From 3740228100b15c9feae1864f5652674af69e582c Mon Sep 17 00:00:00 2001 From: Vasily Date: Tue, 8 Oct 2019 17:00:16 +0300 Subject: [PATCH 010/177] Don't start waiting for a segment which doesn't exist if transcoding is not running --- .../Playback/Hls/DynamicHlsService.cs | 48 +++++++++++-------- 1 file changed, 28 insertions(+), 20 deletions(-) diff --git a/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs b/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs index a06a2f84d9..43cf924274 100644 --- a/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs +++ b/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs @@ -482,38 +482,46 @@ namespace MediaBrowser.Api.Playback.Hls } var nextSegmentPath = GetSegmentPath(state, playlistPath, segmentIndex + 1); - while (!cancellationToken.IsCancellationRequested && transcodingJob != null && !transcodingJob.HasExited) + if (transcodingJob != null) { - // To be considered ready, the segment file has to exist AND - // either the transcoding job should be done or next segment should also exist - if (segmentExists) + while (!cancellationToken.IsCancellationRequested && !transcodingJob.HasExited) { - if (transcodingJob.HasExited || File.Exists(nextSegmentPath)) + // To be considered ready, the segment file has to exist AND + // either the transcoding job should be done or next segment should also exist + if (segmentExists) { - Logger.LogDebug("serving up {0} as it deemed ready", segmentPath); - return await GetSegmentResult(state, segmentPath, segmentIndex, transcodingJob).ConfigureAwait(false); + if (transcodingJob.HasExited || File.Exists(nextSegmentPath)) + { + Logger.LogDebug("serving up {0} as it deemed ready", segmentPath); + return await GetSegmentResult(state, segmentPath, segmentIndex, transcodingJob).ConfigureAwait(false); + } } + else + { + segmentExists = File.Exists(segmentPath); + if (segmentExists) + { + continue; // avoid unnecessary waiting if segment just became available + } + } + await Task.Delay(100, cancellationToken).ConfigureAwait(false); + } + + cancellationToken.ThrowIfCancellationRequested(); + if (!File.Exists(segmentPath)) + { + Logger.LogWarning("cannot serve {0} as transcoding quit before we got there", segmentPath); } else { - segmentExists = File.Exists(segmentPath); - if (segmentExists) - { - continue; // avoid unnecessary waiting if segment just became available - } + Logger.LogDebug("serving {0} as it's on disk and transcoding stopped", segmentPath); } - await Task.Delay(100, cancellationToken).ConfigureAwait(false); - } - - cancellationToken.ThrowIfCancellationRequested(); - if (!File.Exists(segmentPath)) - { - Logger.LogWarning("cannot serve {0} as transcoding quit before we got there", segmentPath); } else { - Logger.LogDebug("serving {0} as it's on disk and transcoding stopped", segmentPath); + Logger.LogWarning("cannot serve {0} as it doesn't exist and no transcode is running", segmentPath); } + return await GetSegmentResult(state, segmentPath, segmentIndex, transcodingJob).ConfigureAwait(false); } From 986ea5c636ead098446cca31ea737d2f361a05d8 Mon Sep 17 00:00:00 2001 From: Vasily Date: Wed, 9 Oct 2019 12:55:09 +0300 Subject: [PATCH 011/177] Fix log message - log args were swapped --- MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs b/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs index 43cf924274..069dd41d02 100644 --- a/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs +++ b/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs @@ -476,7 +476,7 @@ namespace MediaBrowser.Api.Playback.Hls // If requested segment is less than transcoding position, we can't transcode backwards, so assume it's ready if (segmentIndex < currentTranscodingIndex) { - Logger.LogDebug("serving up {0} as transcode index {1} is past requested point {2}", segmentPath, segmentIndex, currentTranscodingIndex); + Logger.LogDebug("serving up {0} as transcode index {1} is past requested point {2}", segmentPath, currentTranscodingIndex, segmentIndex); return await GetSegmentResult(state, segmentPath, segmentIndex, transcodingJob).ConfigureAwait(false); } } From 2f6879e8699e53c3d140dacd9af8c207bdf8cb74 Mon Sep 17 00:00:00 2001 From: Vasily Date: Wed, 9 Oct 2019 13:46:01 +0300 Subject: [PATCH 012/177] Add limiting max keyframe interval when full transcoding --- MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs b/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs index 069dd41d02..8cbe4af1e8 100644 --- a/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs +++ b/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs @@ -927,6 +927,18 @@ namespace MediaBrowser.Api.Playback.Hls " -force_key_frames:0 \"expr:gte(t,{0}+n_forced*{1})\"", GetStartNumber(state) * state.SegmentLength, state.SegmentLength.ToString(CultureInfo.InvariantCulture)); + if (state.TargetFramerate.HasValue) + { + // This is to make sure keyframe interval is limited to our segment, + // as forcing keyframes is not enough. + // Example: we ecoded half of desired length, then codec detected + // scene cut and inserted a keyframe; next forced keyframe would + // be created outside of segment, which breaks seeking. + keyFrameArg += string.Format( + " -g {0} -keyint_min {0}", + (int)(state.SegmentLength * state.TargetFramerate) + ); + } var hasGraphicalSubs = state.SubtitleStream != null && !state.SubtitleStream.IsTextSubtitleStream && state.SubtitleDeliveryMethod == SubtitleDeliveryMethod.Encode; From 82f8345aa5ae65a8a934a4f2d29afdbc3836d875 Mon Sep 17 00:00:00 2001 From: Vasily Date: Thu, 10 Oct 2019 18:47:02 +0300 Subject: [PATCH 013/177] Log to debug all HTTP 500 response urls --- Emby.Server.Implementations/HttpServer/HttpListenerHost.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Emby.Server.Implementations/HttpServer/HttpListenerHost.cs b/Emby.Server.Implementations/HttpServer/HttpListenerHost.cs index e4f98acb9b..0ebdf7d178 100644 --- a/Emby.Server.Implementations/HttpServer/HttpListenerHost.cs +++ b/Emby.Server.Implementations/HttpServer/HttpListenerHost.cs @@ -539,6 +539,10 @@ namespace Emby.Server.Implementations.HttpServer } finally { + if (httpRes.StatusCode >= 500) + { + _logger.LogDebug("Sending HTTP Response 500 in response to {Url}", urlToLog); + } stopWatch.Stop(); var elapsed = stopWatch.Elapsed; if (elapsed.TotalMilliseconds > 500) From 1bd12083c3d7eda02bd7e3b785f4853620dc6cc9 Mon Sep 17 00:00:00 2001 From: Vasily Date: Mon, 14 Oct 2019 13:12:10 +0300 Subject: [PATCH 014/177] Respect non-inversed setting of "enable break on non-keyframes" --- MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs b/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs index 991fc0b001..0aa0679045 100644 --- a/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs +++ b/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs @@ -2168,7 +2168,8 @@ namespace MediaBrowser.Controller.MediaEncoding // Important: If this is ever re-enabled, make sure not to use it with wtv because it breaks seeking if (!string.Equals(state.InputContainer, "wtv", StringComparison.OrdinalIgnoreCase) && state.TranscodingType != TranscodingJobType.Progressive - && state.EnableBreakOnNonKeyFrames(outputVideoCodec)) + && !state.EnableBreakOnNonKeyFrames(outputVideoCodec) && + (state.BaseRequest.StartTimeTicks ?? 0) > 0) { inputModifier += " -noaccurate_seek"; } From 3132280b0748efd6ded7d8c9d8795506ef8c30ed Mon Sep 17 00:00:00 2001 From: Vasily Date: Mon, 14 Oct 2019 13:13:04 +0300 Subject: [PATCH 015/177] * Make sure force_key_frames expression arguments are properly converted to strings * Fore usage of keyframe cuts only in HLS --- MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs b/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs index 8cbe4af1e8..1b93eaaa57 100644 --- a/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs +++ b/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs @@ -925,7 +925,7 @@ namespace MediaBrowser.Api.Playback.Hls { var keyFrameArg = string.Format( " -force_key_frames:0 \"expr:gte(t,{0}+n_forced*{1})\"", - GetStartNumber(state) * state.SegmentLength, + (GetStartNumber(state) * state.SegmentLength).ToString(CultureInfo.InvariantCulture), state.SegmentLength.ToString(CultureInfo.InvariantCulture)); if (state.TargetFramerate.HasValue) { @@ -936,7 +936,7 @@ namespace MediaBrowser.Api.Playback.Hls // be created outside of segment, which breaks seeking. keyFrameArg += string.Format( " -g {0} -keyint_min {0}", - (int)(state.SegmentLength * state.TargetFramerate) + ((int)(state.SegmentLength * state.TargetFramerate)).ToString(CultureInfo.InvariantCulture) ); } @@ -982,6 +982,15 @@ namespace MediaBrowser.Api.Playback.Hls var threads = EncodingHelper.GetNumberOfThreads(state, encodingOptions, videoCodec); + if (state.BaseRequest.BreakOnNonKeyFrames) + { + // FIXME: this is actually a workaround, as ideally it really should be the client which decides whether non-keyframe + // breakpoints are supported; but current implementation always uses "ffmpeg input seeking" which is liable + // to produce a missing part of video stream before first keyframe is encountered, which may lead to + // awkward cases like a few starting HLS segments having no video whatsoever, which breaks hls.js + Logger.LogInformation("Current HLS implementation doesn't support non-keyframe breaks but one is requested, ignoring that request"); + state.BaseRequest.BreakOnNonKeyFrames = false; + } var inputModifier = EncodingHelper.GetInputModifier(state, encodingOptions); // If isEncoding is true we're actually starting ffmpeg From adccc18298f4ebba511b68d5af9e72f78de5e5e8 Mon Sep 17 00:00:00 2001 From: Vasily Date: Mon, 14 Oct 2019 13:15:41 +0300 Subject: [PATCH 016/177] Revert "yarn build" as it is fixed in master, fix typo --- MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs | 2 +- deployment/debian-package-x64/docker-build.sh | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs b/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs index 1b93eaaa57..a95db53e42 100644 --- a/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs +++ b/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs @@ -931,7 +931,7 @@ namespace MediaBrowser.Api.Playback.Hls { // This is to make sure keyframe interval is limited to our segment, // as forcing keyframes is not enough. - // Example: we ecoded half of desired length, then codec detected + // Example: we encoded half of desired length, then codec detected // scene cut and inserted a keyframe; next forced keyframe would // be created outside of segment, which breaks seeking. keyFrameArg += string.Format( diff --git a/deployment/debian-package-x64/docker-build.sh b/deployment/debian-package-x64/docker-build.sh index 5911923d78..97bc45a060 100755 --- a/deployment/debian-package-x64/docker-build.sh +++ b/deployment/debian-package-x64/docker-build.sh @@ -20,7 +20,6 @@ if [[ -n ${web_branch} ]]; then checkout -b origin/${web_branch} fi yarn install -yarn build mkdir -p ${web_target} mv dist/* ${web_target}/ popd From 9ad781324ebdfb9679a0dcf4258195a870c0826c Mon Sep 17 00:00:00 2001 From: Anthony Lavado Date: Tue, 15 Oct 2019 04:24:30 -0400 Subject: [PATCH 017/177] Fix up Setup Type dialog, and add logic for basic setup Fix up the Setup Type dialog, by removing an unused function from the page. Adds logic to the installer to check for a basic or advanced setup choice. Ensures that the service is only installed if the "advanced" method is chosen. Note - it may be possible to remove some defaults from the .onInit, considering they get set through the program now. --- deployment/windows/dialogs/setuptype.nsdinc | 6 +--- deployment/windows/jellyfin.nsi | 34 ++++++++++++++++++--- 2 files changed, 30 insertions(+), 10 deletions(-) diff --git a/deployment/windows/dialogs/setuptype.nsdinc b/deployment/windows/dialogs/setuptype.nsdinc index 0b171da282..6c30119331 100644 --- a/deployment/windows/dialogs/setuptype.nsdinc +++ b/deployment/windows/dialogs/setuptype.nsdinc @@ -49,8 +49,4 @@ Function fnc_setuptype_Create FunctionEnd -; dialog show function -Function fnc_setuptype_Show - Call fnc_setuptype_Create - nsDialogs::Show -FunctionEnd + diff --git a/deployment/windows/jellyfin.nsi b/deployment/windows/jellyfin.nsi index b8de4a4401..375c3cd798 100644 --- a/deployment/windows/jellyfin.nsi +++ b/deployment/windows/jellyfin.nsi @@ -89,9 +89,10 @@ ShowUninstDetails show !insertmacro MUI_PAGE_LICENSE "$%InstallLocation%\LICENSE" ; picking up generic GPL ; Setup Type Page - Page custom ShowSetupTypePage ;SetupTypePage_Config + Page custom ShowSetupTypePage SetupTypePage_Config ; Components Page + !define MUI_PAGE_CUSTOMFUNCTION_PRE HideComponentsPage !insertmacro MUI_PAGE_COMPONENTS !define MUI_PAGE_CUSTOMFUNCTION_PRE HideInstallDirectoryPage ; Controls when to hide / show !define MUI_DIRECTORYPAGE_TEXT_DESTINATION "Install folder" ; shows just above the folder selection dialog @@ -185,8 +186,8 @@ Section "!Jellyfin Server (required)" InstallJellyfinServer WriteUninstaller "$INSTDIR\Uninstall.exe" SectionEnd -Section /o "Jellyfin Server Service" InstallService - +Section "Jellyfin Server Service" InstallService +${If} $_INSTALLSERVICE_ == "Yes" ; Only run this if we're going to install the service! ExecWait '"$INSTDIR\nssm.exe" statuscode JellyfinServer' $0 DetailPrint "Jellyfin Server service statuscode, $0" ${If} $0 == 0 @@ -246,6 +247,7 @@ Section /o "Jellyfin Server Service" InstallService ${EndIf} DetailPrint "Jellyfin Server service account change, $0" ${EndIf} +${EndIf} SectionEnd @@ -327,7 +329,7 @@ SectionEnd Function .onInit ; Setting up defaults - StrCpy $_INSTALLSERVICE_ "No" + StrCpy $_INSTALLSERVICE_ "Yes" StrCpy $_SERVICESTART_ "Yes" StrCpy $_SERVICEACCOUNTTYPE_ "NetworkService" StrCpy $_EXISTINGINSTALLATION_ "No" @@ -420,7 +422,13 @@ Function HideConfirmationPage FunctionEnd Function HideSetupTypePage - ${If} $_EXISTINGINSTALLATION_ == "Yes" ; Existing installation detected, so don't ask for InstallFolder + ${If} $_EXISTINGINSTALLATION_ == "Yes" ; Existing installation detected, so don't ask for SetupType + Abort + ${EndIf} +FunctionEnd + +Function HideComponentsPage + ${If} $_SETUPTYPE_ == "Basic" ; Basic installation chosen, don't show components choice Abort ${EndIf} FunctionEnd @@ -450,6 +458,22 @@ FunctionEnd Var StartServiceAfterInstall Var UseNetworkServiceAccount Var UseLocalSystemAccount +Var BasicInstall + + +Function SetupTypePage_Config +${NSD_GetState} $hCtl_setuptype_BasicInstall $BasicInstall +${If} $BasicInstall == 1 + StrCpy $_SETUPTYPE_ "Basic" + StrCpy $_INSTALLSERVICE_ "No" + StrCpy $_SERVICESTART_ "No" + StrCpy $_SERVICEACCOUNTTYPE_ "None" +${Else} + StrCpy $_SETUPTYPE_ "Advanced" + StrCpy $_INSTALLSERVICE_ "Yes" +${EndIf} + +FunctionEnd Function ServiceConfigPage_Config ${NSD_GetState} $hCtl_service_config_StartServiceAfterInstall $StartServiceAfterInstall From 5edb8159a7f8966d09cb222f366d7403a9bf723b Mon Sep 17 00:00:00 2001 From: Bond_009 Date: Tue, 15 Oct 2019 17:49:49 +0200 Subject: [PATCH 018/177] Fix Json serialization error --- .../Playlists/ManualPlaylistsFolder.cs | 8 +- .../Services/ServicePath.cs | 19 +- .../MediaBrowser.Common.csproj | 1 - MediaBrowser.Controller/Channels/Channel.cs | 6 +- .../Entities/AggregateFolder.cs | 8 +- .../Entities/Audio/Audio.cs | 22 +-- .../Entities/Audio/MusicAlbum.cs | 18 +- .../Entities/Audio/MusicArtist.cs | 22 +-- .../Entities/Audio/MusicGenre.cs | 12 +- MediaBrowser.Controller/Entities/AudioBook.cs | 12 +- MediaBrowser.Controller/Entities/BaseItem.cs | 182 +++++++++--------- .../Entities/BasePluginFolder.cs | 8 +- MediaBrowser.Controller/Entities/Book.cs | 10 +- .../Entities/CollectionFolder.cs | 15 +- MediaBrowser.Controller/Entities/Folder.cs | 34 ++-- MediaBrowser.Controller/Entities/Genre.cs | 10 +- .../Entities/ItemImageInfo.cs | 4 +- .../Entities/LinkedChild.cs | 4 +- .../Entities/Movies/BoxSet.cs | 12 +- .../Entities/Movies/Movie.cs | 6 +- .../Entities/MusicVideo.cs | 4 +- MediaBrowser.Controller/Entities/Person.cs | 10 +- MediaBrowser.Controller/Entities/Photo.cs | 10 +- .../Entities/PhotoAlbum.cs | 8 +- MediaBrowser.Controller/Entities/Studio.cs | 10 +- .../Entities/TV/Episode.cs | 36 ++-- MediaBrowser.Controller/Entities/TV/Season.cs | 24 +-- MediaBrowser.Controller/Entities/TV/Series.cs | 14 +- MediaBrowser.Controller/Entities/Trailer.cs | 4 +- MediaBrowser.Controller/Entities/User.cs | 18 +- .../Entities/UserItemData.cs | 4 +- .../Entities/UserRootFolder.cs | 10 +- MediaBrowser.Controller/Entities/UserView.cs | 10 +- MediaBrowser.Controller/Entities/Video.cs | 36 ++-- MediaBrowser.Controller/Entities/Year.cs | 8 +- .../LiveTv/LiveTvChannel.cs | 26 +-- .../LiveTv/LiveTvProgram.cs | 38 ++-- MediaBrowser.Controller/LiveTv/TimerInfo.cs | 6 +- MediaBrowser.Controller/Playlists/Playlist.cs | 22 +-- .../Session/SessionInfo.cs | 4 +- MediaBrowser.Model/Dto/BaseItemPerson.cs | 4 +- MediaBrowser.Model/Dto/MediaSourceInfo.cs | 6 +- MediaBrowser.Model/MediaBrowser.Model.csproj | 1 + .../IgnoreDataMemberAttribute.cs | 12 -- .../Updates/PackageVersionInfo.cs | 4 +- 45 files changed, 364 insertions(+), 378 deletions(-) delete mode 100644 MediaBrowser.Model/Serialization/IgnoreDataMemberAttribute.cs diff --git a/Emby.Server.Implementations/Playlists/ManualPlaylistsFolder.cs b/Emby.Server.Implementations/Playlists/ManualPlaylistsFolder.cs index f4decc856e..de51a37ab7 100644 --- a/Emby.Server.Implementations/Playlists/ManualPlaylistsFolder.cs +++ b/Emby.Server.Implementations/Playlists/ManualPlaylistsFolder.cs @@ -1,9 +1,9 @@ using System.Collections.Generic; using System.Linq; +using System.Text.Json.Serialization; using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Playlists; using MediaBrowser.Model.Querying; -using MediaBrowser.Model.Serialization; namespace Emby.Server.Implementations.Playlists { @@ -24,13 +24,13 @@ namespace Emby.Server.Implementations.Playlists return base.GetEligibleChildrenForRecursiveChildren(user).OfType(); } - [IgnoreDataMember] + [JsonIgnore] public override bool IsHidden => true; - [IgnoreDataMember] + [JsonIgnore] public override bool SupportsInheritedParentImages => false; - [IgnoreDataMember] + [JsonIgnore] public override string CollectionType => MediaBrowser.Model.Entities.CollectionType.Playlists; protected override QueryResult GetItemsInternal(InternalItemsQuery query) diff --git a/Emby.Server.Implementations/Services/ServicePath.cs b/Emby.Server.Implementations/Services/ServicePath.cs index ccb28e8df0..0b67669b94 100644 --- a/Emby.Server.Implementations/Services/ServicePath.cs +++ b/Emby.Server.Implementations/Services/ServicePath.cs @@ -4,6 +4,7 @@ using System.IO; using System.Linq; using System.Reflection; using System.Text; +using System.Text.Json.Serialization; namespace Emby.Server.Implementations.Services { @@ -28,6 +29,13 @@ namespace Emby.Server.Implementations.Services private readonly bool[] isWildcard; private readonly int wildcardCount = 0; + internal static string[] IgnoreAttributesNamed = new[] + { + nameof(JsonIgnoreAttribute) + }; + + private static Type _excludeType = typeof(Stream); + public int VariableArgsCount { get; set; } /// @@ -190,21 +198,12 @@ namespace Emby.Server.Implementations.Services StringComparer.OrdinalIgnoreCase); } - internal static string[] IgnoreAttributesNamed = new[] - { - "IgnoreDataMemberAttribute", - "JsonIgnoreAttribute" - }; - - - private static Type excludeType = typeof(Stream); - internal static IEnumerable GetSerializableProperties(Type type) { foreach (var prop in GetPublicProperties(type)) { if (prop.GetMethod == null - || excludeType == prop.PropertyType) + || _excludeType == prop.PropertyType) { continue; } diff --git a/MediaBrowser.Common/MediaBrowser.Common.csproj b/MediaBrowser.Common/MediaBrowser.Common.csproj index dc1c967cdf..1a40f5ea2f 100644 --- a/MediaBrowser.Common/MediaBrowser.Common.csproj +++ b/MediaBrowser.Common/MediaBrowser.Common.csproj @@ -14,7 +14,6 @@ - diff --git a/MediaBrowser.Controller/Channels/Channel.cs b/MediaBrowser.Controller/Channels/Channel.cs index 89159973b8..cdf2ca69e6 100644 --- a/MediaBrowser.Controller/Channels/Channel.cs +++ b/MediaBrowser.Controller/Channels/Channel.cs @@ -1,11 +1,11 @@ using System; using System.Globalization; using System.Linq; +using System.Text.Json.Serialization; using System.Threading; using MediaBrowser.Common.Progress; using MediaBrowser.Controller.Entities; using MediaBrowser.Model.Querying; -using MediaBrowser.Model.Serialization; namespace MediaBrowser.Controller.Channels { @@ -31,10 +31,10 @@ namespace MediaBrowser.Controller.Channels return base.IsVisible(user); } - [IgnoreDataMember] + [JsonIgnore] public override bool SupportsInheritedParentImages => false; - [IgnoreDataMember] + [JsonIgnore] public override SourceType SourceType => SourceType.Channel; protected override QueryResult GetItemsInternal(InternalItemsQuery query) diff --git a/MediaBrowser.Controller/Entities/AggregateFolder.cs b/MediaBrowser.Controller/Entities/AggregateFolder.cs index 054df21e52..cacda81406 100644 --- a/MediaBrowser.Controller/Entities/AggregateFolder.cs +++ b/MediaBrowser.Controller/Entities/AggregateFolder.cs @@ -2,13 +2,13 @@ using System; using System.Collections.Concurrent; using System.Collections.Generic; using System.Linq; +using System.Text.Json.Serialization; using System.Threading; using System.Threading.Tasks; using MediaBrowser.Controller.IO; using MediaBrowser.Controller.Library; using MediaBrowser.Controller.Providers; using MediaBrowser.Model.IO; -using MediaBrowser.Model.Serialization; namespace MediaBrowser.Controller.Entities { @@ -23,7 +23,7 @@ namespace MediaBrowser.Controller.Entities PhysicalLocationsList = Array.Empty(); } - [IgnoreDataMember] + [JsonIgnore] public override bool IsPhysicalRoot => true; public override bool CanDelete() @@ -31,7 +31,7 @@ namespace MediaBrowser.Controller.Entities return false; } - [IgnoreDataMember] + [JsonIgnore] public override bool SupportsPlayedStatus => false; /// @@ -45,7 +45,7 @@ namespace MediaBrowser.Controller.Entities /// The virtual children. public ConcurrentBag VirtualChildren => _virtualChildren; - [IgnoreDataMember] + [JsonIgnore] public override string[] PhysicalLocations => PhysicalLocationsList; public string[] PhysicalLocationsList { get; set; } diff --git a/MediaBrowser.Controller/Entities/Audio/Audio.cs b/MediaBrowser.Controller/Entities/Audio/Audio.cs index 67b21068ae..a700d0be48 100644 --- a/MediaBrowser.Controller/Entities/Audio/Audio.cs +++ b/MediaBrowser.Controller/Entities/Audio/Audio.cs @@ -1,12 +1,12 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Text.Json.Serialization; using MediaBrowser.Controller.Persistence; using MediaBrowser.Controller.Providers; using MediaBrowser.Model.Configuration; using MediaBrowser.Model.Dto; using MediaBrowser.Model.Entities; -using MediaBrowser.Model.Serialization; namespace MediaBrowser.Controller.Entities.Audio { @@ -21,11 +21,11 @@ namespace MediaBrowser.Controller.Entities.Audio IHasMediaSources { /// - [IgnoreDataMember] + [JsonIgnore] public IReadOnlyList Artists { get; set; } /// - [IgnoreDataMember] + [JsonIgnore] public IReadOnlyList AlbumArtists { get; set; } public Audio() @@ -39,22 +39,22 @@ namespace MediaBrowser.Controller.Entities.Audio return 1; } - [IgnoreDataMember] + [JsonIgnore] public override bool SupportsPlayedStatus => true; - [IgnoreDataMember] + [JsonIgnore] public override bool SupportsPeople => false; - [IgnoreDataMember] + [JsonIgnore] public override bool SupportsAddingToPlaylist => true; - [IgnoreDataMember] + [JsonIgnore] public override bool SupportsInheritedParentImages => true; - [IgnoreDataMember] + [JsonIgnore] protected override bool SupportsOwnedItems => false; - [IgnoreDataMember] + [JsonIgnore] public override Folder LatestItemsIndexContainer => AlbumEntity; public override bool CanDownload() @@ -62,14 +62,14 @@ namespace MediaBrowser.Controller.Entities.Audio return IsFileProtocol; } - [IgnoreDataMember] + [JsonIgnore] public MusicAlbum AlbumEntity => FindParent(); /// /// Gets the type of the media. /// /// The type of the media. - [IgnoreDataMember] + [JsonIgnore] public override string MediaType => Model.Entities.MediaType.Audio; /// diff --git a/MediaBrowser.Controller/Entities/Audio/MusicAlbum.cs b/MediaBrowser.Controller/Entities/Audio/MusicAlbum.cs index edf6ffa213..c216176e7f 100644 --- a/MediaBrowser.Controller/Entities/Audio/MusicAlbum.cs +++ b/MediaBrowser.Controller/Entities/Audio/MusicAlbum.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Text.Json.Serialization; using System.Threading; using System.Threading.Tasks; using MediaBrowser.Controller.Dto; @@ -8,7 +9,6 @@ using MediaBrowser.Controller.Library; using MediaBrowser.Controller.Providers; using MediaBrowser.Model.Configuration; using MediaBrowser.Model.Entities; -using MediaBrowser.Model.Serialization; using MediaBrowser.Model.Users; namespace MediaBrowser.Controller.Entities.Audio @@ -30,13 +30,13 @@ namespace MediaBrowser.Controller.Entities.Audio AlbumArtists = Array.Empty(); } - [IgnoreDataMember] + [JsonIgnore] public override bool SupportsAddingToPlaylist => true; - [IgnoreDataMember] + [JsonIgnore] public override bool SupportsInheritedParentImages => true; - [IgnoreDataMember] + [JsonIgnore] public MusicArtist MusicArtist => GetMusicArtist(new DtoOptions(true)); public MusicArtist GetMusicArtist(DtoOptions options) @@ -58,23 +58,23 @@ namespace MediaBrowser.Controller.Entities.Audio return null; } - [IgnoreDataMember] + [JsonIgnore] public override bool SupportsPlayedStatus => false; - [IgnoreDataMember] + [JsonIgnore] public override bool SupportsCumulativeRunTimeTicks => true; - [IgnoreDataMember] + [JsonIgnore] public string AlbumArtist => AlbumArtists.FirstOrDefault(); - [IgnoreDataMember] + [JsonIgnore] public override bool SupportsPeople => false; /// /// Gets the tracks. /// /// The tracks. - [IgnoreDataMember] + [JsonIgnore] public IEnumerable public class MusicArtist : Folder, IItemByName, IHasMusicGenres, IHasDualAccess, IHasLookupInfo { - [IgnoreDataMember] + [JsonIgnore] public bool IsAccessedByName => ParentId.Equals(Guid.Empty); - [IgnoreDataMember] + [JsonIgnore] public override bool IsFolder => !IsAccessedByName; - [IgnoreDataMember] + [JsonIgnore] public override bool SupportsInheritedParentImages => false; - [IgnoreDataMember] + [JsonIgnore] public override bool SupportsCumulativeRunTimeTicks => true; - [IgnoreDataMember] + [JsonIgnore] public override bool IsDisplayedAsFolder => true; - [IgnoreDataMember] + [JsonIgnore] public override bool SupportsAddingToPlaylist => true; - [IgnoreDataMember] + [JsonIgnore] public override bool SupportsPlayedStatus => false; public override double GetDefaultPrimaryImageAspectRatio() @@ -60,7 +60,7 @@ namespace MediaBrowser.Controller.Entities.Audio return LibraryManager.GetItemList(query); } - [IgnoreDataMember] + [JsonIgnore] public override IEnumerable Children { get @@ -117,7 +117,7 @@ namespace MediaBrowser.Controller.Entities.Audio /// If the item is a folder, it returns the folder itself /// /// The containing folder path. - [IgnoreDataMember] + [JsonIgnore] public override string ContainingFolderPath => Path; /// @@ -164,7 +164,7 @@ namespace MediaBrowser.Controller.Entities.Audio return info; } - [IgnoreDataMember] + [JsonIgnore] public override bool SupportsPeople => false; public static string GetPath(string name) diff --git a/MediaBrowser.Controller/Entities/Audio/MusicGenre.cs b/MediaBrowser.Controller/Entities/Audio/MusicGenre.cs index d26aaf2bb1..537e9630be 100644 --- a/MediaBrowser.Controller/Entities/Audio/MusicGenre.cs +++ b/MediaBrowser.Controller/Entities/Audio/MusicGenre.cs @@ -1,7 +1,7 @@ using System; using System.Collections.Generic; +using System.Text.Json.Serialization; using MediaBrowser.Controller.Extensions; -using MediaBrowser.Model.Serialization; using Microsoft.Extensions.Logging; namespace MediaBrowser.Controller.Entities.Audio @@ -23,13 +23,13 @@ namespace MediaBrowser.Controller.Entities.Audio return GetUserDataKeys()[0]; } - [IgnoreDataMember] + [JsonIgnore] public override bool SupportsAddingToPlaylist => true; - [IgnoreDataMember] + [JsonIgnore] public override bool SupportsAncestors => false; - [IgnoreDataMember] + [JsonIgnore] public override bool IsDisplayedAsFolder => true; /// @@ -37,7 +37,7 @@ namespace MediaBrowser.Controller.Entities.Audio /// If the item is a folder, it returns the folder itself /// /// The containing folder path. - [IgnoreDataMember] + [JsonIgnore] public override string ContainingFolderPath => Path; public override double GetDefaultPrimaryImageAspectRatio() @@ -55,7 +55,7 @@ namespace MediaBrowser.Controller.Entities.Audio return true; } - [IgnoreDataMember] + [JsonIgnore] public override bool SupportsPeople => false; public IList GetTaggedItems(InternalItemsQuery query) diff --git a/MediaBrowser.Controller/Entities/AudioBook.cs b/MediaBrowser.Controller/Entities/AudioBook.cs index 65c8a5fdd0..a13873bf96 100644 --- a/MediaBrowser.Controller/Entities/AudioBook.cs +++ b/MediaBrowser.Controller/Entities/AudioBook.cs @@ -1,23 +1,23 @@ using System; +using System.Text.Json.Serialization; using MediaBrowser.Controller.Providers; using MediaBrowser.Model.Configuration; -using MediaBrowser.Model.Serialization; namespace MediaBrowser.Controller.Entities { public class AudioBook : Audio.Audio, IHasSeries, IHasLookupInfo { - [IgnoreDataMember] + [JsonIgnore] public override bool SupportsPositionTicksResume => true; - [IgnoreDataMember] + [JsonIgnore] public override bool SupportsPlayedStatus => true; - [IgnoreDataMember] + [JsonIgnore] public string SeriesPresentationUniqueKey { get; set; } - [IgnoreDataMember] + [JsonIgnore] public string SeriesName { get; set; } - [IgnoreDataMember] + [JsonIgnore] public Guid SeriesId { get; set; } public string FindSeriesSortName() diff --git a/MediaBrowser.Controller/Entities/BaseItem.cs b/MediaBrowser.Controller/Entities/BaseItem.cs index c3dc6f7f2d..599d41bb27 100644 --- a/MediaBrowser.Controller/Entities/BaseItem.cs +++ b/MediaBrowser.Controller/Entities/BaseItem.cs @@ -4,6 +4,7 @@ using System.Globalization; using System.IO; using System.Linq; using System.Text; +using System.Text.Json.Serialization; using System.Threading; using System.Threading.Tasks; using MediaBrowser.Common.Extensions; @@ -25,7 +26,6 @@ using MediaBrowser.Model.Library; using MediaBrowser.Model.LiveTv; using MediaBrowser.Model.MediaInfo; using MediaBrowser.Model.Providers; -using MediaBrowser.Model.Serialization; using MediaBrowser.Model.Users; using Microsoft.Extensions.Logging; @@ -40,7 +40,7 @@ namespace MediaBrowser.Controller.Entities /// The supported image extensions /// public static readonly string[] SupportedImageExtensions - = new [] { ".png", ".jpg", ".jpeg", ".tbn", ".gif" }; + = new[] { ".png", ".jpg", ".jpeg", ".tbn", ".gif" }; private static readonly List _supportedExtensions = new List(SupportedImageExtensions) { @@ -98,62 +98,62 @@ namespace MediaBrowser.Controller.Entities SampleFolderName }; - [IgnoreDataMember] + [JsonIgnore] public Guid[] ThemeSongIds { get; set; } - [IgnoreDataMember] + [JsonIgnore] public Guid[] ThemeVideoIds { get; set; } - [IgnoreDataMember] + [JsonIgnore] public string PreferredMetadataCountryCode { get; set; } - [IgnoreDataMember] + [JsonIgnore] public string PreferredMetadataLanguage { get; set; } public long? Size { get; set; } public string Container { get; set; } - [IgnoreDataMember] + [JsonIgnore] public string Tagline { get; set; } - [IgnoreDataMember] + [JsonIgnore] public virtual ItemImageInfo[] ImageInfos { get; set; } - [IgnoreDataMember] + [JsonIgnore] public bool IsVirtualItem { get; set; } /// /// Gets or sets the album. /// /// The album. - [IgnoreDataMember] + [JsonIgnore] public string Album { get; set; } /// /// Gets or sets the channel identifier. /// /// The channel identifier. - [IgnoreDataMember] + [JsonIgnore] public Guid ChannelId { get; set; } - [IgnoreDataMember] + [JsonIgnore] public virtual bool SupportsAddingToPlaylist => false; - [IgnoreDataMember] + [JsonIgnore] public virtual bool AlwaysScanInternalMetadataPath => false; /// /// Gets a value indicating whether this instance is in mixed folder. /// /// true if this instance is in mixed folder; otherwise, false. - [IgnoreDataMember] + [JsonIgnore] public bool IsInMixedFolder { get; set; } - [IgnoreDataMember] + [JsonIgnore] public virtual bool SupportsPlayedStatus => false; - [IgnoreDataMember] + [JsonIgnore] public virtual bool SupportsPositionTicksResume => false; - [IgnoreDataMember] + [JsonIgnore] public virtual bool SupportsRemoteImageDownloading => true; private string _name; @@ -161,7 +161,7 @@ namespace MediaBrowser.Controller.Entities /// Gets or sets the name. /// /// The name. - [IgnoreDataMember] + [JsonIgnore] public virtual string Name { get => _name; @@ -174,35 +174,35 @@ namespace MediaBrowser.Controller.Entities } } - [IgnoreDataMember] + [JsonIgnore] public bool IsUnaired => PremiereDate.HasValue && PremiereDate.Value.ToLocalTime().Date >= DateTime.Now.Date; - [IgnoreDataMember] + [JsonIgnore] public int? TotalBitrate { get; set; } - [IgnoreDataMember] + [JsonIgnore] public ExtraType? ExtraType { get; set; } - [IgnoreDataMember] + [JsonIgnore] public bool IsThemeMedia => ExtraType.HasValue && (ExtraType.Value == Model.Entities.ExtraType.ThemeSong || ExtraType.Value == Model.Entities.ExtraType.ThemeVideo); - [IgnoreDataMember] + [JsonIgnore] public string OriginalTitle { get; set; } /// /// Gets or sets the id. /// /// The id. - [IgnoreDataMember] + [JsonIgnore] public Guid Id { get; set; } - [IgnoreDataMember] + [JsonIgnore] public Guid OwnerId { get; set; } /// /// Gets or sets the audio. /// /// The audio. - [IgnoreDataMember] + [JsonIgnore] public ProgramAudio? Audio { get; set; } /// @@ -210,7 +210,7 @@ namespace MediaBrowser.Controller.Entities /// Default is based on the type for everything except actual generic folders. /// /// The display prefs id. - [IgnoreDataMember] + [JsonIgnore] public virtual Guid DisplayPreferencesId { get @@ -224,10 +224,10 @@ namespace MediaBrowser.Controller.Entities /// Gets or sets the path. /// /// The path. - [IgnoreDataMember] + [JsonIgnore] public virtual string Path { get; set; } - [IgnoreDataMember] + [JsonIgnore] public virtual SourceType SourceType { get @@ -245,7 +245,7 @@ namespace MediaBrowser.Controller.Entities /// Returns the folder containing the item. /// If the item is a folder, it returns the folder itself /// - [IgnoreDataMember] + [JsonIgnore] public virtual string ContainingFolderPath { get @@ -263,26 +263,26 @@ namespace MediaBrowser.Controller.Entities /// Gets or sets the name of the service. /// /// The name of the service. - [IgnoreDataMember] + [JsonIgnore] public string ServiceName { get; set; } /// /// If this content came from an external service, the id of the content on that service /// - [IgnoreDataMember] + [JsonIgnore] public string ExternalId { get; set; } - [IgnoreDataMember] + [JsonIgnore] public string ExternalSeriesId { get; set; } /// /// Gets or sets the etag. /// /// The etag. - [IgnoreDataMember] + [JsonIgnore] public string ExternalEtag { get; set; } - [IgnoreDataMember] + [JsonIgnore] public virtual bool IsHidden => false; public BaseItem GetOwner() @@ -295,7 +295,7 @@ namespace MediaBrowser.Controller.Entities /// Gets or sets the type of the location. /// /// The type of the location. - [IgnoreDataMember] + [JsonIgnore] public virtual LocationType LocationType { get @@ -320,7 +320,7 @@ namespace MediaBrowser.Controller.Entities } } - [IgnoreDataMember] + [JsonIgnore] public MediaProtocol? PathProtocol { get @@ -343,13 +343,13 @@ namespace MediaBrowser.Controller.Entities return current.HasValue && current.Value == protocol; } - [IgnoreDataMember] + [JsonIgnore] public bool IsFileProtocol => IsPathProtocol(MediaProtocol.File); - [IgnoreDataMember] + [JsonIgnore] public bool HasPathProtocol => PathProtocol.HasValue; - [IgnoreDataMember] + [JsonIgnore] public virtual bool SupportsLocalMetadata { get @@ -363,7 +363,7 @@ namespace MediaBrowser.Controller.Entities } } - [IgnoreDataMember] + [JsonIgnore] public virtual string FileNameWithoutExtension { get @@ -377,7 +377,7 @@ namespace MediaBrowser.Controller.Entities } } - [IgnoreDataMember] + [JsonIgnore] public virtual bool EnableAlphaNumericSorting => true; private List> GetSortChunks(string s1) @@ -418,7 +418,7 @@ namespace MediaBrowser.Controller.Entities /// This is just a helper for convenience /// /// The primary image path. - [IgnoreDataMember] + [JsonIgnore] public string PrimaryImagePath => this.GetImagePath(ImageType.Primary); public bool IsMetadataFetcherEnabled(LibraryOptions libraryOptions, string name) @@ -544,20 +544,20 @@ namespace MediaBrowser.Controller.Entities /// Gets or sets the date created. /// /// The date created. - [IgnoreDataMember] + [JsonIgnore] public DateTime DateCreated { get; set; } /// /// Gets or sets the date modified. /// /// The date modified. - [IgnoreDataMember] + [JsonIgnore] public DateTime DateModified { get; set; } - [IgnoreDataMember] + [JsonIgnore] public DateTime DateLastSaved { get; set; } - [IgnoreDataMember] + [JsonIgnore] public DateTime DateLastRefreshed { get; set; } /// @@ -583,24 +583,24 @@ namespace MediaBrowser.Controller.Entities return Name; } - [IgnoreDataMember] + [JsonIgnore] public bool IsLocked { get; set; } /// /// Gets or sets the locked fields. /// /// The locked fields. - [IgnoreDataMember] + [JsonIgnore] public MetadataFields[] LockedFields { get; set; } /// /// Gets the type of the media. /// /// The type of the media. - [IgnoreDataMember] + [JsonIgnore] public virtual string MediaType => null; - [IgnoreDataMember] + [JsonIgnore] public virtual string[] PhysicalLocations { get @@ -619,7 +619,7 @@ namespace MediaBrowser.Controller.Entities /// Gets or sets the name of the forced sort. /// /// The name of the forced sort. - [IgnoreDataMember] + [JsonIgnore] public string ForcedSortName { get => _forcedSortName; @@ -631,7 +631,7 @@ namespace MediaBrowser.Controller.Entities /// Gets the name of the sort. /// /// The name of the sort. - [IgnoreDataMember] + [JsonIgnore] public string SortName { get @@ -744,7 +744,7 @@ namespace MediaBrowser.Controller.Entities return builder.ToString().RemoveDiacritics(); } - [IgnoreDataMember] + [JsonIgnore] public bool EnableMediaSourceDisplay { get @@ -758,14 +758,14 @@ namespace MediaBrowser.Controller.Entities } } - [IgnoreDataMember] + [JsonIgnore] public Guid ParentId { get; set; } /// /// Gets or sets the parent. /// /// The parent. - [IgnoreDataMember] + [JsonIgnore] public Folder Parent { get => GetParent() as Folder; @@ -822,7 +822,7 @@ namespace MediaBrowser.Controller.Entities return null; } - [IgnoreDataMember] + [JsonIgnore] public virtual Guid DisplayParentId { get @@ -832,7 +832,7 @@ namespace MediaBrowser.Controller.Entities } } - [IgnoreDataMember] + [JsonIgnore] public BaseItem DisplayParent { get @@ -850,97 +850,97 @@ namespace MediaBrowser.Controller.Entities /// When the item first debuted. For movies this could be premiere date, episodes would be first aired /// /// The premiere date. - [IgnoreDataMember] + [JsonIgnore] public DateTime? PremiereDate { get; set; } /// /// Gets or sets the end date. /// /// The end date. - [IgnoreDataMember] + [JsonIgnore] public DateTime? EndDate { get; set; } /// /// Gets or sets the official rating. /// /// The official rating. - [IgnoreDataMember] + [JsonIgnore] public string OfficialRating { get; set; } - [IgnoreDataMember] + [JsonIgnore] public int InheritedParentalRatingValue { get; set; } /// /// Gets or sets the critic rating. /// /// The critic rating. - [IgnoreDataMember] + [JsonIgnore] public float? CriticRating { get; set; } /// /// Gets or sets the custom rating. /// /// The custom rating. - [IgnoreDataMember] + [JsonIgnore] public string CustomRating { get; set; } /// /// Gets or sets the overview. /// /// The overview. - [IgnoreDataMember] + [JsonIgnore] public string Overview { get; set; } /// /// Gets or sets the studios. /// /// The studios. - [IgnoreDataMember] + [JsonIgnore] public string[] Studios { get; set; } /// /// Gets or sets the genres. /// /// The genres. - [IgnoreDataMember] + [JsonIgnore] public string[] Genres { get; set; } /// /// Gets or sets the tags. /// /// The tags. - [IgnoreDataMember] + [JsonIgnore] public string[] Tags { get; set; } - [IgnoreDataMember] + [JsonIgnore] public string[] ProductionLocations { get; set; } /// /// Gets or sets the home page URL. /// /// The home page URL. - [IgnoreDataMember] + [JsonIgnore] public string HomePageUrl { get; set; } /// /// Gets or sets the community rating. /// /// The community rating. - [IgnoreDataMember] + [JsonIgnore] public float? CommunityRating { get; set; } /// /// Gets or sets the run time ticks. /// /// The run time ticks. - [IgnoreDataMember] + [JsonIgnore] public long? RunTimeTicks { get; set; } /// /// Gets or sets the production year. /// /// The production year. - [IgnoreDataMember] + [JsonIgnore] public int? ProductionYear { get; set; } /// @@ -948,20 +948,20 @@ namespace MediaBrowser.Controller.Entities /// This could be episode number, album track number, etc. /// /// The index number. - [IgnoreDataMember] + [JsonIgnore] public int? IndexNumber { get; set; } /// /// For an episode this could be the season number, or for a song this could be the disc number. /// /// The parent index number. - [IgnoreDataMember] + [JsonIgnore] public int? ParentIndexNumber { get; set; } - [IgnoreDataMember] + [JsonIgnore] public virtual bool HasLocalAlternateVersions => false; - [IgnoreDataMember] + [JsonIgnore] public string OfficialRatingForComparison { get @@ -982,7 +982,7 @@ namespace MediaBrowser.Controller.Entities } } - [IgnoreDataMember] + [JsonIgnore] public string CustomRatingForComparison { get @@ -1407,13 +1407,13 @@ namespace MediaBrowser.Controller.Entities } } - [IgnoreDataMember] + [JsonIgnore] protected virtual bool SupportsOwnedItems => !ParentId.Equals(Guid.Empty) && IsFileProtocol; - [IgnoreDataMember] + [JsonIgnore] public virtual bool SupportsPeople => false; - [IgnoreDataMember] + [JsonIgnore] public virtual bool SupportsThemeMedia => false; /// @@ -1613,10 +1613,10 @@ namespace MediaBrowser.Controller.Entities /// Gets or sets the provider ids. /// /// The provider ids. - [IgnoreDataMember] + [JsonIgnore] public Dictionary ProviderIds { get; set; } - [IgnoreDataMember] + [JsonIgnore] public virtual Folder LatestItemsIndexContainer => null; public virtual double GetDefaultPrimaryImageAspectRatio() @@ -1629,7 +1629,7 @@ namespace MediaBrowser.Controller.Entities return Id.ToString("N", CultureInfo.InvariantCulture); } - [IgnoreDataMember] + [JsonIgnore] public string PresentationUniqueKey { get; set; } public string GetPresentationUniqueKey() @@ -1934,7 +1934,7 @@ namespace MediaBrowser.Controller.Entities return IsVisibleStandaloneInternal(user, true); } - [IgnoreDataMember] + [JsonIgnore] public virtual bool SupportsInheritedParentImages => false; protected bool IsVisibleStandaloneInternal(User user, bool checkFolders) @@ -1977,10 +1977,10 @@ namespace MediaBrowser.Controller.Entities /// Gets a value indicating whether this instance is folder. /// /// true if this instance is folder; otherwise, false. - [IgnoreDataMember] + [JsonIgnore] public virtual bool IsFolder => false; - [IgnoreDataMember] + [JsonIgnore] public virtual bool IsDisplayedAsFolder => false; public virtual string GetClientTypeName() @@ -2066,7 +2066,7 @@ namespace MediaBrowser.Controller.Entities return null; } - [IgnoreDataMember] + [JsonIgnore] public virtual bool EnableRememberingTrackSelections => true; /// @@ -2776,7 +2776,7 @@ namespace MediaBrowser.Controller.Entities return null; } - [IgnoreDataMember] + [JsonIgnore] public virtual bool IsTopParent { get @@ -2804,10 +2804,10 @@ namespace MediaBrowser.Controller.Entities } } - [IgnoreDataMember] + [JsonIgnore] public virtual bool SupportsAncestors => true; - [IgnoreDataMember] + [JsonIgnore] public virtual bool StopRefreshIfLocalMetadataFound => true; public virtual IEnumerable GetIdsForAncestorQuery() diff --git a/MediaBrowser.Controller/Entities/BasePluginFolder.cs b/MediaBrowser.Controller/Entities/BasePluginFolder.cs index 8cdb9695cc..62d172fcc1 100644 --- a/MediaBrowser.Controller/Entities/BasePluginFolder.cs +++ b/MediaBrowser.Controller/Entities/BasePluginFolder.cs @@ -1,4 +1,4 @@ -using MediaBrowser.Model.Serialization; +using System.Text.Json.Serialization; namespace MediaBrowser.Controller.Entities { @@ -8,7 +8,7 @@ namespace MediaBrowser.Controller.Entities /// public abstract class BasePluginFolder : Folder, ICollectionFolder { - [IgnoreDataMember] + [JsonIgnore] public virtual string CollectionType => null; public override bool CanDelete() @@ -21,10 +21,10 @@ namespace MediaBrowser.Controller.Entities return true; } - [IgnoreDataMember] + [JsonIgnore] public override bool SupportsInheritedParentImages => false; - [IgnoreDataMember] + [JsonIgnore] public override bool SupportsPeople => false; //public override double? GetDefaultPrimaryImageAspectRatio() diff --git a/MediaBrowser.Controller/Entities/Book.cs b/MediaBrowser.Controller/Entities/Book.cs index 7a23d9a663..44c35374d7 100644 --- a/MediaBrowser.Controller/Entities/Book.cs +++ b/MediaBrowser.Controller/Entities/Book.cs @@ -1,21 +1,21 @@ using System; using System.Linq; +using System.Text.Json.Serialization; using MediaBrowser.Controller.Providers; using MediaBrowser.Model.Configuration; -using MediaBrowser.Model.Serialization; namespace MediaBrowser.Controller.Entities { public class Book : BaseItem, IHasLookupInfo, IHasSeries { - [IgnoreDataMember] + [JsonIgnore] public override string MediaType => Model.Entities.MediaType.Book; - [IgnoreDataMember] + [JsonIgnore] public string SeriesPresentationUniqueKey { get; set; } - [IgnoreDataMember] + [JsonIgnore] public string SeriesName { get; set; } - [IgnoreDataMember] + [JsonIgnore] public Guid SeriesId { get; set; } public string FindSeriesSortName() diff --git a/MediaBrowser.Controller/Entities/CollectionFolder.cs b/MediaBrowser.Controller/Entities/CollectionFolder.cs index 275052d48a..bc5e7467e3 100644 --- a/MediaBrowser.Controller/Entities/CollectionFolder.cs +++ b/MediaBrowser.Controller/Entities/CollectionFolder.cs @@ -2,14 +2,13 @@ using System; using System.Collections.Generic; using System.IO; using System.Linq; +using System.Text.Json.Serialization; using System.Threading; using System.Threading.Tasks; - using MediaBrowser.Controller.IO; using MediaBrowser.Controller.Library; using MediaBrowser.Controller.Providers; using MediaBrowser.Model.Configuration; -using MediaBrowser.Model.Extensions; using MediaBrowser.Model.IO; using MediaBrowser.Model.Serialization; @@ -33,10 +32,10 @@ namespace MediaBrowser.Controller.Entities PhysicalFolderIds = Array.Empty(); } - [IgnoreDataMember] + [JsonIgnore] public override bool SupportsPlayedStatus => false; - [IgnoreDataMember] + [JsonIgnore] public override bool SupportsInheritedParentImages => false; public override bool CanDelete() @@ -144,10 +143,10 @@ namespace MediaBrowser.Controller.Entities /// Allow different display preferences for each collection folder /// /// The display prefs id. - [IgnoreDataMember] + [JsonIgnore] public override Guid DisplayPreferencesId => Id; - [IgnoreDataMember] + [JsonIgnore] public override string[] PhysicalLocations => PhysicalLocationsList; public override bool IsSaveLocalMetadataEnabled() @@ -311,7 +310,7 @@ namespace MediaBrowser.Controller.Entities /// Our children are actually just references to the ones in the physical root... /// /// The actual children. - [IgnoreDataMember] + [JsonIgnore] public override IEnumerable Children => GetActualChildren(); public IEnumerable GetActualChildren() @@ -361,7 +360,7 @@ namespace MediaBrowser.Controller.Entities return result; } - [IgnoreDataMember] + [JsonIgnore] public override bool SupportsPeople => false; } } diff --git a/MediaBrowser.Controller/Entities/Folder.cs b/MediaBrowser.Controller/Entities/Folder.cs index d61a07066c..61cc208d7b 100644 --- a/MediaBrowser.Controller/Entities/Folder.cs +++ b/MediaBrowser.Controller/Entities/Folder.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Globalization; using System.IO; using System.Linq; +using System.Text.Json.Serialization; using System.Threading; using System.Threading.Tasks; using MediaBrowser.Common.Progress; @@ -18,7 +19,6 @@ using MediaBrowser.Controller.Providers; using MediaBrowser.Model.Dto; using MediaBrowser.Model.IO; using MediaBrowser.Model.Querying; -using MediaBrowser.Model.Serialization; using Microsoft.Extensions.Logging; namespace MediaBrowser.Controller.Entities @@ -39,7 +39,7 @@ namespace MediaBrowser.Controller.Entities public LinkedChild[] LinkedChildren { get; set; } - [IgnoreDataMember] + [JsonIgnore] public DateTime? DateLastMediaAdded { get; set; } public Folder() @@ -47,35 +47,35 @@ namespace MediaBrowser.Controller.Entities LinkedChildren = Array.Empty(); } - [IgnoreDataMember] + [JsonIgnore] public override bool SupportsThemeMedia => true; - [IgnoreDataMember] + [JsonIgnore] public virtual bool IsPreSorted => false; - [IgnoreDataMember] + [JsonIgnore] public virtual bool IsPhysicalRoot => false; - [IgnoreDataMember] + [JsonIgnore] public override bool SupportsInheritedParentImages => true; - [IgnoreDataMember] + [JsonIgnore] public override bool SupportsPlayedStatus => true; /// /// Gets a value indicating whether this instance is folder. /// /// true if this instance is folder; otherwise, false. - [IgnoreDataMember] + [JsonIgnore] public override bool IsFolder => true; - [IgnoreDataMember] + [JsonIgnore] public override bool IsDisplayedAsFolder => true; - [IgnoreDataMember] + [JsonIgnore] public virtual bool SupportsCumulativeRunTimeTicks => false; - [IgnoreDataMember] + [JsonIgnore] public virtual bool SupportsDateLastMediaAdded => false; public override bool CanDelete() @@ -100,7 +100,7 @@ namespace MediaBrowser.Controller.Entities return baseResult; } - [IgnoreDataMember] + [JsonIgnore] public override string FileNameWithoutExtension { get @@ -127,7 +127,7 @@ namespace MediaBrowser.Controller.Entities return true; } - [IgnoreDataMember] + [JsonIgnore] protected virtual bool SupportsShortcutChildren => false; /// @@ -162,14 +162,14 @@ namespace MediaBrowser.Controller.Entities /// Gets the actual children. /// /// The actual children. - [IgnoreDataMember] + [JsonIgnore] public virtual IEnumerable Children => LoadChildren(); /// /// thread-safe access to all recursive children of this folder - without regard to user /// /// The recursive children. - [IgnoreDataMember] + [JsonIgnore] public IEnumerable RecursiveChildren => GetRecursiveChildren(); public override bool IsVisible(User user) @@ -1428,7 +1428,7 @@ namespace MediaBrowser.Controller.Entities .Where(i => i.Item2 != null); } - [IgnoreDataMember] + [JsonIgnore] protected override bool SupportsOwnedItems => base.SupportsOwnedItems || SupportsShortcutChildren; protected override async Task RefreshedOwnedItems(MetadataRefreshOptions options, List fileSystemChildren, CancellationToken cancellationToken) @@ -1595,7 +1595,7 @@ namespace MediaBrowser.Controller.Entities return !IsPlayed(user); } - [IgnoreDataMember] + [JsonIgnore] public virtual bool SupportsUserDataFromChildren { get diff --git a/MediaBrowser.Controller/Entities/Genre.cs b/MediaBrowser.Controller/Entities/Genre.cs index 44cb62d225..773c7df341 100644 --- a/MediaBrowser.Controller/Entities/Genre.cs +++ b/MediaBrowser.Controller/Entities/Genre.cs @@ -1,8 +1,8 @@ using System; using System.Collections.Generic; +using System.Text.Json.Serialization; using MediaBrowser.Controller.Entities.Audio; using MediaBrowser.Controller.Extensions; -using MediaBrowser.Model.Serialization; using Microsoft.Extensions.Logging; namespace MediaBrowser.Controller.Entities @@ -34,13 +34,13 @@ namespace MediaBrowser.Controller.Entities /// If the item is a folder, it returns the folder itself /// /// The containing folder path. - [IgnoreDataMember] + [JsonIgnore] public override string ContainingFolderPath => Path; - [IgnoreDataMember] + [JsonIgnore] public override bool IsDisplayedAsFolder => true; - [IgnoreDataMember] + [JsonIgnore] public override bool SupportsAncestors => false; public override bool IsSaveLocalMetadataEnabled() @@ -61,7 +61,7 @@ namespace MediaBrowser.Controller.Entities return LibraryManager.GetItemList(query); } - [IgnoreDataMember] + [JsonIgnore] public override bool SupportsPeople => false; public static string GetPath(string name) diff --git a/MediaBrowser.Controller/Entities/ItemImageInfo.cs b/MediaBrowser.Controller/Entities/ItemImageInfo.cs index 8484938642..fc46dec2ef 100644 --- a/MediaBrowser.Controller/Entities/ItemImageInfo.cs +++ b/MediaBrowser.Controller/Entities/ItemImageInfo.cs @@ -1,6 +1,6 @@ using System; +using System.Text.Json.Serialization; using MediaBrowser.Model.Entities; -using MediaBrowser.Model.Serialization; namespace MediaBrowser.Controller.Entities { @@ -28,7 +28,7 @@ namespace MediaBrowser.Controller.Entities public int Height { get; set; } - [IgnoreDataMember] + [JsonIgnore] public bool IsLocalFile => Path == null || !Path.StartsWith("http", StringComparison.OrdinalIgnoreCase); } } diff --git a/MediaBrowser.Controller/Entities/LinkedChild.cs b/MediaBrowser.Controller/Entities/LinkedChild.cs index 8230604888..d88c31007a 100644 --- a/MediaBrowser.Controller/Entities/LinkedChild.cs +++ b/MediaBrowser.Controller/Entities/LinkedChild.cs @@ -1,8 +1,8 @@ using System; using System.Collections.Generic; using System.Globalization; +using System.Text.Json.Serialization; using MediaBrowser.Model.IO; -using MediaBrowser.Model.Serialization; namespace MediaBrowser.Controller.Entities { @@ -12,7 +12,7 @@ namespace MediaBrowser.Controller.Entities public LinkedChildType Type { get; set; } public string LibraryItemId { get; set; } - [IgnoreDataMember] + [JsonIgnore] public string Id { get; set; } /// diff --git a/MediaBrowser.Controller/Entities/Movies/BoxSet.cs b/MediaBrowser.Controller/Entities/Movies/BoxSet.cs index e7ac2a05c2..feaf8c45ac 100644 --- a/MediaBrowser.Controller/Entities/Movies/BoxSet.cs +++ b/MediaBrowser.Controller/Entities/Movies/BoxSet.cs @@ -1,11 +1,11 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Text.Json.Serialization; using MediaBrowser.Controller.Providers; using MediaBrowser.Model.Configuration; using MediaBrowser.Model.Entities; using MediaBrowser.Model.Querying; -using MediaBrowser.Model.Serialization; using MediaBrowser.Model.Users; namespace MediaBrowser.Controller.Entities.Movies @@ -24,13 +24,13 @@ namespace MediaBrowser.Controller.Entities.Movies DisplayOrder = ItemSortBy.PremiereDate; } - [IgnoreDataMember] + [JsonIgnore] protected override bool FilterLinkedChildrenPerUser => true; - [IgnoreDataMember] + [JsonIgnore] public override bool SupportsInheritedParentImages => false; - [IgnoreDataMember] + [JsonIgnore] public override bool SupportsPeople => true; /// @@ -79,7 +79,7 @@ namespace MediaBrowser.Controller.Entities.Movies return new List(); } - [IgnoreDataMember] + [JsonIgnore] private bool IsLegacyBoxSet { get @@ -98,7 +98,7 @@ namespace MediaBrowser.Controller.Entities.Movies } } - [IgnoreDataMember] + [JsonIgnore] public override bool IsPreSorted => true; public override bool IsAuthorizedToDelete(User user, List allCollectionFolders) diff --git a/MediaBrowser.Controller/Entities/Movies/Movie.cs b/MediaBrowser.Controller/Entities/Movies/Movie.cs index 184528fdc1..11dc472b61 100644 --- a/MediaBrowser.Controller/Entities/Movies/Movie.cs +++ b/MediaBrowser.Controller/Entities/Movies/Movie.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Text.Json.Serialization; using System.Threading; using System.Threading.Tasks; using MediaBrowser.Controller.Providers; @@ -8,7 +9,6 @@ using MediaBrowser.Model.Configuration; using MediaBrowser.Model.Entities; using MediaBrowser.Model.IO; using MediaBrowser.Model.Providers; -using MediaBrowser.Model.Serialization; namespace MediaBrowser.Controller.Entities.Movies { @@ -39,7 +39,7 @@ namespace MediaBrowser.Controller.Entities.Movies /// The name of the TMDB collection. public string TmdbCollectionName { get; set; } - [IgnoreDataMember] + [JsonIgnore] public string CollectionName { get => TmdbCollectionName; @@ -186,7 +186,7 @@ namespace MediaBrowser.Controller.Entities.Movies return list; } - [IgnoreDataMember] + [JsonIgnore] public override bool StopRefreshIfLocalMetadataFound => false; } } diff --git a/MediaBrowser.Controller/Entities/MusicVideo.cs b/MediaBrowser.Controller/Entities/MusicVideo.cs index 94fe11e9da..6032420635 100644 --- a/MediaBrowser.Controller/Entities/MusicVideo.cs +++ b/MediaBrowser.Controller/Entities/MusicVideo.cs @@ -1,16 +1,16 @@ using System; using System.Collections.Generic; +using System.Text.Json.Serialization; using MediaBrowser.Controller.Entities.Audio; using MediaBrowser.Controller.Providers; using MediaBrowser.Model.Configuration; -using MediaBrowser.Model.Serialization; namespace MediaBrowser.Controller.Entities { public class MusicVideo : Video, IHasArtist, IHasMusicGenres, IHasLookupInfo { /// - [IgnoreDataMember] + [JsonIgnore] public IReadOnlyList Artists { get; set; } public MusicVideo() diff --git a/MediaBrowser.Controller/Entities/Person.cs b/MediaBrowser.Controller/Entities/Person.cs index dd01834898..d9b4b22067 100644 --- a/MediaBrowser.Controller/Entities/Person.cs +++ b/MediaBrowser.Controller/Entities/Person.cs @@ -1,9 +1,9 @@ using System; using System.Collections.Generic; +using System.Text.Json.Serialization; using MediaBrowser.Controller.Extensions; using MediaBrowser.Controller.Providers; using MediaBrowser.Model.Entities; -using MediaBrowser.Model.Serialization; using Microsoft.Extensions.Logging; namespace MediaBrowser.Controller.Entities @@ -50,7 +50,7 @@ namespace MediaBrowser.Controller.Entities /// If the item is a folder, it returns the folder itself /// /// The containing folder path. - [IgnoreDataMember] + [JsonIgnore] public override string ContainingFolderPath => Path; public override bool CanDelete() @@ -63,13 +63,13 @@ namespace MediaBrowser.Controller.Entities return true; } - [IgnoreDataMember] + [JsonIgnore] public override bool EnableAlphaNumericSorting => false; - [IgnoreDataMember] + [JsonIgnore] public override bool SupportsPeople => false; - [IgnoreDataMember] + [JsonIgnore] public override bool SupportsAncestors => false; public static string GetPath(string name) diff --git a/MediaBrowser.Controller/Entities/Photo.cs b/MediaBrowser.Controller/Entities/Photo.cs index 60c8321893..86d62add97 100644 --- a/MediaBrowser.Controller/Entities/Photo.cs +++ b/MediaBrowser.Controller/Entities/Photo.cs @@ -1,21 +1,21 @@ +using System.Text.Json.Serialization; using MediaBrowser.Model.Drawing; -using MediaBrowser.Model.Serialization; namespace MediaBrowser.Controller.Entities { public class Photo : BaseItem { - [IgnoreDataMember] + [JsonIgnore] public override bool SupportsLocalMetadata => false; - [IgnoreDataMember] + [JsonIgnore] public override string MediaType => Model.Entities.MediaType.Photo; - [IgnoreDataMember] + [JsonIgnore] public override Folder LatestItemsIndexContainer => AlbumEntity; - [IgnoreDataMember] + [JsonIgnore] public PhotoAlbum AlbumEntity { get diff --git a/MediaBrowser.Controller/Entities/PhotoAlbum.cs b/MediaBrowser.Controller/Entities/PhotoAlbum.cs index 4cd0c8b668..b86f1ac2ae 100644 --- a/MediaBrowser.Controller/Entities/PhotoAlbum.cs +++ b/MediaBrowser.Controller/Entities/PhotoAlbum.cs @@ -1,16 +1,16 @@ -using MediaBrowser.Model.Serialization; +using System.Text.Json.Serialization; namespace MediaBrowser.Controller.Entities { public class PhotoAlbum : Folder { - [IgnoreDataMember] + [JsonIgnore] public override bool AlwaysScanInternalMetadataPath => true; - [IgnoreDataMember] + [JsonIgnore] public override bool SupportsPlayedStatus => false; - [IgnoreDataMember] + [JsonIgnore] public override bool SupportsInheritedParentImages => false; } } diff --git a/MediaBrowser.Controller/Entities/Studio.cs b/MediaBrowser.Controller/Entities/Studio.cs index d6da0d48c7..068032317d 100644 --- a/MediaBrowser.Controller/Entities/Studio.cs +++ b/MediaBrowser.Controller/Entities/Studio.cs @@ -1,7 +1,7 @@ using System; using System.Collections.Generic; +using System.Text.Json.Serialization; using MediaBrowser.Controller.Extensions; -using MediaBrowser.Model.Serialization; using Microsoft.Extensions.Logging; namespace MediaBrowser.Controller.Entities @@ -28,13 +28,13 @@ namespace MediaBrowser.Controller.Entities /// If the item is a folder, it returns the folder itself /// /// The containing folder path. - [IgnoreDataMember] + [JsonIgnore] public override string ContainingFolderPath => Path; - [IgnoreDataMember] + [JsonIgnore] public override bool IsDisplayedAsFolder => true; - [IgnoreDataMember] + [JsonIgnore] public override bool SupportsAncestors => false; public override double GetDefaultPrimaryImageAspectRatio() @@ -62,7 +62,7 @@ namespace MediaBrowser.Controller.Entities return LibraryManager.GetItemList(query); } - [IgnoreDataMember] + [JsonIgnore] public override bool SupportsPeople => false; public static string GetPath(string name) diff --git a/MediaBrowser.Controller/Entities/TV/Episode.cs b/MediaBrowser.Controller/Entities/TV/Episode.cs index e67c00fed9..49229fa4be 100644 --- a/MediaBrowser.Controller/Entities/TV/Episode.cs +++ b/MediaBrowser.Controller/Entities/TV/Episode.cs @@ -2,11 +2,11 @@ using System; using System.Collections.Generic; using System.Globalization; using System.Linq; +using System.Text.Json.Serialization; using MediaBrowser.Controller.Providers; using MediaBrowser.Model.Configuration; using MediaBrowser.Model.Entities; using MediaBrowser.Model.IO; -using MediaBrowser.Model.Serialization; using Microsoft.Extensions.Logging; namespace MediaBrowser.Controller.Entities.TV @@ -49,25 +49,25 @@ namespace MediaBrowser.Controller.Entities.TV return series == null ? SeriesName : series.SortName; } - [IgnoreDataMember] + [JsonIgnore] protected override bool SupportsOwnedItems => IsStacked || MediaSourceCount > 1; - [IgnoreDataMember] + [JsonIgnore] public override bool SupportsInheritedParentImages => true; - [IgnoreDataMember] + [JsonIgnore] public override bool SupportsPeople => true; - [IgnoreDataMember] + [JsonIgnore] public int? AiredSeasonNumber => AirsAfterSeasonNumber ?? AirsBeforeSeasonNumber ?? ParentIndexNumber; - [IgnoreDataMember] + [JsonIgnore] public override Folder LatestItemsIndexContainer => Series; - [IgnoreDataMember] + [JsonIgnore] public override Guid DisplayParentId => SeasonId; - [IgnoreDataMember] + [JsonIgnore] protected override bool EnableDefaultVideoUserDataKeys => false; public override double GetDefaultPrimaryImageAspectRatio() @@ -104,7 +104,7 @@ namespace MediaBrowser.Controller.Entities.TV /// This Episode's Series Instance /// /// The series. - [IgnoreDataMember] + [JsonIgnore] public Series Series { get @@ -118,7 +118,7 @@ namespace MediaBrowser.Controller.Entities.TV } } - [IgnoreDataMember] + [JsonIgnore] public Season Season { get @@ -132,16 +132,16 @@ namespace MediaBrowser.Controller.Entities.TV } } - [IgnoreDataMember] + [JsonIgnore] public bool IsInSeasonFolder => FindParent() != null; - [IgnoreDataMember] + [JsonIgnore] public string SeriesPresentationUniqueKey { get; set; } - [IgnoreDataMember] + [JsonIgnore] public string SeriesName { get; set; } - [IgnoreDataMember] + [JsonIgnore] public string SeasonName { get; set; } public string FindSeriesPresentationUniqueKey() @@ -224,7 +224,7 @@ namespace MediaBrowser.Controller.Entities.TV return false; } - [IgnoreDataMember] + [JsonIgnore] public override bool SupportsRemoteImageDownloading { get @@ -238,12 +238,12 @@ namespace MediaBrowser.Controller.Entities.TV } } - [IgnoreDataMember] + [JsonIgnore] public bool IsMissingEpisode => LocationType == LocationType.Virtual; - [IgnoreDataMember] + [JsonIgnore] public Guid SeasonId { get; set; } - [IgnoreDataMember] + [JsonIgnore] public Guid SeriesId { get; set; } public Guid FindSeriesId() diff --git a/MediaBrowser.Controller/Entities/TV/Season.cs b/MediaBrowser.Controller/Entities/TV/Season.cs index 5d7c260d15..9c8a469e26 100644 --- a/MediaBrowser.Controller/Entities/TV/Season.cs +++ b/MediaBrowser.Controller/Entities/TV/Season.cs @@ -1,11 +1,11 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Text.Json.Serialization; using MediaBrowser.Controller.Dto; using MediaBrowser.Controller.Providers; using MediaBrowser.Model.Configuration; using MediaBrowser.Model.Querying; -using MediaBrowser.Model.Serialization; using MediaBrowser.Model.Users; namespace MediaBrowser.Controller.Entities.TV @@ -15,22 +15,22 @@ namespace MediaBrowser.Controller.Entities.TV /// public class Season : Folder, IHasSeries, IHasLookupInfo { - [IgnoreDataMember] + [JsonIgnore] public override bool SupportsAddingToPlaylist => true; - [IgnoreDataMember] + [JsonIgnore] public override bool IsPreSorted => true; - [IgnoreDataMember] + [JsonIgnore] public override bool SupportsDateLastMediaAdded => false; - [IgnoreDataMember] + [JsonIgnore] public override bool SupportsPeople => true; - [IgnoreDataMember] + [JsonIgnore] public override bool SupportsInheritedParentImages => true; - [IgnoreDataMember] + [JsonIgnore] public override Guid DisplayParentId => SeriesId; public override double GetDefaultPrimaryImageAspectRatio() @@ -71,7 +71,7 @@ namespace MediaBrowser.Controller.Entities.TV /// This Episode's Series Instance /// /// The series. - [IgnoreDataMember] + [JsonIgnore] public Series Series { get @@ -85,7 +85,7 @@ namespace MediaBrowser.Controller.Entities.TV } } - [IgnoreDataMember] + [JsonIgnore] public string SeriesPath { get @@ -179,13 +179,13 @@ namespace MediaBrowser.Controller.Entities.TV return UnratedItem.Series; } - [IgnoreDataMember] + [JsonIgnore] public string SeriesPresentationUniqueKey { get; set; } - [IgnoreDataMember] + [JsonIgnore] public string SeriesName { get; set; } - [IgnoreDataMember] + [JsonIgnore] public Guid SeriesId { get; set; } public string FindSeriesPresentationUniqueKey() diff --git a/MediaBrowser.Controller/Entities/TV/Series.cs b/MediaBrowser.Controller/Entities/TV/Series.cs index a50da9b0a0..76cb9a6514 100644 --- a/MediaBrowser.Controller/Entities/TV/Series.cs +++ b/MediaBrowser.Controller/Entities/TV/Series.cs @@ -2,6 +2,7 @@ using System; using System.Collections.Generic; using System.Globalization; using System.Linq; +using System.Text.Json.Serialization; using System.Threading; using System.Threading.Tasks; using MediaBrowser.Controller.Dto; @@ -10,7 +11,6 @@ using MediaBrowser.Model.Configuration; using MediaBrowser.Model.Entities; using MediaBrowser.Model.Providers; using MediaBrowser.Model.Querying; -using MediaBrowser.Model.Serialization; using MediaBrowser.Model.Users; namespace MediaBrowser.Controller.Entities.TV @@ -31,19 +31,19 @@ namespace MediaBrowser.Controller.Entities.TV public DayOfWeek[] AirDays { get; set; } public string AirTime { get; set; } - [IgnoreDataMember] + [JsonIgnore] public override bool SupportsAddingToPlaylist => true; - [IgnoreDataMember] + [JsonIgnore] public override bool IsPreSorted => true; - [IgnoreDataMember] + [JsonIgnore] public override bool SupportsDateLastMediaAdded => true; - [IgnoreDataMember] + [JsonIgnore] public override bool SupportsInheritedParentImages => false; - [IgnoreDataMember] + [JsonIgnore] public override bool SupportsPeople => true; /// @@ -504,7 +504,7 @@ namespace MediaBrowser.Controller.Entities.TV return list; } - [IgnoreDataMember] + [JsonIgnore] public override bool StopRefreshIfLocalMetadataFound => false; } } diff --git a/MediaBrowser.Controller/Entities/Trailer.cs b/MediaBrowser.Controller/Entities/Trailer.cs index 5bf22d7bc8..0b8be90cd1 100644 --- a/MediaBrowser.Controller/Entities/Trailer.cs +++ b/MediaBrowser.Controller/Entities/Trailer.cs @@ -1,10 +1,10 @@ using System; using System.Collections.Generic; +using System.Text.Json.Serialization; using MediaBrowser.Controller.Providers; using MediaBrowser.Model.Configuration; using MediaBrowser.Model.Entities; using MediaBrowser.Model.Providers; -using MediaBrowser.Model.Serialization; namespace MediaBrowser.Controller.Entities { @@ -93,7 +93,7 @@ namespace MediaBrowser.Controller.Entities return list; } - [IgnoreDataMember] + [JsonIgnore] public override bool StopRefreshIfLocalMetadataFound => false; } } diff --git a/MediaBrowser.Controller/Entities/User.cs b/MediaBrowser.Controller/Entities/User.cs index 7d245d4aab..c70ecccf13 100644 --- a/MediaBrowser.Controller/Entities/User.cs +++ b/MediaBrowser.Controller/Entities/User.cs @@ -1,12 +1,12 @@ using System; using System.Globalization; using System.IO; +using System.Text.Json.Serialization; using System.Threading; using System.Threading.Tasks; using MediaBrowser.Controller.Library; using MediaBrowser.Controller.Providers; using MediaBrowser.Model.Configuration; -using MediaBrowser.Model.Serialization; using MediaBrowser.Model.Users; namespace MediaBrowser.Controller.Entities @@ -25,7 +25,7 @@ namespace MediaBrowser.Controller.Entities public string Password { get; set; } public string EasyPassword { get; set; } - // Strictly to remove IgnoreDataMember + // Strictly to remove JsonIgnore public override ItemImageInfo[] ImageInfos { get => base.ImageInfos; @@ -36,7 +36,7 @@ namespace MediaBrowser.Controller.Entities /// Gets or sets the path. /// /// The path. - [IgnoreDataMember] + [JsonIgnore] public override string Path { get => ConfigurationDirectoryPath; @@ -65,14 +65,14 @@ namespace MediaBrowser.Controller.Entities /// If the item is a folder, it returns the folder itself /// /// The containing folder path. - [IgnoreDataMember] + [JsonIgnore] public override string ContainingFolderPath => Path; /// /// Gets the root folder. /// /// The root folder. - [IgnoreDataMember] + [JsonIgnore] public Folder RootFolder => LibraryManager.GetUserRootFolder(); /// @@ -88,7 +88,7 @@ namespace MediaBrowser.Controller.Entities private volatile UserConfiguration _config; private readonly object _configSyncLock = new object(); - [IgnoreDataMember] + [JsonIgnore] public UserConfiguration Configuration { get @@ -111,7 +111,7 @@ namespace MediaBrowser.Controller.Entities private volatile UserPolicy _policy; private readonly object _policySyncLock = new object(); - [IgnoreDataMember] + [JsonIgnore] public UserPolicy Policy { get @@ -168,7 +168,7 @@ namespace MediaBrowser.Controller.Entities /// Gets the path to the user's configuration directory /// /// The configuration directory path. - [IgnoreDataMember] + [JsonIgnore] public string ConfigurationDirectoryPath => GetConfigurationDirectoryPath(Name); public override double GetDefaultPrimaryImageAspectRatio() @@ -252,7 +252,7 @@ namespace MediaBrowser.Controller.Entities return false; } - [IgnoreDataMember] + [JsonIgnore] public override bool SupportsPeople => false; public long InternalId { get; set; } diff --git a/MediaBrowser.Controller/Entities/UserItemData.cs b/MediaBrowser.Controller/Entities/UserItemData.cs index f7136bdf2e..ab425ee0f9 100644 --- a/MediaBrowser.Controller/Entities/UserItemData.cs +++ b/MediaBrowser.Controller/Entities/UserItemData.cs @@ -1,5 +1,5 @@ using System; -using MediaBrowser.Model.Serialization; +using System.Text.Json.Serialization; namespace MediaBrowser.Controller.Entities { @@ -93,7 +93,7 @@ namespace MediaBrowser.Controller.Entities /// This should never be serialized. /// /// null if [likes] contains no value, true if [likes]; otherwise, false. - [IgnoreDataMember] + [JsonIgnore] public bool? Likes { get diff --git a/MediaBrowser.Controller/Entities/UserRootFolder.cs b/MediaBrowser.Controller/Entities/UserRootFolder.cs index 7fe8df8af3..7fcf48a48f 100644 --- a/MediaBrowser.Controller/Entities/UserRootFolder.cs +++ b/MediaBrowser.Controller/Entities/UserRootFolder.cs @@ -1,12 +1,12 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Text.Json.Serialization; using System.Threading; using System.Threading.Tasks; using MediaBrowser.Controller.Providers; using MediaBrowser.Model.Library; using MediaBrowser.Model.Querying; -using MediaBrowser.Model.Serialization; namespace MediaBrowser.Controller.Entities { @@ -33,10 +33,10 @@ namespace MediaBrowser.Controller.Entities } } - [IgnoreDataMember] + [JsonIgnore] public override bool SupportsInheritedParentImages => false; - [IgnoreDataMember] + [JsonIgnore] public override bool SupportsPlayedStatus => false; private void ClearCache() @@ -75,10 +75,10 @@ namespace MediaBrowser.Controller.Entities return GetChildren(user, true).Count; } - [IgnoreDataMember] + [JsonIgnore] protected override bool SupportsShortcutChildren => true; - [IgnoreDataMember] + [JsonIgnore] public override bool IsPreSorted => true; protected override IEnumerable GetEligibleChildrenForRecursiveChildren(User user) diff --git a/MediaBrowser.Controller/Entities/UserView.cs b/MediaBrowser.Controller/Entities/UserView.cs index 4a6d32dcec..fd045f0dda 100644 --- a/MediaBrowser.Controller/Entities/UserView.cs +++ b/MediaBrowser.Controller/Entities/UserView.cs @@ -1,10 +1,10 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Text.Json.Serialization; using System.Threading.Tasks; using MediaBrowser.Controller.TV; using MediaBrowser.Model.Querying; -using MediaBrowser.Model.Serialization; namespace MediaBrowser.Controller.Entities { @@ -17,7 +17,7 @@ namespace MediaBrowser.Controller.Entities public static ITVSeriesManager TVSeriesManager; - [IgnoreDataMember] + [JsonIgnore] public string CollectionType => ViewType; public override IEnumerable GetIdsForAncestorQuery() @@ -40,10 +40,10 @@ namespace MediaBrowser.Controller.Entities return list; } - [IgnoreDataMember] + [JsonIgnore] public override bool SupportsInheritedParentImages => false; - [IgnoreDataMember] + [JsonIgnore] public override bool SupportsPlayedStatus => false; public override int GetChildCount(User user) @@ -167,7 +167,7 @@ namespace MediaBrowser.Controller.Entities return Task.CompletedTask; } - [IgnoreDataMember] + [JsonIgnore] public override bool SupportsPeople => false; } } diff --git a/MediaBrowser.Controller/Entities/Video.cs b/MediaBrowser.Controller/Entities/Video.cs index 8379dcc090..60906bdb08 100644 --- a/MediaBrowser.Controller/Entities/Video.cs +++ b/MediaBrowser.Controller/Entities/Video.cs @@ -2,6 +2,7 @@ using System; using System.Collections.Generic; using System.Globalization; using System.Linq; +using System.Text.Json.Serialization; using System.Threading; using System.Threading.Tasks; using MediaBrowser.Controller.Library; @@ -13,7 +14,6 @@ using MediaBrowser.Model.Dto; using MediaBrowser.Model.Entities; using MediaBrowser.Model.IO; using MediaBrowser.Model.MediaInfo; -using MediaBrowser.Model.Serialization; namespace MediaBrowser.Controller.Entities { @@ -25,23 +25,23 @@ namespace MediaBrowser.Controller.Entities ISupportsPlaceHolders, IHasMediaSources { - [IgnoreDataMember] + [JsonIgnore] public string PrimaryVersionId { get; set; } public string[] AdditionalParts { get; set; } public string[] LocalAlternateVersions { get; set; } public LinkedChild[] LinkedAlternateVersions { get; set; } - [IgnoreDataMember] + [JsonIgnore] public override bool SupportsPlayedStatus => true; - [IgnoreDataMember] + [JsonIgnore] public override bool SupportsPeople => true; - [IgnoreDataMember] + [JsonIgnore] public override bool SupportsInheritedParentImages => true; - [IgnoreDataMember] + [JsonIgnore] public override bool SupportsPositionTicksResume { get @@ -90,7 +90,7 @@ namespace MediaBrowser.Controller.Entities return base.CreatePresentationUniqueKey(); } - [IgnoreDataMember] + [JsonIgnore] public override bool SupportsThemeMedia => true; /// @@ -180,10 +180,10 @@ namespace MediaBrowser.Controller.Entities return IsFileProtocol; } - [IgnoreDataMember] + [JsonIgnore] public override bool SupportsAddingToPlaylist => true; - [IgnoreDataMember] + [JsonIgnore] public int MediaSourceCount { get @@ -200,10 +200,10 @@ namespace MediaBrowser.Controller.Entities } } - [IgnoreDataMember] + [JsonIgnore] public bool IsStacked => AdditionalParts.Length > 0; - [IgnoreDataMember] + [JsonIgnore] public override bool HasLocalAlternateVersions => LocalAlternateVersions.Length > 0; public IEnumerable GetAdditionalPartIds() @@ -218,7 +218,7 @@ namespace MediaBrowser.Controller.Entities public static ILiveTvManager LiveTvManager { get; set; } - [IgnoreDataMember] + [JsonIgnore] public override SourceType SourceType { get @@ -247,7 +247,7 @@ namespace MediaBrowser.Controller.Entities return base.CanDelete(); } - [IgnoreDataMember] + [JsonIgnore] public bool IsCompleteMedia { get @@ -261,7 +261,7 @@ namespace MediaBrowser.Controller.Entities } } - [IgnoreDataMember] + [JsonIgnore] protected virtual bool EnableDefaultVideoUserDataKeys => true; public override List GetUserDataKeys() @@ -338,7 +338,7 @@ namespace MediaBrowser.Controller.Entities .OrderBy(i => i.SortName); } - [IgnoreDataMember] + [JsonIgnore] public override string ContainingFolderPath { get @@ -360,7 +360,7 @@ namespace MediaBrowser.Controller.Entities } } - [IgnoreDataMember] + [JsonIgnore] public override string FileNameWithoutExtension { get @@ -432,14 +432,14 @@ namespace MediaBrowser.Controller.Entities /// Gets a value indicating whether [is3 D]. /// /// true if [is3 D]; otherwise, false. - [IgnoreDataMember] + [JsonIgnore] public bool Is3D => Video3DFormat.HasValue; /// /// Gets the type of the media. /// /// The type of the media. - [IgnoreDataMember] + [JsonIgnore] public override string MediaType => Model.Entities.MediaType.Video; protected override async Task RefreshedOwnedItems(MetadataRefreshOptions options, List fileSystemChildren, CancellationToken cancellationToken) diff --git a/MediaBrowser.Controller/Entities/Year.cs b/MediaBrowser.Controller/Entities/Year.cs index 13e82fada3..a01ef5c316 100644 --- a/MediaBrowser.Controller/Entities/Year.cs +++ b/MediaBrowser.Controller/Entities/Year.cs @@ -1,7 +1,7 @@ using System; using System.Collections.Generic; using System.Globalization; -using MediaBrowser.Model.Serialization; +using System.Text.Json.Serialization; using Microsoft.Extensions.Logging; namespace MediaBrowser.Controller.Entities @@ -24,7 +24,7 @@ namespace MediaBrowser.Controller.Entities /// If the item is a folder, it returns the folder itself /// /// The containing folder path. - [IgnoreDataMember] + [JsonIgnore] public override string ContainingFolderPath => Path; public override double GetDefaultPrimaryImageAspectRatio() @@ -35,7 +35,7 @@ namespace MediaBrowser.Controller.Entities return value; } - [IgnoreDataMember] + [JsonIgnore] public override bool SupportsAncestors => false; public override bool CanDelete() @@ -72,7 +72,7 @@ namespace MediaBrowser.Controller.Entities return null; } - [IgnoreDataMember] + [JsonIgnore] public override bool SupportsPeople => false; public static string GetPath(string name) diff --git a/MediaBrowser.Controller/LiveTv/LiveTvChannel.cs b/MediaBrowser.Controller/LiveTv/LiveTvChannel.cs index 351662b294..60391bb83f 100644 --- a/MediaBrowser.Controller/LiveTv/LiveTvChannel.cs +++ b/MediaBrowser.Controller/LiveTv/LiveTvChannel.cs @@ -2,13 +2,13 @@ using System; using System.Collections.Generic; using System.Globalization; using System.Linq; +using System.Text.Json.Serialization; using MediaBrowser.Controller.Entities; using MediaBrowser.Model.Configuration; using MediaBrowser.Model.Dto; using MediaBrowser.Model.Entities; using MediaBrowser.Model.LiveTv; using MediaBrowser.Model.MediaInfo; -using MediaBrowser.Model.Serialization; namespace MediaBrowser.Controller.LiveTv { @@ -31,13 +31,13 @@ namespace MediaBrowser.Controller.LiveTv return UnratedItem.LiveTvChannel; } - [IgnoreDataMember] + [JsonIgnore] public override bool SupportsPositionTicksResume => false; - [IgnoreDataMember] + [JsonIgnore] public override SourceType SourceType => SourceType.LiveTV; - [IgnoreDataMember] + [JsonIgnore] public override bool EnableRememberingTrackSelections => false; /// @@ -52,7 +52,7 @@ namespace MediaBrowser.Controller.LiveTv /// The type of the channel. public ChannelType ChannelType { get; set; } - [IgnoreDataMember] + [JsonIgnore] public override LocationType LocationType => LocationType.Remote; protected override string CreateSortName() @@ -70,7 +70,7 @@ namespace MediaBrowser.Controller.LiveTv return (Number ?? string.Empty) + "-" + (Name ?? string.Empty); } - [IgnoreDataMember] + [JsonIgnore] public override string MediaType => ChannelType == ChannelType.Radio ? Model.Entities.MediaType.Audio : Model.Entities.MediaType.Video; public override string GetClientTypeName() @@ -119,45 +119,45 @@ namespace MediaBrowser.Controller.LiveTv return false; } - [IgnoreDataMember] + [JsonIgnore] public bool IsMovie { get; set; } /// /// Gets or sets a value indicating whether this instance is sports. /// /// true if this instance is sports; otherwise, false. - [IgnoreDataMember] + [JsonIgnore] public bool IsSports { get; set; } /// /// Gets or sets a value indicating whether this instance is series. /// /// true if this instance is series; otherwise, false. - [IgnoreDataMember] + [JsonIgnore] public bool IsSeries { get; set; } /// /// Gets or sets a value indicating whether this instance is news. /// /// true if this instance is news; otherwise, false. - [IgnoreDataMember] + [JsonIgnore] public bool IsNews { get; set; } /// /// Gets or sets a value indicating whether this instance is kids. /// /// true if this instance is kids; otherwise, false. - [IgnoreDataMember] + [JsonIgnore] public bool IsKids => Tags.Contains("Kids", StringComparer.OrdinalIgnoreCase); - [IgnoreDataMember] + [JsonIgnore] public bool IsRepeat { get; set; } /// /// Gets or sets the episode title. /// /// The episode title. - [IgnoreDataMember] + [JsonIgnore] public string EpisodeTitle { get; set; } } } diff --git a/MediaBrowser.Controller/LiveTv/LiveTvProgram.cs b/MediaBrowser.Controller/LiveTv/LiveTvProgram.cs index bdaf10d005..13df85aeda 100644 --- a/MediaBrowser.Controller/LiveTv/LiveTvProgram.cs +++ b/MediaBrowser.Controller/LiveTv/LiveTvProgram.cs @@ -2,6 +2,7 @@ using System; using System.Collections.Generic; using System.Globalization; using System.Linq; +using System.Text.Json.Serialization; using MediaBrowser.Common.Configuration; using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Providers; @@ -9,7 +10,6 @@ using MediaBrowser.Model.Configuration; using MediaBrowser.Model.Entities; using MediaBrowser.Model.LiveTv; using MediaBrowser.Model.Providers; -using MediaBrowser.Model.Serialization; namespace MediaBrowser.Controller.LiveTv { @@ -63,79 +63,79 @@ namespace MediaBrowser.Controller.LiveTv } } - [IgnoreDataMember] + [JsonIgnore] public override SourceType SourceType => SourceType.LiveTV; /// /// The start date of the program, in UTC. /// - [IgnoreDataMember] + [JsonIgnore] public DateTime StartDate { get; set; } /// /// Gets or sets a value indicating whether this instance is repeat. /// /// true if this instance is repeat; otherwise, false. - [IgnoreDataMember] + [JsonIgnore] public bool IsRepeat { get; set; } /// /// Gets or sets the episode title. /// /// The episode title. - [IgnoreDataMember] + [JsonIgnore] public string EpisodeTitle { get; set; } - [IgnoreDataMember] + [JsonIgnore] public string ShowId { get; set; } /// /// Gets or sets a value indicating whether this instance is movie. /// /// true if this instance is movie; otherwise, false. - [IgnoreDataMember] + [JsonIgnore] public bool IsMovie { get; set; } /// /// Gets or sets a value indicating whether this instance is sports. /// /// true if this instance is sports; otherwise, false. - [IgnoreDataMember] + [JsonIgnore] public bool IsSports => Tags.Contains("Sports", StringComparer.OrdinalIgnoreCase); /// /// Gets or sets a value indicating whether this instance is series. /// /// true if this instance is series; otherwise, false. - [IgnoreDataMember] + [JsonIgnore] public bool IsSeries { get; set; } /// /// Gets or sets a value indicating whether this instance is live. /// /// true if this instance is live; otherwise, false. - [IgnoreDataMember] + [JsonIgnore] public bool IsLive => Tags.Contains("Live", StringComparer.OrdinalIgnoreCase); /// /// Gets or sets a value indicating whether this instance is news. /// /// true if this instance is news; otherwise, false. - [IgnoreDataMember] + [JsonIgnore] public bool IsNews => Tags.Contains("News", StringComparer.OrdinalIgnoreCase); /// /// Gets or sets a value indicating whether this instance is kids. /// /// true if this instance is kids; otherwise, false. - [IgnoreDataMember] + [JsonIgnore] public bool IsKids => Tags.Contains("Kids", StringComparer.OrdinalIgnoreCase); /// /// Gets or sets a value indicating whether this instance is premiere. /// /// true if this instance is premiere; otherwise, false. - [IgnoreDataMember] + [JsonIgnore] public bool IsPremiere => Tags.Contains("Premiere", StringComparer.OrdinalIgnoreCase); /// @@ -143,10 +143,10 @@ namespace MediaBrowser.Controller.LiveTv /// If the item is a folder, it returns the folder itself /// /// The containing folder path. - [IgnoreDataMember] + [JsonIgnore] public override string ContainingFolderPath => Path; - //[IgnoreDataMember] + //[JsonIgnore] //public override string MediaType //{ // get @@ -155,7 +155,7 @@ namespace MediaBrowser.Controller.LiveTv // } //} - [IgnoreDataMember] + [JsonIgnore] public bool IsAiring { get @@ -166,7 +166,7 @@ namespace MediaBrowser.Controller.LiveTv } } - [IgnoreDataMember] + [JsonIgnore] public bool HasAired { get @@ -197,7 +197,7 @@ namespace MediaBrowser.Controller.LiveTv return false; } - [IgnoreDataMember] + [JsonIgnore] public override bool SupportsPeople { get @@ -212,7 +212,7 @@ namespace MediaBrowser.Controller.LiveTv } } - [IgnoreDataMember] + [JsonIgnore] public override bool SupportsAncestors => false; private LiveTvOptions GetConfiguration() diff --git a/MediaBrowser.Controller/LiveTv/TimerInfo.cs b/MediaBrowser.Controller/LiveTv/TimerInfo.cs index 2fea6a8cb5..46774b2b7a 100644 --- a/MediaBrowser.Controller/LiveTv/TimerInfo.cs +++ b/MediaBrowser.Controller/LiveTv/TimerInfo.cs @@ -1,8 +1,8 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Text.Json.Serialization; using MediaBrowser.Model.LiveTv; -using MediaBrowser.Model.Serialization; namespace MediaBrowser.Controller.LiveTv { @@ -129,10 +129,10 @@ namespace MediaBrowser.Controller.LiveTv /// Gets or sets a value indicating whether this instance is live. /// /// true if this instance is live; otherwise, false. - [IgnoreDataMember] + [JsonIgnore] public bool IsLive => Tags.Contains("Live", StringComparer.OrdinalIgnoreCase); - [IgnoreDataMember] + [JsonIgnore] public bool IsPremiere => Tags.Contains("Premiere", StringComparer.OrdinalIgnoreCase); public int? ProductionYear { get; set; } diff --git a/MediaBrowser.Controller/Playlists/Playlist.cs b/MediaBrowser.Controller/Playlists/Playlist.cs index aff687f882..b45043f92a 100644 --- a/MediaBrowser.Controller/Playlists/Playlist.cs +++ b/MediaBrowser.Controller/Playlists/Playlist.cs @@ -2,6 +2,7 @@ using System; using System.Collections.Generic; using System.Globalization; using System.Linq; +using System.Text.Json.Serialization; using System.Threading; using System.Threading.Tasks; using MediaBrowser.Controller.Dto; @@ -10,7 +11,6 @@ using MediaBrowser.Controller.Entities.Audio; using MediaBrowser.Controller.Providers; using MediaBrowser.Model.Entities; using MediaBrowser.Model.Querying; -using MediaBrowser.Model.Serialization; namespace MediaBrowser.Controller.Playlists { @@ -34,7 +34,7 @@ namespace MediaBrowser.Controller.Playlists Shares = Array.Empty(); } - [IgnoreDataMember] + [JsonIgnore] public bool IsFile => IsPlaylistFile(Path); public static bool IsPlaylistFile(string path) @@ -42,7 +42,7 @@ namespace MediaBrowser.Controller.Playlists return System.IO.Path.HasExtension(path); } - [IgnoreDataMember] + [JsonIgnore] public override string ContainingFolderPath { get @@ -58,19 +58,19 @@ namespace MediaBrowser.Controller.Playlists } } - [IgnoreDataMember] + [JsonIgnore] protected override bool FilterLinkedChildrenPerUser => true; - [IgnoreDataMember] + [JsonIgnore] public override bool SupportsInheritedParentImages => false; - [IgnoreDataMember] + [JsonIgnore] public override bool SupportsPlayedStatus => string.Equals(MediaType, "Video", StringComparison.OrdinalIgnoreCase); - [IgnoreDataMember] + [JsonIgnore] public override bool AlwaysScanInternalMetadataPath => true; - [IgnoreDataMember] + [JsonIgnore] public override bool SupportsCumulativeRunTimeTicks => true; public override double GetDefaultPrimaryImageAspectRatio() @@ -193,12 +193,12 @@ namespace MediaBrowser.Controller.Playlists return new[] { item }; } - [IgnoreDataMember] + [JsonIgnore] public override bool IsPreSorted => true; public string PlaylistMediaType { get; set; } - [IgnoreDataMember] + [JsonIgnore] public override string MediaType => PlaylistMediaType; public void SetMediaType(string value) @@ -206,7 +206,7 @@ namespace MediaBrowser.Controller.Playlists PlaylistMediaType = value; } - [IgnoreDataMember] + [JsonIgnore] private bool IsSharedItem { get diff --git a/MediaBrowser.Controller/Session/SessionInfo.cs b/MediaBrowser.Controller/Session/SessionInfo.cs index f0e81e8e7a..acda6a4166 100644 --- a/MediaBrowser.Controller/Session/SessionInfo.cs +++ b/MediaBrowser.Controller/Session/SessionInfo.cs @@ -1,9 +1,9 @@ using System; using System.Linq; +using System.Text.Json.Serialization; using System.Threading; using MediaBrowser.Controller.Entities; using MediaBrowser.Model.Dto; -using MediaBrowser.Model.Serialization; using MediaBrowser.Model.Session; using Microsoft.Extensions.Logging; @@ -123,7 +123,7 @@ namespace MediaBrowser.Controller.Session /// Gets or sets the session controller. /// /// The session controller. - [IgnoreDataMember] + [JsonIgnore] public ISessionController[] SessionControllers { get; set; } /// diff --git a/MediaBrowser.Model/Dto/BaseItemPerson.cs b/MediaBrowser.Model/Dto/BaseItemPerson.cs index 7011ff8ea5..270a4683a7 100644 --- a/MediaBrowser.Model/Dto/BaseItemPerson.cs +++ b/MediaBrowser.Model/Dto/BaseItemPerson.cs @@ -1,4 +1,4 @@ -using MediaBrowser.Model.Serialization; +using System.Text.Json.Serialization; namespace MediaBrowser.Model.Dto { @@ -41,7 +41,7 @@ namespace MediaBrowser.Model.Dto /// Gets a value indicating whether this instance has primary image. /// /// true if this instance has primary image; otherwise, false. - [IgnoreDataMember] + [JsonIgnore] public bool HasPrimaryImage => PrimaryImageTag != null; } } diff --git a/MediaBrowser.Model/Dto/MediaSourceInfo.cs b/MediaBrowser.Model/Dto/MediaSourceInfo.cs index 92e40fb01f..5bdc4809a9 100644 --- a/MediaBrowser.Model/Dto/MediaSourceInfo.cs +++ b/MediaBrowser.Model/Dto/MediaSourceInfo.cs @@ -1,8 +1,8 @@ using System; using System.Collections.Generic; +using System.Text.Json.Serialization; using MediaBrowser.Model.Entities; using MediaBrowser.Model.MediaInfo; -using MediaBrowser.Model.Serialization; using MediaBrowser.Model.Session; namespace MediaBrowser.Model.Dto @@ -108,7 +108,7 @@ namespace MediaBrowser.Model.Dto } } - [IgnoreDataMember] + [JsonIgnore] public TranscodeReason[] TranscodeReasons { get; set; } public int? DefaultAudioStreamIndex { get; set; } @@ -148,7 +148,7 @@ namespace MediaBrowser.Model.Dto return null; } - [IgnoreDataMember] + [JsonIgnore] public MediaStream VideoStream { get diff --git a/MediaBrowser.Model/MediaBrowser.Model.csproj b/MediaBrowser.Model/MediaBrowser.Model.csproj index e9f43ea56b..3ed319a0de 100644 --- a/MediaBrowser.Model/MediaBrowser.Model.csproj +++ b/MediaBrowser.Model/MediaBrowser.Model.csproj @@ -16,6 +16,7 @@ + diff --git a/MediaBrowser.Model/Serialization/IgnoreDataMemberAttribute.cs b/MediaBrowser.Model/Serialization/IgnoreDataMemberAttribute.cs deleted file mode 100644 index b43949fe38..0000000000 --- a/MediaBrowser.Model/Serialization/IgnoreDataMemberAttribute.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; - -namespace MediaBrowser.Model.Serialization -{ - [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property, Inherited = false, AllowMultiple = false)] - public sealed class IgnoreDataMemberAttribute : Attribute - { - public IgnoreDataMemberAttribute() - { - } - } -} diff --git a/MediaBrowser.Model/Updates/PackageVersionInfo.cs b/MediaBrowser.Model/Updates/PackageVersionInfo.cs index 7ef07c0dfd..c0790317d5 100644 --- a/MediaBrowser.Model/Updates/PackageVersionInfo.cs +++ b/MediaBrowser.Model/Updates/PackageVersionInfo.cs @@ -1,5 +1,5 @@ using System; -using MediaBrowser.Model.Serialization; +using System.Text.Json.Serialization; namespace MediaBrowser.Model.Updates { @@ -36,7 +36,7 @@ namespace MediaBrowser.Model.Updates /// Had to make this an interpreted property since Protobuf can't handle Version /// /// The version. - [IgnoreDataMember] + [JsonIgnore] public Version Version { get From f80343bf9dfa6d79df85b12cdd66d3602c269ebc Mon Sep 17 00:00:00 2001 From: Anthony Lavado Date: Wed, 16 Oct 2019 01:43:53 -0400 Subject: [PATCH 019/177] Fix the Setup Type dialog titles I had put the title and subtitle in the wrong order. This corrects the issue. --- deployment/windows/dialogs/setuptype.nsddef | 2 +- deployment/windows/dialogs/setuptype.nsdinc | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/deployment/windows/dialogs/setuptype.nsddef b/deployment/windows/dialogs/setuptype.nsddef index ff59f62152..b55ceeaaa6 100644 --- a/deployment/windows/dialogs/setuptype.nsddef +++ b/deployment/windows/dialogs/setuptype.nsddef @@ -4,7 +4,7 @@ This file was created by NSISDialogDesigner 1.4.4.0 http://coolsoft.altervista.org/nsisdialogdesigner Do not edit manually! --> - +