Skip to content

Commit

Permalink
Merge pull request #83 from cant-code/patch-baseurl
Browse files Browse the repository at this point in the history
Respect base URL in tray launcher
  • Loading branch information
anthonylavado authored Apr 19, 2023
2 parents 6f964e6 + d0841c4 commit 0bd44a1
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Jellyfin.Windows.Tray/TrayApplicationContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public class TrayApplicationContext : ApplicationContext
private string _configFile;
private string _networkFile;
private string _port;
private string _baseUrl;
private bool _firstRunDone = false;
private string _networkAddress;
private string _executableFile;
Expand Down Expand Up @@ -164,6 +165,7 @@ private void LoadJellyfinConfig()

_networkAddress = networkReader.SelectSingleNode("/NetworkConfiguration/LocalNetworkAddresses").Value;
_port = networkReader.SelectSingleNode("/NetworkConfiguration/HttpServerPortNumber")?.Value;
_baseUrl = networkReader.SelectSingleNode("/NetworkConfiguration/BaseUrl")?.Value;
}

if (string.IsNullOrEmpty(_port))
Expand All @@ -176,7 +178,12 @@ private void LoadJellyfinConfig()
_networkAddress = "localhost";
}

_localJellyfinUrl = "http://" + _networkAddress + ":" + _port + "/web/index.html";
if (string.IsNullOrEmpty(_baseUrl))
{
_baseUrl = string.Empty;
}

_localJellyfinUrl = "http://" + _networkAddress + ":" + _port + _baseUrl + "/web/index.html";
}

private bool CheckShowServiceNotElevatedWarning()
Expand Down

0 comments on commit 0bd44a1

Please sign in to comment.