-
-
Notifications
You must be signed in to change notification settings - Fork 38
Adding WebSocket Support #968
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
anultravioletaurora
wants to merge
44
commits into
jellyfin:master
Choose a base branch
from
anultravioletaurora:master
base: master
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
44 commits
Select commit
Hold shift + click to select a range
fc8da45
adding initial websocket support
anultravioletaurora 06fb4f2
Add event parameters, incorporate api_key parameter
anultravioletaurora 8bde62e
Merge branch 'jellyfin:master' into master
anultravioletaurora f041aa9
linting
anultravioletaurora 6fd0935
Niels you are so smart
anultravioletaurora fc73890
send start messages on socket connection
anultravioletaurora 3403664
incorporate a registry where start message handlers can be defined
anultravioletaurora 2aa9366
linting, circular dependency avoidance, cleaner construction
anultravioletaurora d108c18
linting, tests
anultravioletaurora 5e53638
Merge branch 'master' into master
anultravioletaurora 1a00de9
Merge branch 'master' of github.com:anultravioletaurora/jellyfin-sdk-…
anultravioletaurora f616a51
fix tests
anultravioletaurora f882eec
Adds in status change eventing, so consumers can respond to changes i…
anultravioletaurora 97b8eaa
linting and code smells
anultravioletaurora 8e33168
Merge branch 'master' into master
anultravioletaurora f569604
Add type constraints for OutboundWebSocketMessageTypes
anultravioletaurora 4aef130
Merge branch 'master' of github.com:anultravioletaurora/jellyfin-sdk-…
anultravioletaurora 8f988c5
addressing PR comments
anultravioletaurora e435146
making api fields private to prevent external mutations
anultravioletaurora b4c554a
avoid circular dependency during build
anultravioletaurora b22df56
make websocketservice constructor cleaner
anultravioletaurora 431295a
increasing test coverage
anultravioletaurora 064a9a8
tsdocs
anultravioletaurora 7c7570e
keep socket subscriptions but disconnect socket if access token is empty
anultravioletaurora f3040a1
proper reconnection handling when an accesstoken or baseUrl is changed
anultravioletaurora 59975a1
only initSocket during an update if we have subscriptions
anultravioletaurora b2c91df
linting
anultravioletaurora 3b23e70
instantiate websocketservice
anultravioletaurora b550070
Add GPL headers, update changelog
anultravioletaurora 752204e
update tsdocs
anultravioletaurora 046048e
Merge branch 'master' into master
anultravioletaurora 5c9c43f
pr feedback
anultravioletaurora f86d1d4
move ws url builder to util
anultravioletaurora 60c4d73
Merge branch 'master' into master
anultravioletaurora e4d53a4
Removes hardcoded socket subscription intervals and allows for interv…
anultravioletaurora 735cfd1
fix linter errors
anultravioletaurora cf7a4b3
Use PeriodicListenerInterval in more places for consistency, changelo…
anultravioletaurora f8a71c7
add exponential backoff to reconnection of the websocket after a disc…
anultravioletaurora 7ffa4e4
PR feedback
anultravioletaurora 95bf230
update websocket getter function
anultravioletaurora 37b7f70
linting
anultravioletaurora 10ca1ea
PR feedback
anultravioletaurora 84647ac
fix linting
anultravioletaurora d05d359
PR feedback
anultravioletaurora 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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| /** | ||
| * This Source Code Form is subject to the terms of the Mozilla Public | ||
| * License, v. 2.0. If a copy of the MPL was not distributed with this | ||
| * file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
| */ | ||
|
|
||
| /** The authorization header field name. */ | ||
| export const AUTHORIZATION_HEADER = 'Authorization'; | ||
|
|
||
| /** The authorization query parameter name. */ | ||
| export const AUTHORIZATION_PARAMETER = 'ApiKey'; |
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 |
|---|---|---|
|
|
@@ -9,6 +9,7 @@ import type { AxiosInstance } from 'axios'; | |
| import { Api } from './api'; | ||
| import { DiscoveryService } from './discovery/discovery-service'; | ||
| import type { ClientInfo, DeviceInfo } from './models'; | ||
| import type { WebSocketSubscriptionIntervals } from './websocket'; | ||
|
|
||
| /** Supported server version constants */ | ||
| export * from './versions'; | ||
|
|
@@ -36,9 +37,10 @@ export class Jellyfin { | |
| * @param basePath A base path of a server. | ||
| * @param accessToken An (optional) access token to use for authentication. | ||
| * @param axiosInstance An (optional) Axios instance for the Api to use. | ||
| * @param webSocketSubscriptionIntervals An (optional) {@link WebSocketSubscriptionIntervals} object for defining message subscription intervals. | ||
| * @returns An Api instance. | ||
| */ | ||
| createApi(basePath: string, accessToken?: string, axiosInstance?: AxiosInstance): Api { | ||
| return new Api(basePath, this.clientInfo, this.deviceInfo, accessToken, axiosInstance); | ||
| createApi(basePath: string, accessToken?: string, axiosInstance?: AxiosInstance, webSocketSubscriptionIntervals?: WebSocketSubscriptionIntervals): Api { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Outside of the scope for this PR, but I think it would make sense to change this function to take a single object instead. That is easier to work with when options change in future releases. |
||
| return new Api(basePath, this.clientInfo, this.deviceInfo, accessToken, axiosInstance, webSocketSubscriptionIntervals); | ||
| } | ||
| } | ||
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't really work great when there is no access token (yet)