-
-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add initial support for jellyfin clients * Add additional movie information to database * Add more routing stubs * Add endpoints for movie artwork * More jellyfin api stubs * Jellyfin websocket emulation * hwaccel_output_format should be an input option * Simplify episode indexing and identification * Add new FTPS driver for importing media * More importing stuff * Add new config option for import concurrency * Initial fixes for jellyfin emulation * More jellyfin emulation work * Working playback in jellyfin client * More jellyfin stuff
- Loading branch information
1 parent
2a61242
commit 9b698d3
Showing
27 changed files
with
1,481 additions
and
43 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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 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 |
---|---|---|
|
@@ -127,6 +127,9 @@ | |
} | ||
} | ||
}, | ||
"seedboxImport": { | ||
"concurrency": 1 | ||
}, | ||
"seedboxes": [ | ||
{ | ||
"name": "Main seedbox", | ||
|
This file contains 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,65 @@ | ||
import restify from 'restify'; | ||
import routes from './routes'; | ||
import corsMiddleware from 'restify-cors-middleware2'; | ||
|
||
export default class EmbyServerAPI { | ||
/** | ||
* @param {EmbyEmulation} embyEmulation | ||
*/ | ||
constructor(embyEmulation) { | ||
this.embyEmulation = embyEmulation; | ||
|
||
// Initialize REST based server | ||
this.server = restify.createServer(); | ||
|
||
// Allow remote clients to connect to the backend | ||
const cors = corsMiddleware({ | ||
preflightMaxAge: 5, // Optional | ||
origins: ['*'], | ||
allowHeaders: ['API-Token'], | ||
exposeHeaders: ['API-Token-Expiry'] | ||
}); | ||
|
||
this.server.pre(cors.preflight); | ||
this.server.use(cors.actual); | ||
|
||
this.server.use(restify.plugins.authorizationParser()); | ||
this.server.use(restify.plugins.queryParser({ mapParams: true })); | ||
this.server.use(restify.plugins.bodyParser({ mapParams: true })); | ||
|
||
this.server.pre(function(req, res, next) { | ||
req.url = req.url.toLowerCase(); | ||
next(); | ||
}); | ||
|
||
this.server.pre(function(req, res, next) { | ||
if (!req.headers['x-emby-authorization']) return next(); | ||
|
||
req.headers['emby'] = req.headers['x-emby-authorization'].split(', '); | ||
|
||
let auth = {}; | ||
|
||
for (let i in req.headers['emby']) { | ||
let item = req.headers['emby'][i].split('='); | ||
|
||
auth[item[0]] = item[1].replace(/"/g, ''); | ||
} | ||
|
||
req.headers['emby'] = auth; | ||
|
||
next(); | ||
}); | ||
|
||
this.server.use(async function (request, response) { | ||
console.log(request.url, request.params, request.method); | ||
}); | ||
|
||
// Add routes routes | ||
routes(this.server, this.embyEmulation); | ||
|
||
// Start restify server | ||
this.server.listen(8096, () => { | ||
console.log('Jellyfin emulation server listening at %s', this.server.url); | ||
}); | ||
} | ||
} |
This file contains 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,12 @@ | ||
export default (server, embyEmulation) => { | ||
server.get('/branding/configuration', async (req, res) => { | ||
res.send({ | ||
LoginDisclaimer: 'This is an Oblecto Media server', | ||
CustomCss: '' | ||
}); | ||
}); | ||
|
||
server.get('/branding/css', async (req, res) => { | ||
res.send(); | ||
}); | ||
}; |
32 changes: 32 additions & 0 deletions
32
src/lib/embyEmulation/ServerAPI/routes/displaypreferences/index.js
This file contains 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,32 @@ | ||
/** | ||
* @param {*} server | ||
* @param {EmbyEmulation} embyEmulation | ||
*/ | ||
export default (server, embyEmulation) => { | ||
server.get('/displaypreferences/usersettings', async (req, res) => { | ||
res.send( | ||
{ | ||
'Id':'3ce5b65d-e116-d731-65d1-efc4a30ec35c', | ||
'SortBy':'SortName', | ||
'RememberIndexing':false, | ||
'PrimaryImageHeight':250, | ||
'PrimaryImageWidth':250, | ||
'CustomPrefs':{ | ||
'chromecastVersion':'stable','skipForwardLength':'30000','skipBackLength':'10000','enableNextVideoInfoOverlay':'False','tvhome':null,'dashboardTheme':null,'http://192.168.176.55:30013/web/index.htmlmoviecollections':'{\u0022SortBy\u0022:\u0022SortName\u0022,\u0022SortOrder\u0022:\u0022Ascending\u0022}','http://192.168.176.55:30013/web/index.htmlseries':'{\u0022SortBy\u0022:\u0022SortName\u0022,\u0022SortOrder\u0022:\u0022Ascending\u0022}','file:///app/share/jellyfinmediaplayer/web-client/desktop/index.htmltrailers':'{\u0022SortBy\u0022:\u0022SortName\u0022,\u0022SortOrder\u0022:\u0022Ascending\u0022}','file:///app/share/jellyfinmediaplayer/web-client/desktop/index.htmlseries':'{\u0022SortBy\u0022:\u0022SortName\u0022,\u0022SortOrder\u0022:\u0022Ascending\u0022}' | ||
}, | ||
'ScrollDirection':'Horizontal', | ||
'ShowBackdrop':true, | ||
'RememberSorting':false, | ||
'SortOrder':'Ascending', | ||
'ShowSidebar':false, | ||
'Client':'emby' | ||
}); | ||
}); | ||
|
||
server.get('/LiveTv/Programs/Recommended', async (req, res) => { | ||
res.send( | ||
{ | ||
'Items':[],'TotalRecordCount':0,'StartIndex':0 | ||
}); | ||
}); | ||
}; |
This file contains 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,24 @@ | ||
import system from './system'; | ||
import users from './users'; | ||
import sessions from './sessions'; | ||
import displaypreferences from './displaypreferences'; | ||
import branding from './branding'; | ||
import shows from './shows'; | ||
import items from './items'; | ||
import videos from './videos'; | ||
|
||
/** | ||
* | ||
* @param server | ||
* @param {EmbyEmulation} embyEmulation | ||
*/ | ||
export default (server, embyEmulation) => { | ||
system(server, embyEmulation); | ||
users(server, embyEmulation); | ||
sessions(server, embyEmulation); | ||
displaypreferences(server, embyEmulation); | ||
branding(server, embyEmulation); | ||
shows(server, embyEmulation); | ||
items(server, embyEmulation); | ||
videos(server, embyEmulation); | ||
}; |
Oops, something went wrong.