Open Biztactix-Ryan opened 1 year ago
Ran into the exact same problem and used your code verbatim.. problem solved! Thanks, saved me so much time.
Still Ugly but maybe less ugly extension method:
MyServer = services.ConnectToPlexServer(key, servername);
```C#
using Microsoft.Extensions.DependencyInjection;
using Plex.Api.Factories;
using Plex.Library.ApiModels.Servers;
using Plex.ServerApi.Clients.Interfaces;
using Plex.ServerApi.PlexModels.Account;
namespace PlexMakePlaylist
{
public static class PlexExtensions
{
public static Server? ConnectToPlexServer(this IServiceProvider services, string token, string serverName = "", bool TryLocalFirst = true, bool OwnedOnly = true)
{
Server? myserver = null;
var _plexFactory = services.GetService
I'll try to take a look at this this weekend.
Ran into the exact same problem and used your code verbatim.. problem solved! Thanks, saved me so much time.
Still Ugly but maybe less ugly extension method:
MyServer = services.ConnectToPlexServer(key, servername);
Thanks... Your code is much nicer, I wasn't particularly in the mood for nice by that point, the plex bit was supposed to be the easy part ;) The old, I'll just write a quick bit of code to pull a list of all the shows I watch on Plex... and why isn't that working....
Is your feature request related to a problem? Please describe. Can't connect to servers if it has a public IP Address as well as a local, Most Routers don't support Hairpin NAT correctly.
Describe the solution you'd like Upon failure, if there are LocalIPs listed, then create a URI for each of them and check if you can connect to it.
Describe alternatives you've considered I've tested it myself by overriding the Host on the AccountServer object, That works and I can continue from here... But obviously auto failover makes sense
Additional context It's Ugly, but it shows where I've gotten to with it, It just catches the error and then updates the host