Skip to content

feat: add ServerDisplayUrl configuration option and update related logic#65

Open
76696265636f646572 wants to merge 1 commit intoRomainPierre7:mainfrom
76696265636f646572:display-url
Open

feat: add ServerDisplayUrl configuration option and update related logic#65
76696265636f646572 wants to merge 1 commit intoRomainPierre7:mainfrom
76696265636f646572:display-url

Conversation

@76696265636f646572
Copy link
Copy Markdown

@76696265636f646572 76696265636f646572 commented Mar 26, 2026

Server url uses forced http, added an extra config option to let the user configure the display url for the telegram messages.

Additionally, it's now possible to do something like:

<b>New Episode Added</b>
📺 {episode.Series.Name} - S{eSeasonNumber} - E{episodeNumber} - '{item.Name}'

📽 <a href="{server.Url}/web/index.html#/details?id={item.Id}">Watch</a>

Without having the server url pointing to localhost

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new configuration field to control which server URL is used in notification templates (notably {server.Url}), enabling non-localhost links in Telegram messages without affecting the server URL used for internal metadata/image lookups.

Changes:

  • Introduce ServerDisplayUrl in plugin configuration and surface it in the web config UI.
  • Update message placeholder replacement logic to prefer ServerDisplayUrl over ServerUrl when set.
  • Persist/load the new setting via the config page JS.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
Jellyfin.Plugin.TelegramNotifier/MessageParser.cs Uses ServerDisplayUrl (fallback to ServerUrl) for {server.Url} replacement.
Jellyfin.Plugin.TelegramNotifier/Configuration/Web/configPage.js Loads/saves ServerDisplayUrl in the plugin configuration UI.
Jellyfin.Plugin.TelegramNotifier/Configuration/Web/configPage.html Adds a new input field and description for ServerDisplayUrl.
Jellyfin.Plugin.TelegramNotifier/Configuration/PluginConfiguration.cs Adds ServerDisplayUrl to the persisted configuration model.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 16 to +19
public string ServerUrl { get; set; }

public string ServerDisplayUrl { get; set; }

Copy link

Copilot AI Mar 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ServerDisplayUrl is declared as non-nullable (string) while <Nullable>enable</Nullable> is on, but it isn't initialized in the constructor. This will trigger CS8618 and can break the build; initialize it (e.g., to string.Empty) or make the property nullable (string?) and handle nulls consistently.

Copilot uses AI. Check for mistakes.
Comment on lines +44 to +46
<div class="fieldDescription">Insert an alternative server URL to display in notifications (ex: jellyfin.myDomain.com,
my-jellyfin.local:8096, ...). If set, this will be used in {server.Url} placeholders instead of the Server URL above.
The url must include the http/https protocol. This is useful if your server is behind a reverse proxy.
Copy link

Copilot AI Mar 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The description says the Server Display URL "must include the http/https protocol", but the backend logic currently auto-prefixes http:// when no scheme is present. Either update this help text to reflect the actual behavior (scheme optional, defaults to http), or adjust the backend to enforce/validate the scheme for this field to avoid surprising http:// links when users omit it.

Suggested change
<div class="fieldDescription">Insert an alternative server URL to display in notifications (ex: jellyfin.myDomain.com,
my-jellyfin.local:8096, ...). If set, this will be used in {server.Url} placeholders instead of the Server URL above.
The url must include the http/https protocol. This is useful if your server is behind a reverse proxy.
<div class="fieldDescription">Insert an alternative server URL to display in notifications (ex: https://jellyfin.myDomain.com,
https://my-jellyfin.local:8096, ...). If set, this will be used in {server.Url} placeholders instead of the Server URL above.
You may include the http/https protocol; if omitted, http:// will be automatically added. This is useful if your server is behind a reverse proxy.

Copilot uses AI. Check for mistakes.
@RomainPierre7
Copy link
Copy Markdown
Owner

Hi @76696265636f646572,

Thank you for your PR !

I’ll review it shortly and include it in the next release if it’s approved.

Regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants