Browse Source

Added downloader count to combined downloader
Edit Debug SSO a little bit

causefx 7 years ago
parent
commit
b36b3fb70b
5 changed files with 17 additions and 5 deletions
  1. 1 0
      .gitignore
  2. 3 3
      api/functions/organizr-functions.php
  3. 4 1
      css/organizr.css
  4. 0 0
      css/organizr.min.css
  5. 9 1
      js/functions.js

+ 1 - 0
.gitignore

@@ -72,6 +72,7 @@ test.php
 users.db
 speedtest.db
 chatpack.db
+Docker.txt
 config/cacert.pem
 config/config.php
 config/config*.bak.php

+ 3 - 3
api/functions/organizr-functions.php

@@ -35,7 +35,7 @@ function organizrSpecialSettings()
 			'plex' => array(
 				'enabled' => ($GLOBALS['ssoPlex']) ? true : false,
 				'cookie' => isset($_COOKIE['mpt']) ? true : false,
-				'machineID' => $GLOBALS['plexID'],
+				'machineID' => (strlen($GLOBALS['plexID']) == 40) ? true : false,
 				'token' => ($GLOBALS['plexToken'] !== '') ? true : false,
 				'oAuthEnabled' => ($GLOBALS['plexoAuth']) ? true : false,
 				'backend' => ($GLOBALS['authBackend'] == 'plex') ? true : false,
@@ -43,13 +43,13 @@ function organizrSpecialSettings()
 			'ombi' => array(
 				'enabled' => ($GLOBALS['ssoOmbi']) ? true : false,
 				'cookie' => isset($_COOKIE['Auth']) ? true : false,
-				'url' => ($GLOBALS['ombiURL'] !== '') ? true : false,
+				'url' => ($GLOBALS['ombiURL'] !== '') ? $GLOBALS['ombiURL'] : false,
 				'api' => ($GLOBALS['ombiToken'] !== '') ? true : false,
 			),
 			'tautulli' => array(
 				'enabled' => ($GLOBALS['ssoTautulli']) ? true : false,
 				'cookie' => !empty($tautulli) ? true : false,
-				'url' => ($GLOBALS['tautulliURL'] !== '') ? true : false,
+				'url' => ($GLOBALS['tautulliURL'] !== '') ? $GLOBALS['tautulliURL'] : false,
 			),
 		),
 		'ping' => array(

+ 4 - 1
css/organizr.css

@@ -1204,7 +1204,10 @@ span.fc-title {
     padding: 10px 11px 0px 5px;
     font-size: 30px;
 }
-
+.downloaderCount {
+    margin-top: -45px;
+    margin-left: -45px;
+}
 /*
 body,
 html {

File diff suppressed because it is too large
+ 0 - 0
css/organizr.min.css


+ 9 - 1
js/functions.js

@@ -4152,6 +4152,7 @@ function buildDownloaderItem(array, source, type='none'){
     //console.log(array);
     var queue = '';
     var history = '';
+    var count = 0;
 	switch (source) {
 		case 'sabnzbd':
             if(array.content.queueItems.queue.paused){
@@ -4167,6 +4168,7 @@ function buildDownloaderItem(array, source, type='none'){
                 queue = '<tr><td class="max-texts" lang="en">Nothing in queue</td></tr>';
             }
             $.each(array.content.queueItems.queue.slots, function(i,v) {
+                count = count + 1;
                 var action = (v.status == "Downloading") ? 'pause' : 'resume';
                 var actionIcon = (v.status == "Downloading") ? 'pause' : 'play';
                 queue += `
@@ -4209,6 +4211,7 @@ function buildDownloaderItem(array, source, type='none'){
                 queue = '<tr><td class="max-texts" lang="en">Nothing in queue</td></tr>';
             }
             $.each(array.content.queueItems.result, function(i,v) {
+                count = count + 1;
                 var action = (v.Status == "Downloading") ? 'pause' : 'resume';
                 var actionIcon = (v.Status == "Downloading") ? 'pause' : 'play';
                 var percent = Math.floor((v.FileSizeMB - v.RemainingSizeMB) * 100 / v.FileSizeMB);
@@ -4255,6 +4258,7 @@ function buildDownloaderItem(array, source, type='none'){
                 queue = '<tr><td class="max-texts" lang="en">Nothing in queue</td></tr>';
             }
             $.each(array.content.queueItems.arguments.torrents, function(i,v) {
+                count = count + 1;
                 switch (v.status) {
                     case 7:
                     case '7':
@@ -4314,6 +4318,7 @@ function buildDownloaderItem(array, source, type='none'){
             }
             //console.log(array);
             $.each(array.content.queueItems, function(i,v) {
+                count = count + 1;
                 var percent = Math.floor((v.downloaded / v.size) * 100);
                 var size = v.size != -1 ? humanFileSize(v.size,false) : "?";
                 var upload = v.seed !== '' ? humanFileSize(v.seed,true) : "0 B";
@@ -4345,6 +4350,7 @@ function buildDownloaderItem(array, source, type='none'){
                 queue = '<tr><td class="max-texts" lang="en">Nothing in queue</td></tr>';
             }
             $.each(array.content.queueItems.arguments.torrents, function(i,v) {
+                count = count + 1;
                 switch (v.state) {
                     case 'stalledDL':
                         var status = 'No Peers';
@@ -4399,6 +4405,7 @@ function buildDownloaderItem(array, source, type='none'){
                 queue = '<tr><td class="max-texts" lang="en">Nothing in queue</td></tr>';
             }
             $.each(array.content.queueItems, function(i,v) {
+                count = count + 1;
                 var percent = Math.floor(v.progress);
                 var size = v.total_size != -1 ? humanFileSize(v.total_size,true) : "?";
                 var upload = v.upload_payload_rate != -1 ? humanFileSize(v.upload_payload_rate,true) : "?";
@@ -4430,6 +4437,7 @@ function buildDownloaderItem(array, source, type='none'){
     if(history !== ''){
         $('.'+source+'-history').html(history);
     }
+    $('#count-'+source).html(count);
 }
 function buildDownloader(source){
     var queueButton = 'QUEUE';
@@ -4548,7 +4556,7 @@ function buildDownloaderCombined(source){
 
     }
     var mainMenu = `<ul class="nav customtab nav-tabs combinedMenuList" role="tablist">`;
-    var addToMainMenu = `<li role="presentation" class="`+active+`"><a onclick="homepageDownloader('`+source+`')" href="#combined-`+source+`" aria-controls="home" role="tab" data-toggle="tab" aria-expanded="true"><span class=""><img src="./plugins/images/tabs/`+source+`.png" class="homepageImageTitle"></span></a></li>`;
+    var addToMainMenu = `<li role="presentation" class="`+active+`"><a onclick="homepageDownloader('`+source+`')" href="#combined-`+source+`" aria-controls="home" role="tab" data-toggle="tab" aria-expanded="true"><span class=""><img src="./plugins/images/tabs/`+source+`.png" class="homepageImageTitle"><span class="badge bg-org downloaderCount" id="count-`+source+`"></span> </span></a></li>`;
     var listing = '';
     var headerAlt = '';
     var header = '';

Some files were not shown because too many files changed in this diff