Merge pull request #175 from vexorian/20201017_dev

Fix #167, extra / in plex uri gives no error during backend route check, but fails when playing the video.
This commit is contained in:
vexorian 2020-10-17 15:55:11 -04:00 committed by GitHub
commit c548ede724
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 4 deletions

View File

@ -52,6 +52,9 @@ class PlexPlayer {
throw Error(`Unable to find server "${lineupItem.serverKey}" specied by program.`);
}
server = server[0];
if (server.uri.endsWith("/")) {
server.uri = server.uri.slice(0, server.uri.length - 1);
}
try {
let plexSettings = db['plex-settings'].find()[0];

View File

@ -2,8 +2,15 @@ const request = require('request')
class Plex {
constructor(opts) {
this._accessToken = typeof opts.accessToken !== 'undefined' ? opts.accessToken : ''
let uri = "http://127.0.0.1:32400";
if ( (typeof opts.uri) !== 'undefined' ) {
uri = opts.uri;
if (uri.endsWith("/")) {
uri = uri.slice(0, uri.length - 1);
}
}
this._server = {
uri: typeof opts.uri !== 'undefined' ? opts.uri : 'http://127.0.0.1:32400',
uri: uri,
host: typeof opts.host !== 'undefined' ? opts.host : '127.0.0.1',
port: typeof opts.port !== 'undefined' ? opts.port : '32400',
protocol: typeof opts.protocol !== 'undefined' ? opts.protocol : 'http'

View File

@ -62,9 +62,7 @@
</div>
</div>
<!--div class="modal-body container list-group list-group-root" vs-repeat="options" dnd-list="content" ng-if="showList()"-->
<div class="modal-body container list-group list-group-root filler-list" dnd-list="content" ng-if="showList()" >
<div class="modal-body container list-group list-group-root filler-list" vs-repeat="options" dnd-list="content" ng-if="showList()">
<div class="list-group-item flex-container" style="cursor: default;" ng-repeat="x in content" dnd-draggable="x" dnd-moved="content.splice($index, 1)" dnd-effect-allowed="move">
<div class="program-start" >
{{durationString(x.duration)}}