Selaa lähdekoodia

more fixes and work on upgrade process

causefx 9 vuotta sitten
vanhempi
commit
1b35f481aa
3 muutettua tiedostoa jossa 35 lisäystä ja 9 poistoa
  1. 10 7
      functions.php
  2. 2 2
      homepage.php
  3. 23 0
      settings.php

+ 10 - 7
functions.php

@@ -655,7 +655,7 @@ function resolvePlexItem($server, $token, $item, $nowPlaying = false, $showNames
                 $transcoded = floor($item->TranscodeSession['progress']- $watched);
                 $stream = $item->Media->Part->Stream['decision'];
                 $user = $role == "admin" ? $item->User['title'] : "";
-                $id = $item->Player['machineIdentifier'];
+                $id = str_replace('"', '', $item->Player['machineIdentifier']);
                 $streamInfo = buildStream(array(
                     'platform' => (string) $item->Player['platform'],
                     'device' => (string) $item->Player['device'],
@@ -686,7 +686,7 @@ function resolvePlexItem($server, $token, $item, $nowPlaying = false, $showNames
                 $transcoded = floor($item->TranscodeSession['progress']- $watched);
                 $stream = $item->Media->Part->Stream['decision'];
                 $user = $role == "admin" ? $item->User['title'] : "";
-                $id = $item->Player['machineIdentifier'];
+                $id = str_replace('"', '', $item->Player['machineIdentifier']);
                 $streamInfo = buildStream(array(
                     'platform' => (string) $item->Player['platform'],
                     'device' => (string) $item->Player['device'],
@@ -720,7 +720,7 @@ function resolvePlexItem($server, $token, $item, $nowPlaying = false, $showNames
                 $transcoded = floor($item->TranscodeSession['progress']- $watched);
                 $stream = $item->Media->Part->Stream['decision'];
                 $user = $role == "admin" ? $item->User['title'] : "";
-                $id = $item->Player['machineIdentifier'];
+                $id = str_replace('"', '', $item->Player['machineIdentifier']);
                 $streamInfo = buildStream(array(
                     'platform' => (string) $item->Player['platform'],
                     'device' => (string) $item->Player['device'],
@@ -756,7 +756,7 @@ function resolvePlexItem($server, $token, $item, $nowPlaying = false, $showNames
                 $transcoded = floor($item->TranscodeSession['progress']- $watched);
                 $stream = $item->Media->Part->Stream['decision'];
                 $user = $role == "admin" ? $item->User['title'] : "";
-                $id = $item->Player['machineIdentifier'];
+                $id = str_replace('"', '', $item->Player['machineIdentifier']);
                 $streamInfo = buildStream(array(
                     'platform' => (string) $item->Player['platform'],
                     'device' => (string) $item->Player['device'],
@@ -789,7 +789,7 @@ function resolvePlexItem($server, $token, $item, $nowPlaying = false, $showNames
                 $transcoded = floor($item->TranscodeSession['progress']- $watched);
                 $stream = $item->Media->Part->Stream['decision'];
                 $user = $role == "admin" ? $item->User['title'] : "";
-                $id = $item->Player['machineIdentifier'];
+                $id = str_replace('"', '', $item->Player['machineIdentifier']);
                 $streamInfo = buildStream(array(
                     'platform' => (string) $item->Player['platform'],
                     'device' => (string) $item->Player['device'],
@@ -1513,6 +1513,8 @@ function buildSettings($array) {
 	);
 	*/
 	
+	$notifyExplode = explode("-", NOTIFYEFFECT);
+	
 	$fieldFunc = function($fieldArr) {
 		$fields = '<div class="row">';
 		foreach($fieldArr as $key => $value) {
@@ -1607,14 +1609,14 @@ function buildSettings($array) {
 					}
 				});
 				if (errorFields.length) {
-					parent.notify(\'Fields have errors: \'+errorFields.join(\', \')+\'!\', \'bullhorn\', \'success\', 5000, \'bar\', \'slidetop\');
+					parent.notify(\'Fields have errors: \'+errorFields.join(\', \')+\'!\', \'bullhorn\', \'error\', 5000, \''.$notifyExplode[0].'\', \''.$notifyExplode[1].'\');
 				} else if (hasVals) {
 					console.log(newVals);
 					ajax_request(\'POST\', \''.(isset($array['submitAction'])?$array['submitAction']:'update-config').'\', newVals, function(data, code) {
 						$(\'#'.$pageID.'_form\').find(\'[data-changed=true][name]\').removeAttr(\'data-changed\');
 					});
 				} else {
-					parent.notify(\'Nothing to update!\', \'bullhorn\', \'success\', 5000, \'bar\', \'slidetop\');
+					parent.notify(\'Nothing to update!\', \'bullhorn\', \'error\', 5000, \''.$notifyExplode[0].'\', \''.$notifyExplode[1].'\');
 				}
 				return false;
 			});
@@ -2225,6 +2227,7 @@ function upgradeInstall($branch = 'master') {
     $source = __DIR__ . '/upgrade/Organizr-'.$branch.'/';
     $cleanup = __DIR__ . "/upgrade/";
     $destination = __DIR__ . "/";
+	writeLog("success", "starting organizr upgrade process");
     downloadFile($url, $file);
     unzipFile($file);
     rcopy($source, $destination);

+ 2 - 2
homepage.php

@@ -549,7 +549,7 @@ endif; ?>
             e.preventDefault();
         });
         
-		$('.openTab').click(function(e){
+		$(document).on("click", ".openTab", function(e) {
 			if($(this).attr("openTab") === "true") {
 				var isActive = parent.$("div[data-content-name^='<?php echo strtolower(PLEXTABNAME);?>']");
 				var activeFrame = isActive.children('iframe');
@@ -573,7 +573,7 @@ endif; ?>
         }
 		
         $( document ).ready(function() {
-            $('#plexSearchForm_submit').on('click', function () {
+            $('#plexSearchForm').on('submit', function () {
                 ajax_request('POST', 'search-plex', {
                     searchtitle: $('#plexSearchForm [name=search-title]').val(),
                 }).done(function(data){ $('#resultshere').html(data);});

+ 23 - 0
settings.php

@@ -301,6 +301,29 @@ endif; ?>
 
             <!--Content-->
             <div id="content"  style="margin:0 10px; overflow:hidden">
+				<!-- Update -->
+				<div id="updateStatus" class="row" style="display: none;z-index: 10000;position: relative;">
+        			<div class="col-lg-12">
+          				<div class="content-box box-shadow">
+            				<div class="table-responsive">
+              					<table class="table table-striped progress-widget zero-m">
+                					<thead><tr><th>Updating</th></tr></thead>
+                					<tbody>
+										<tr>
+											<td>
+												<div class="progress">
+													<div id="updateStausBar" class="progress-bar progress-bar-success progress-bar-striped active" role="progressbar" aria-valuenow="85" aria-valuemin="0" aria-valuemax="100" style="width: 85%">
+													</div>
+												</div>
+											</td>
+                  						</tr>
+									</tbody>
+              					</table>
+            				</div>
+						</div>
+        			</div>
+				</div>
+				<!-- Check Frame Modal -->
                 <div class="modal fade checkFrame" tabindex="-1" role="dialog">
                     <div class="modal-dialog modal-lg" role="document">
                         <div class="modal-content">