mirror of
https://github.com/KevinMidboe/seasoned.git
synced 2026-04-26 01:23:36 +00:00
New sidebarelement for users that are logged inn. Now they can be redirected directly to the movie in plex.
This commit is contained in:
16
src/api.js
16
src/api.js
@@ -252,6 +252,21 @@ const getRequestStatus = (id, type, authorization_token=undefined) => {
|
||||
.catch(err => Promise.reject(err))
|
||||
}
|
||||
|
||||
const watchLink = (title, year, authorization_token=undefined) => {
|
||||
const url = new URL('v1/plex/watch-link', SEASONED_URL)
|
||||
url.searchParams.append('title', title)
|
||||
url.searchParams.append('year', year)
|
||||
|
||||
const headers = {
|
||||
'Authorization': authorization_token,
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
|
||||
return fetch(url.href, { headers })
|
||||
.then(resp => resp.json())
|
||||
.then(response => response.link)
|
||||
}
|
||||
|
||||
// - - - Seasoned user endpoints - - -
|
||||
|
||||
const register = (username, password) => {
|
||||
@@ -458,6 +473,7 @@ export {
|
||||
searchTorrents,
|
||||
addMagnet,
|
||||
request,
|
||||
watchLink,
|
||||
getRequestStatus,
|
||||
linkPlexAccount,
|
||||
unlinkPlexAccount,
|
||||
|
||||
Reference in New Issue
Block a user