diff --git a/CHANGELOG.md b/CHANGELOG.md index 9d6bad56..0c2eef0a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - This can be configured using the following env vars (note the double underscore separator `__`) - `PROVIDER` - set to `MySql` - `MYSQL__CONNECTIONSTRING` - (e.g. `Server=localhost;Database=ErsatzTV;Uid=root;Pwd=ersatztv;`) +- Add option to use shared Plex servers, not just owned servers + - This can be enabled by setting the env var `ETV_ALLOW_SHARED_PLEX_SERVERS` to any non-empty value ### Fixed - Fix subtitle scaling when using QSV hardware acceleration diff --git a/ErsatzTV.Core.Tests/ErsatzTV.Core.Tests.csproj b/ErsatzTV.Core.Tests/ErsatzTV.Core.Tests.csproj index b44f4194..55aec973 100644 --- a/ErsatzTV.Core.Tests/ErsatzTV.Core.Tests.csproj +++ b/ErsatzTV.Core.Tests/ErsatzTV.Core.Tests.csproj @@ -16,7 +16,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/ErsatzTV.FFmpeg.Tests/ErsatzTV.FFmpeg.Tests.csproj b/ErsatzTV.FFmpeg.Tests/ErsatzTV.FFmpeg.Tests.csproj index 8dbb837c..785edcc2 100644 --- a/ErsatzTV.FFmpeg.Tests/ErsatzTV.FFmpeg.Tests.csproj +++ b/ErsatzTV.FFmpeg.Tests/ErsatzTV.FFmpeg.Tests.csproj @@ -10,7 +10,7 @@ - + diff --git a/ErsatzTV.Infrastructure.Sqlite/ErsatzTV.Infrastructure.Sqlite.csproj b/ErsatzTV.Infrastructure.Sqlite/ErsatzTV.Infrastructure.Sqlite.csproj index a55cc39d..26f901fc 100644 --- a/ErsatzTV.Infrastructure.Sqlite/ErsatzTV.Infrastructure.Sqlite.csproj +++ b/ErsatzTV.Infrastructure.Sqlite/ErsatzTV.Infrastructure.Sqlite.csproj @@ -12,7 +12,7 @@ - + diff --git a/ErsatzTV.Infrastructure.Tests/ErsatzTV.Infrastructure.Tests.csproj b/ErsatzTV.Infrastructure.Tests/ErsatzTV.Infrastructure.Tests.csproj index decc50f5..4bef1026 100644 --- a/ErsatzTV.Infrastructure.Tests/ErsatzTV.Infrastructure.Tests.csproj +++ b/ErsatzTV.Infrastructure.Tests/ErsatzTV.Infrastructure.Tests.csproj @@ -10,7 +10,7 @@ - + diff --git a/ErsatzTV.Infrastructure/ErsatzTV.Infrastructure.csproj b/ErsatzTV.Infrastructure/ErsatzTV.Infrastructure.csproj index edb33dad..c1fa7573 100644 --- a/ErsatzTV.Infrastructure/ErsatzTV.Infrastructure.csproj +++ b/ErsatzTV.Infrastructure/ErsatzTV.Infrastructure.csproj @@ -10,8 +10,8 @@ - - + + diff --git a/ErsatzTV.Infrastructure/Plex/PlexTvApiClient.cs b/ErsatzTV.Infrastructure/Plex/PlexTvApiClient.cs index 5d18833c..ae7da382 100644 --- a/ErsatzTV.Infrastructure/Plex/PlexTvApiClient.cs +++ b/ErsatzTV.Infrastructure/Plex/PlexTvApiClient.cs @@ -41,17 +41,20 @@ public class PlexTvApiClient : IPlexTvApiClient clientIdentifier, token.AuthToken); - - var allResources = httpResources.Filter(resource => resource.HttpsRequired == false) + var allServers = httpResources.Filter(resource => resource.HttpsRequired == false) .Append(httpsResources.Filter(resource => resource.HttpsRequired)) + .Filter(r => r.Provides.Split(",").Any(p => p == "server")) .ToList(); - IEnumerable ownedResources = allResources - .Filter(r => r.Provides.Split(",").Any(p => p == "server")) - .Filter(r => r.Owned); // TODO: maybe support non-owned servers in the future + IEnumerable ownedServers = allServers; + string allowSharedServers = Environment.GetEnvironmentVariable("ETV_ALLOW_SHARED_PLEX_SERVERS"); + if (string.IsNullOrWhiteSpace(allowSharedServers)) + { + ownedServers = ownedServers.Filter(r => r.Owned); + } - foreach (PlexResource resource in ownedResources) + foreach (PlexResource resource in ownedServers) { var serverAuthToken = new PlexServerAuthToken( resource.ClientIdentifier, diff --git a/ErsatzTV.Scanner.Tests/ErsatzTV.Scanner.Tests.csproj b/ErsatzTV.Scanner.Tests/ErsatzTV.Scanner.Tests.csproj index 2db3ce14..beed9939 100644 --- a/ErsatzTV.Scanner.Tests/ErsatzTV.Scanner.Tests.csproj +++ b/ErsatzTV.Scanner.Tests/ErsatzTV.Scanner.Tests.csproj @@ -11,7 +11,7 @@ - + diff --git a/ErsatzTV/ErsatzTV.csproj b/ErsatzTV/ErsatzTV.csproj index 8e1139dc..95421ca6 100644 --- a/ErsatzTV/ErsatzTV.csproj +++ b/ErsatzTV/ErsatzTV.csproj @@ -55,7 +55,7 @@ - + @@ -73,7 +73,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - +