Преглед изворни кода

fixed Tautulli Homepage Error - Unable to get list of libraries (#1798)

CauseFX пре 4 година
родитељ
комит
bb75291c0b
1 измењених фајлова са 8 додато и 5 уклоњено
  1. 8 5
      api/homepage/tautulli.php

+ 8 - 5
api/homepage/tautulli.php

@@ -14,12 +14,16 @@ trait TautulliHomepageItem
 		if ($infoOnly) {
 			return $homepageInformation;
 		}
+
 		$libraryList = [['name' => 'Refresh page to update List', 'value' => '', 'disabled' => true]];
 		if (!empty($this->config['tautulliApikey']) && !empty($this->config['tautulliURL'])) {
 			$libraryList = [];
-			$loop = $this->tautulliLibraryList('key')['libraries'];
-			foreach ($loop as $key => $value) {
-				$libraryList[] = ['name' => $key, 'value' => $value];
+			$loop = $this->tautulliLibraryList('key');
+			if ($loop) {
+				$loop = $loop['libraries'];
+				foreach ($loop as $key => $value) {
+					$libraryList[] = ['name' => $key, 'value' => $value];
+				}
 			}
 		}
 		$homepageSettings = [
@@ -275,10 +279,9 @@ trait TautulliHomepageItem
 					return $libraryList;
 				}
 			} catch (Requests_Exception $e) {
-				$this->setAPIResponse('error', 'Tautulli Homepage Error - Unable to get list of libraries: ' . $e->getMessage(), 500);
 				$this->writeLog('error', 'Tautulli Homepage Error - Unable to get list of libraries: ' . $e->getMessage(), 'SYSTEM');
 				return false;
-			};
+			}
 		}
 		return false;
 	}