-
-
Notifications
You must be signed in to change notification settings - Fork 682
feat(notifications): Play On Media Server in notification #2392
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
JackW6809
wants to merge
9
commits into
seerr-team:develop
Choose a base branch
from
JackW6809:notification-media-server-links
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
cc51775
feat(notifications): added Play On Media Server in notifications when…
JackW6809 cdd66ba
feat(notifications): created a Helper to place functions in a single …
JackW6809 0f69b57
feat(notifications): updated casts as they were unnecessary
JackW6809 e32541b
feat(notifications): updated slack button behaviour
JackW6809 a8d2b0b
feat(notifications): added jsdoc info to the functions I am using
JackW6809 70ad89a
docs(notifications): added docstrings for email, slack, and telegram …
JackW6809 e288217
docs(notifications): removed double space, added more info to jsdoc
JackW6809 d313d7f
feat(notifications): escaped ` and \ in telegram notifications
JackW6809 bf0c4a3
fix(email.ts, telegram.ts): updated escaping of chars for Telegram, u…
JackW6809 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| import { MediaServerType } from '@server/constants/server'; | ||
|
|
||
| /** | ||
| * Returns the display name of the media server being used in the seerr installation | ||
| * If neither Emby nor Plex is detected it falls back to Jellyfin | ||
| * @param currentMediaServer The currently configured media server type from settings | ||
| * @returns Human readable media server name | ||
| */ | ||
| export function getAvailableMediaServerName( | ||
| currentMediaServer: MediaServerType | ||
| ): string { | ||
| if (currentMediaServer === MediaServerType.EMBY) { | ||
| return 'Emby'; | ||
| } | ||
|
|
||
| if (currentMediaServer === MediaServerType.PLEX) { | ||
| return 'Plex'; | ||
| } | ||
|
|
||
| return 'Jellyfin'; | ||
| } | ||
|
|
||
| /** | ||
| * This function returns the URL of the media directly in the media server | ||
| * Used later on in the email as a button to send directly to | ||
| * | ||
| * Prefers the 4K URL when the request is marked as 4K and prefers the | ||
| * standard URL otherwise. If the preferred URL is unavailable, it falls | ||
| * back to the alternative resolution URL to ensure a playable link is | ||
| * returned wherever possible. | ||
| * | ||
| * @param payload Notification payload containing media and request information | ||
| * @returns Media server URL or undefined if it's unavailable | ||
| */ | ||
| export function getAvailableMediaServerUrl(payload: { | ||
| request?: { is4k?: boolean }; | ||
| media?: { | ||
| mediaUrl?: string; | ||
| mediaUrl4k?: string; | ||
| }; | ||
| }): string | undefined { | ||
| const wants4k = payload.request?.is4k; | ||
| const url4k = payload.media?.mediaUrl4k; | ||
| const url = payload.media?.mediaUrl; | ||
|
|
||
| return (wants4k ? (url4k ?? url) : (url ?? url4k)) || undefined; | ||
| } |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.