Przeglądaj źródła

moved cache folder to new data folder

CauseFX 4 lat temu
rodzic
commit
cac6c04b39

+ 1 - 1
api/classes/organizr.class.php

@@ -139,7 +139,7 @@ class Organizr
 		// Set Paths
 		$this->paths = array(
 			'Root Folder' => dirname(__DIR__, 2) . DIRECTORY_SEPARATOR,
-			'Cache Folder' => dirname(__DIR__, 2) . DIRECTORY_SEPARATOR . 'plugins' . DIRECTORY_SEPARATOR . 'images' . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR,
+			'Cache Folder' => dirname(__DIR__, 2) . DIRECTORY_SEPARATOR . 'data' . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR,
 			'Tab Folder' => $this->root . DIRECTORY_SEPARATOR . 'data' . DIRECTORY_SEPARATOR . 'userTabs' . DIRECTORY_SEPARATOR,
 			'API Folder' => dirname(__DIR__, 1) . DIRECTORY_SEPARATOR,
 			'DB Folder' => ($this->hasDB()) ? $this->config['dbLocation'] : false

+ 1 - 1
api/functions/demo-functions.php

@@ -13,7 +13,7 @@ trait DemoFunctions
 		if (file_exists($path)) {
 			$data = file_get_contents($path);
 			$path = (strpos($file, '/') !== false) ? explode('/', $file)[0] . '/' : '';
-			$data = $this->userDefinedIdReplacementLink($data, ['plugins/images/cache/' => 'api/demo_data/' . $path . 'images/']);
+			$data = $this->userDefinedIdReplacementLink($data, ['data/cache/' => 'api/demo_data/' . $path . 'images/']);
 			$data = json_decode($data, true);
 			$this->setResponse(200, 'Demo data for file: ' . $file, $data['response']['data']);
 			return $data['response']['data'];

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

@@ -450,7 +450,7 @@ trait OrganizrFunctions
 	public function getHomepageMediaImage()
 	{
 		$refresh = false;
-		$cacheDirectory = dirname(__DIR__, 2) . DIRECTORY_SEPARATOR . 'plugins' . DIRECTORY_SEPARATOR . 'images' . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR;
+		$cacheDirectory = dirname(__DIR__, 2) . DIRECTORY_SEPARATOR . 'data' . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR;
 		if (!file_exists($cacheDirectory)) {
 			mkdir($cacheDirectory, 0777, true);
 		}
@@ -524,7 +524,7 @@ trait OrganizrFunctions
 
 	public function cacheImage($url, $name, $extension = 'jpg')
 	{
-		$cacheDirectory = dirname(__DIR__, 2) . DIRECTORY_SEPARATOR . 'plugins' . DIRECTORY_SEPARATOR . 'images' . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR;
+		$cacheDirectory = dirname(__DIR__, 2) . DIRECTORY_SEPARATOR . 'data' . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR;
 		if (!file_exists($cacheDirectory)) {
 			mkdir($cacheDirectory, 0777, true);
 		}

+ 8 - 9
api/homepage/couchpotato.php

@@ -2,7 +2,7 @@
 
 trait CouchPotatoHomepageItem
 {
-	
+
 	public function couchPotatoSettingsArray($infoOnly = false)
 	{
 		$homepageInformation = [
@@ -42,7 +42,7 @@ trait CouchPotatoHomepageItem
 		];
 		return array_merge($homepageInformation, $homepageSettings);
 	}
-	
+
 	public function couchPotatoHomepagePermissions($key = null)
 	{
 		$permissions = [
@@ -61,7 +61,7 @@ trait CouchPotatoHomepageItem
 		];
 		return $this->homepageCheckKeyPermissions($key, $permissions);
 	}
-	
+
 	public function getCouchPotatoCalendar()
 	{
 		if (!$this->homepageItemPermissions($this->couchPotatoHomepagePermissions('calendar'), true)) {
@@ -84,7 +84,7 @@ trait CouchPotatoHomepageItem
 		$this->setAPIResponse('success', null, 200, $calendarItems);
 		return $calendarItems;
 	}
-	
+
 	public function formatCouchCalendar($array, $number)
 	{
 		$api = json_decode($array, true);
@@ -130,13 +130,13 @@ trait CouchPotatoHomepageItem
 			} elseif (!empty($child['info']['images']['backdrop'])) {
 				$banner = $child['info']['images']['backdrop_original'][0];
 			} else {
-				$banner = "/plugins/images/cache/no-np.png";
+				$banner = "/plugins/images/homepage/no-np.png";
 			}
-			if ($banner !== "/plugins/images/cache/no-np.png") {
-				$cacheDirectory = dirname(__DIR__, 2) . DIRECTORY_SEPARATOR . 'plugins' . DIRECTORY_SEPARATOR . 'images' . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR;
+			if ($banner !== "/plugins/images/homepage/no-np.png") {
+				$cacheDirectory = dirname(__DIR__, 2) . DIRECTORY_SEPARATOR . 'data' . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR;
 				$imageURL = $banner;
 				$cacheFile = $cacheDirectory . $movieID . '.jpg';
-				$banner = 'plugins/images/cache/' . $movieID . '.jpg';
+				$banner = 'data/cache/' . $movieID . '.jpg';
 				if (!file_exists($cacheFile)) {
 					$this->cacheImage($imageURL, $movieID);
 					unset($imageURL);
@@ -171,7 +171,6 @@ trait CouchPotatoHomepageItem
 				"bgColor" => str_replace('text', 'bg', $downloaded),
 				"details" => $details
 			));
-			
 		}
 		if ($i != 0) {
 			return $gotCalendar;

+ 14 - 15
api/homepage/emby.php

@@ -54,7 +54,7 @@ trait EmbyHomepageItem
 		];
 		return array_merge($homepageInformation, $homepageSettings);
 	}
-	
+
 	public function testConnectionEmby()
 	{
 		if (!$this->homepageItemPermissions($this->embyHomepagePermissions('test'), true)) {
@@ -77,7 +77,7 @@ trait EmbyHomepageItem
 			return false;
 		}
 	}
-	
+
 	public function embyHomepagePermissions($key = null)
 	{
 		$permissions = [
@@ -136,7 +136,7 @@ trait EmbyHomepageItem
 		];
 		return $this->homepageCheckKeyPermissions($key, $permissions);
 	}
-	
+
 	public function homepageOrderembynowplaying()
 	{
 		if ($this->homepageItemPermissions($this->embyHomepagePermissions('streams'))) {
@@ -152,7 +152,7 @@ trait EmbyHomepageItem
 				';
 		}
 	}
-	
+
 	public function homepageOrderembyrecent()
 	{
 		if ($this->homepageItemPermissions($this->embyHomepagePermissions('recent'))) {
@@ -168,7 +168,7 @@ trait EmbyHomepageItem
 				';
 		}
 	}
-	
+
 	public function getEmbyHomepageStreams()
 	{
 		if (!$this->homepageItemPermissions($this->embyHomepagePermissions('streams'), true)) {
@@ -200,7 +200,7 @@ trait EmbyHomepageItem
 			return false;
 		}
 	}
-	
+
 	public function getEmbyHomepageRecent()
 	{
 		if (!$this->homepageItemPermissions($this->embyHomepagePermissions('recent'), true)) {
@@ -212,8 +212,7 @@ trait EmbyHomepageItem
 		$showPlayed = false;
 		$userId = 0;
 		try {
-			
-			
+
 			if (isset($this->user['username'])) {
 				$username = strtolower($this->user['username']);
 			}
@@ -259,7 +258,7 @@ trait EmbyHomepageItem
 			return false;
 		}
 	}
-	
+
 	public function getEmbyHomepageMetadata($array)
 	{
 		if (!$this->homepageItemPermissions($this->embyHomepagePermissions('metadata'), true)) {
@@ -319,7 +318,7 @@ trait EmbyHomepageItem
 			return false;
 		}
 	}
-	
+
 	public function resolveEmbyItem($itemDetails)
 	{
 		$item = isset($itemDetails['NowPlayingItem']['Id']) ? $itemDetails['NowPlayingItem'] : $itemDetails;
@@ -331,8 +330,8 @@ trait EmbyHomepageItem
 		$actorHeight = 450;
 		$actorWidth = 300;
 		// Cache Directories
-		$cacheDirectory = dirname(__DIR__, 2) . DIRECTORY_SEPARATOR . 'plugins' . DIRECTORY_SEPARATOR . 'images' . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR;
-		$cacheDirectoryWeb = 'plugins/images/cache/';
+		$cacheDirectory = dirname(__DIR__, 2) . DIRECTORY_SEPARATOR . 'data' . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR;
+		$cacheDirectoryWeb = 'data/cache/';
 		// Types
 		//$embyItem['array-item'] = $item;
 		//$embyItem['array-itemdetails'] = $itemDetails;
@@ -508,11 +507,11 @@ trait EmbyHomepageItem
 			$embyItem['imageURL'] = 'api/v2/homepage/image?source=emby&type=' . $embyItem['imageType'] . '&img=' . $embyItem['thumb'] . '&height=' . $height . '&width=' . $width . '&key=' . $embyItem['key'] . '';
 		}
 		if (!$embyItem['nowPlayingThumb']) {
-			$embyItem['nowPlayingOriginalImage'] = $embyItem['nowPlayingImageURL'] = "plugins/images/cache/no-np.png";
+			$embyItem['nowPlayingOriginalImage'] = $embyItem['nowPlayingImageURL'] = "plugins/images/homepage/no-np.png";
 			$embyItem['nowPlayingKey'] = "no-np";
 		}
 		if (!$embyItem['thumb']) {
-			$embyItem['originalImage'] = $embyItem['imageURL'] = "plugins/images/cache/no-list.png";
+			$embyItem['originalImage'] = $embyItem['imageURL'] = "plugins/images/homepage/no-list.png";
 			$embyItem['key'] = "no-list";
 		}
 		if (isset($useImage)) {
@@ -520,5 +519,5 @@ trait EmbyHomepageItem
 		}
 		return $embyItem;
 	}
-	
+
 }

+ 14 - 14
api/homepage/jellyfin.php

@@ -2,7 +2,7 @@
 
 trait JellyfinHomepageItem
 {
-	
+
 	public function jellyfinSettingsArray($infoOnly = false)
 	{
 		$homepageInformation = [
@@ -54,7 +54,7 @@ trait JellyfinHomepageItem
 		];
 		return array_merge($homepageInformation, $homepageSettings);
 	}
-	
+
 	public function testConnectionJellyfin()
 	{
 		if (empty($this->config['jellyfinURL'])) {
@@ -88,7 +88,7 @@ trait JellyfinHomepageItem
 			return false;
 		}
 	}
-	
+
 	public function jellyfinHomepagePermissions($key = null)
 	{
 		$permissions = [
@@ -135,7 +135,7 @@ trait JellyfinHomepageItem
 		];
 		return $this->homepageCheckKeyPermissions($key, $permissions);
 	}
-	
+
 	public function homepageOrderjellyfinnowplaying()
 	{
 		if ($this->homepageItemPermissions($this->jellyfinHomepagePermissions('streams'))) {
@@ -151,7 +151,7 @@ trait JellyfinHomepageItem
 				';
 		}
 	}
-	
+
 	public function homepageOrderjellyfinrecent()
 	{
 		if ($this->homepageItemPermissions($this->jellyfinHomepagePermissions('recent'))) {
@@ -167,7 +167,7 @@ trait JellyfinHomepageItem
 				';
 		}
 	}
-	
+
 	public function getJellyfinHomepageStreams()
 	{
 		if (!$this->homepageItemPermissions($this->jellyfinHomepagePermissions('streams'), true)) {
@@ -199,7 +199,7 @@ trait JellyfinHomepageItem
 			return false;
 		}
 	}
-	
+
 	public function getJellyfinHomepageRecent()
 	{
 		if (!$this->homepageItemPermissions($this->jellyfinHomepagePermissions('recent'), true)) {
@@ -256,7 +256,7 @@ trait JellyfinHomepageItem
 			return false;
 		}
 	}
-	
+
 	public function getJellyfinHomepageMetadata($array)
 	{
 		if (!$this->homepageItemPermissions($this->jellyfinHomepagePermissions('metadata'), true)) {
@@ -316,7 +316,7 @@ trait JellyfinHomepageItem
 			return false;
 		}
 	}
-	
+
 	public function resolveJellyfinItem($itemDetails)
 	{
 		$item = isset($itemDetails['NowPlayingItem']['Id']) ? $itemDetails['NowPlayingItem'] : $itemDetails;
@@ -328,8 +328,8 @@ trait JellyfinHomepageItem
 		$actorHeight = 450;
 		$actorWidth = 300;
 		// Cache Directories
-		$cacheDirectory = dirname(__DIR__, 2) . DIRECTORY_SEPARATOR . 'plugins' . DIRECTORY_SEPARATOR . 'images' . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR;
-		$cacheDirectoryWeb = 'plugins/images/cache/';
+		$cacheDirectory = dirname(__DIR__, 2) . DIRECTORY_SEPARATOR . 'data' . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR;
+		$cacheDirectoryWeb = 'data/cache/';
 		// Types
 		switch (@$item['Type']) {
 			case 'Series':
@@ -503,11 +503,11 @@ trait JellyfinHomepageItem
 			$jellyfinItem['imageURL'] = 'api/v2/homepage/image?source=jellyfin&type=' . $jellyfinItem['imageType'] . '&img=' . $jellyfinItem['thumb'] . '&height=' . $height . '&width=' . $width . '&key=' . $jellyfinItem['key'] . '';
 		}
 		if (!$jellyfinItem['nowPlayingThumb']) {
-			$jellyfinItem['nowPlayingOriginalImage'] = $jellyfinItem['nowPlayingImageURL'] = "plugins/images/cache/no-np.png";
+			$jellyfinItem['nowPlayingOriginalImage'] = $jellyfinItem['nowPlayingImageURL'] = "plugins/images/homepage/no-np.png";
 			$jellyfinItem['nowPlayingKey'] = "no-np";
 		}
 		if (!$jellyfinItem['thumb']) {
-			$jellyfinItem['originalImage'] = $jellyfinItem['imageURL'] = "plugins/images/cache/no-list.png";
+			$jellyfinItem['originalImage'] = $jellyfinItem['imageURL'] = "plugins/images/homepage/no-list.png";
 			$jellyfinItem['key'] = "no-list";
 		}
 		if (isset($useImage)) {
@@ -515,5 +515,5 @@ trait JellyfinHomepageItem
 		}
 		return $jellyfinItem;
 	}
-	
+
 }

+ 11 - 12
api/homepage/lidarr.php

@@ -52,7 +52,7 @@ trait LidarrHomepageItem
 		];
 		return array_merge($homepageInformation, $homepageSettings);
 	}
-	
+
 	public function testConnectionLidarr()
 	{
 		if (empty($this->config['lidarrURL'])) {
@@ -84,7 +84,6 @@ trait LidarrHomepageItem
 					$errors .= $ip . ': Response was not JSON';
 					$failed = true;
 				}
-				
 			} catch (Exception $e) {
 				$failed = true;
 				$ip = $value['url'];
@@ -100,7 +99,7 @@ trait LidarrHomepageItem
 			return true;
 		}
 	}
-	
+
 	public function lidarrHomepagePermissions($key = null)
 	{
 		$permissions = [
@@ -133,7 +132,7 @@ trait LidarrHomepageItem
 		];
 		return $this->homepageCheckKeyPermissions($key, $permissions);
 	}
-	
+
 	public function getLidarrQueue()
 	{
 		if (!$this->homepageItemPermissions($this->lidarrHomepagePermissions('queue'), true)) {
@@ -165,7 +164,7 @@ trait LidarrHomepageItem
 		$this->setAPIResponse('success', null, 200, $api);
 		return $api;;
 	}
-	
+
 	public function getLidarrCalendar($startDate = null, $endDate = null)
 	{
 		$startDate = ($startDate) ?? $_GET['start'] ?? date('Y-m-d', strtotime('-' . $this->config['calendarStart'] . ' days'));
@@ -199,7 +198,7 @@ trait LidarrHomepageItem
 		$this->setAPIResponse('success', null, 200, $calendarItems);
 		return $calendarItems;
 	}
-	
+
 	public function formatLidarrCalendar($array, $number)
 	{
 		$array = json_decode($array, true);
@@ -232,20 +231,20 @@ trait LidarrHomepageItem
 			} else {
 				$downloaded = "text-danger";
 			}
-			$fanart = "/plugins/images/cache/no-np.png";
+			$fanart = "/plugins/images/homepage/no-np.png";
 			foreach ($child['artist']['images'] as $image) {
 				if ($image['coverType'] == "fanart") {
 					$fanart = str_replace('http://', 'https://', $image['url']);
 				}
 			}
 			$href = $this->config['lidarrCalendarLink'] ?? '';
-			if (empty($href) && !empty($this->config['lidarrURL'])){
-				$href_arr = explode(',',$this->config['lidarrURL']);
+			if (empty($href) && !empty($this->config['lidarrURL'])) {
+				$href_arr = explode(',', $this->config['lidarrURL']);
 				$href = reset($href_arr);
 			}
-			if (!empty($href)){
+			if (!empty($href)) {
 				$href = $href . '/artist/' . $child['artist']['foreignArtistId'];
-				$href = str_replace("//artist/","/artist/",$href);
+				$href = str_replace("//artist/", "/artist/", $href);
 			}
 			$details = array(
 				"seasonCount" => '',
@@ -283,5 +282,5 @@ trait LidarrHomepageItem
 		}
 		return false;
 	}
-	
+
 }

+ 5 - 5
api/homepage/monitorr.php

@@ -37,7 +37,7 @@ trait MonitorrHomepageItem
 		];
 		return array_merge($homepageInformation, $homepageSettings);
 	}
-	
+
 	public function monitorrHomepagePermissions($key = null)
 	{
 		$permissions = [
@@ -55,7 +55,7 @@ trait MonitorrHomepageItem
 		];
 		return $this->homepageCheckKeyPermissions($key, $permissions);
 	}
-	
+
 	public function homepageOrderMonitorr()
 	{
 		if ($this->homepageItemPermissions($this->monitorrHomepagePermissions('main'))) {
@@ -71,7 +71,7 @@ trait MonitorrHomepageItem
 				';
 		}
 	}
-	
+
 	public function getMonitorrHomepageData()
 	{
 		if (!$this->homepageItemPermissions($this->monitorrHomepagePermissions('main'), true)) {
@@ -124,13 +124,13 @@ trait MonitorrHomepageItem
 					$ext = explode('.', $image);
 					$ext = $ext[key(array_slice($ext, -1, 1, true))];
 					$imageUrl = $url . '/assets' . $image;
-					$cacheDirectory = dirname(__DIR__, 2) . DIRECTORY_SEPARATOR . 'plugins' . DIRECTORY_SEPARATOR . 'images' . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR;
+					$cacheDirectory = dirname(__DIR__, 2) . DIRECTORY_SEPARATOR . 'data' . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR;
 					$img = Requests::get($imageUrl, ['Token' => $this->config['organizrAPI']], $options);
 					if ($img->success) {
 						$base64 = 'data:image/' . $ext . ';base64,' . base64_encode($img->body);
 						$statuses[$service]['image'] = $base64;
 					} else {
-						$statuses[$service]['image'] = 'plugins/images/cache/no-list.png';
+						$statuses[$service]['image'] = 'plugins/images/homepage/no-list.png';
 					}
 					$linkMatch = [];
 					$linkPattern = '/<a class="servicetile" href="(.*)" target="_blank" style="display: block"><div id="serviceimg"><div><img id="' . strtolower($service) . '-service-img/';

+ 11 - 12
api/homepage/ombi.php

@@ -2,7 +2,7 @@
 
 trait OmbiHomepageItem
 {
-	
+
 	public function ombiSettingsArray($infoOnly = false)
 	{
 		$homepageInformation = [
@@ -53,7 +53,7 @@ trait OmbiHomepageItem
 		];
 		return array_merge($homepageInformation, $homepageSettings);
 	}
-	
+
 	public function testConnectionOmbi()
 	{
 		if (empty($this->config['ombiURL'])) {
@@ -85,7 +85,7 @@ trait OmbiHomepageItem
 			return false;
 		}
 	}
-	
+
 	public function ombiHomepagePermissions($key = null)
 	{
 		$permissions = [
@@ -104,7 +104,7 @@ trait OmbiHomepageItem
 		];
 		return $this->homepageCheckKeyPermissions($key, $permissions);
 	}
-	
+
 	public function homepageOrderombi()
 	{
 		if ($this->homepageItemPermissions($this->ombiHomepagePermissions('main'))) {
@@ -120,8 +120,8 @@ trait OmbiHomepageItem
 				';
 		}
 	}
-	
-	
+
+
 	public function getOmbiRequests($type = "both", $limit = 50, $offset = 0)
 	{
 		if (!$this->homepageItemPermissions($this->ombiHomepagePermissions('main'), true)) {
@@ -165,7 +165,7 @@ trait OmbiHomepageItem
 								'id' => $value['theMovieDbId'],
 								'title' => $value['title'],
 								'overview' => $value['overview'],
-								'poster' => (isset($value['posterPath']) && $value['posterPath'] !== '') ? 'https://image.tmdb.org/t/p/w300/' . $value['posterPath'] : 'plugins/images/cache/no-list.png',
+								'poster' => (isset($value['posterPath']) && $value['posterPath'] !== '') ? 'https://image.tmdb.org/t/p/w300/' . $value['posterPath'] : 'plugins/images/homepage/no-list.png',
 								'background' => (isset($value['background']) && $value['background'] !== '') ? 'https://image.tmdb.org/t/p/w1280/' . $value['background'] : '',
 								'approved' => $value['approved'],
 								'available' => $value['available'],
@@ -194,7 +194,7 @@ trait OmbiHomepageItem
 									'id' => $value['tvDbId'],
 									'title' => $value['title'],
 									'overview' => $value['overview'],
-									'poster' => (isset($value['posterPath']) && $value['posterPath'] !== '') ? (str_starts_with($value['posterPath'], '/') ? 'https://image.tmdb.org/t/p/w300/' . $value['posterPath'] : $value['posterPath']) : 'plugins/images/cache/no-list.png',
+									'poster' => (isset($value['posterPath']) && $value['posterPath'] !== '') ? (str_starts_with($value['posterPath'], '/') ? 'https://image.tmdb.org/t/p/w300/' . $value['posterPath'] : $value['posterPath']) : 'plugins/images/homepage/no-list.png',
 									'background' => (isset($value['background']) && $value['background'] !== '') ? 'https://image.tmdb.org/t/p/w1280/' . $value['background'] : '',
 									'approved' => $value['childRequests'][0]['approved'],
 									'available' => $value['childRequests'][0]['available'],
@@ -230,7 +230,7 @@ trait OmbiHomepageItem
 		$this->setAPIResponse('success', null, 200, $api);
 		return $api;
 	}
-	
+
 	public function addOmbiRequest($id, $type)
 	{
 		$id = ($id) ?? null;
@@ -347,14 +347,13 @@ trait OmbiHomepageItem
 				$this->setAPIResponse('error', 'Ombi Error Occurred', 500);
 				return false;
 			}
-			
 		} catch (Requests_Exception $e) {
 			$this->writeLog('error', 'OMBI Connect Function - Error: ' . $e->getMessage(), 'SYSTEM');
 			$this->setAPIResponse('error', $e->getMessage(), 500);
 			return false;
 		}
 	}
-	
+
 	public function actionOmbiRequest($id, $type, $action)
 	{
 		$id = ($id) ?? null;
@@ -432,7 +431,7 @@ trait OmbiHomepageItem
 			return false;
 		};
 	}
-	
+
 	public function ombiTVDefault($type)
 	{
 		return $type == $this->config['ombiTvDefault'];

+ 12 - 13
api/homepage/overseerr.php

@@ -2,7 +2,7 @@
 
 trait OverseerrHomepageItem
 {
-	
+
 	public function overseerrSettingsArray($infoOnly = false)
 	{
 		$homepageInformation = [
@@ -55,7 +55,7 @@ trait OverseerrHomepageItem
 		];
 		return array_merge($homepageInformation, $homepageSettings);
 	}
-	
+
 	public function testConnectionOverseerr()
 	{
 		if (!$this->homepageItemPermissions($this->overseerrHomepagePermissions('test'), true)) {
@@ -76,14 +76,13 @@ trait OverseerrHomepageItem
 				$this->setResponse(401, 'API Connection failed');
 				return false;
 			}
-			
 		} catch (Requests_Exception $e) {
 			$this->writeLog('error', 'Overseerr Connect Function - Error: ' . $e->getMessage(), 'SYSTEM');
 			$this->setResponse(500, $e->getMessage());
 			return false;
 		}
 	}
-	
+
 	public function overseerrHomepagePermissions($key = null)
 	{
 		$permissions = [
@@ -121,7 +120,7 @@ trait OverseerrHomepageItem
 		];
 		return $this->homepageCheckKeyPermissions($key, $permissions);
 	}
-	
+
 	public function homepageOrderoverseerr()
 	{
 		if ($this->homepageItemPermissions($this->overseerrHomepagePermissions('main'))) {
@@ -137,8 +136,8 @@ trait OverseerrHomepageItem
 				';
 		}
 	}
-	
-	
+
+
 	public function getOverseerrRequests($limit = 50, $offset = 0)
 	{
 		if (!$this->homepageItemPermissions($this->overseerrHomepagePermissions('main'), true)) {
@@ -176,7 +175,7 @@ trait OverseerrHomepageItem
 								'id' => $value['media']['tmdbId'],
 								'title' => ($value['type'] == 'movie') ? $requestsItemData['title'] : $requestsItemData['name'],
 								'overview' => $requestsItemData['overview'],
-								'poster' => (isset($requestsItemData['posterPath']) && $requestsItemData['posterPath'] !== '') ? 'https://image.tmdb.org/t/p/w300/' . $requestsItemData['posterPath'] : 'plugins/images/cache/no-list.png',
+								'poster' => (isset($requestsItemData['posterPath']) && $requestsItemData['posterPath'] !== '') ? 'https://image.tmdb.org/t/p/w300/' . $requestsItemData['posterPath'] : 'plugins/images/homepage/no-list.png',
 								'background' => (isset($requestsItemData['backdropPath']) && $requestsItemData['backdropPath'] !== '') ? 'https://image.tmdb.org/t/p/w1280/' . $requestsItemData['backdropPath'] : '',
 								'approved' => $value['status'] == 2,
 								'available' => $value['media']['status'] == 5,
@@ -211,7 +210,7 @@ trait OverseerrHomepageItem
 		$this->setResponse(200, null, $api);
 		return $api;
 	}
-	
+
 	public function getDefaultService($services)
 	{
 		if (empty($services)) {
@@ -234,7 +233,7 @@ trait OverseerrHomepageItem
 			return ($default) ? $services[$default] : $services[0];
 		}
 	}
-	
+
 	public function addOverseerrRequest($id, $type, $seasons = null)
 	{
 		$id = ($id) ?? null;
@@ -401,7 +400,7 @@ trait OverseerrHomepageItem
 			return false;
 		}
 	}
-	
+
 	public function actionOverseerrRequest($id, $type, $action)
 	{
 		$id = ($id) ?? null;
@@ -492,7 +491,7 @@ trait OverseerrHomepageItem
 			return false;
 		}
 	}
-	
+
 	public function getOverseerrMetadata($id, $type)
 	{
 		if (!$id) {
@@ -529,7 +528,7 @@ trait OverseerrHomepageItem
 			return false;
 		}
 	}
-	
+
 	public function overseerrTVDefault($type)
 	{
 		return $type == $this->config['overseerrTvDefault'];

+ 7 - 7
api/homepage/plex.php

@@ -462,8 +462,8 @@ trait PlexHomepageItem
 		$nowPlayingHeight = $this->getCacheImageSize('nph');
 		$nowPlayingWidth = $this->getCacheImageSize('npw');
 		// Cache Directories
-		$cacheDirectory = dirname(__DIR__, 2) . DIRECTORY_SEPARATOR . 'plugins' . DIRECTORY_SEPARATOR . 'images' . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR;
-		$cacheDirectoryWeb = 'plugins/images/cache/';
+		$cacheDirectory = dirname(__DIR__, 2) . DIRECTORY_SEPARATOR . 'data' . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR;
+		$cacheDirectoryWeb = 'data/cache/';
 		// Types
 		switch ($item['type']) {
 			case 'show':
@@ -493,7 +493,7 @@ trait PlexHomepageItem
 				$plexItem['metadataKey'] = (string)$item['parentRatingKey'];
 				break;
 			case 'episode':
-				$useImage = (isset($item['live']) ? 'plugins/images/cache/livetv.png' : null);
+				$useImage = (isset($item['live']) ? 'plugins/images/homepage/livetv.png' : null);
 				$plexItem['type'] = 'tv';
 				$plexItem['title'] = (string)$item['grandparentTitle'];
 				$plexItem['secondaryTitle'] = (string)$item['parentTitle'] . ' - Episode ' . (string)$item['index'];
@@ -508,7 +508,7 @@ trait PlexHomepageItem
 				$plexItem['metadataKey'] = (string)($item['grandparentRatingKey'] ?? $item['parentRatingKey'] ?? $item['ratingKey']);
 				break;
 			case 'clip':
-				$useImage = (isset($item['live']) ? "plugins/images/cache/livetv.png" : null);
+				$useImage = (isset($item['live']) ? "plugins/images/homepage/livetv.png" : null);
 				$plexItem['type'] = 'clip';
 				$plexItem['title'] = (isset($item['live']) ? 'Live TV' : (string)$item['title']);
 				$plexItem['secondaryTitle'] = '';
@@ -537,7 +537,7 @@ trait PlexHomepageItem
 				$plexItem['metadataKey'] = isset($item['grandparentRatingKey']) ? (string)$item['grandparentRatingKey'] : (string)$item['parentRatingKey'];
 				break;
 			default:
-				$useImage = (isset($item['live']) ? 'plugins/images/cache/livetv.png' : null);
+				$useImage = (isset($item['live']) ? 'plugins/images/homepage/livetv.png' : null);
 				$plexItem['type'] = 'movie';
 				$plexItem['title'] = (string)$item['title'];
 				$plexItem['secondaryTitle'] = (string)$item['year'];
@@ -636,11 +636,11 @@ trait PlexHomepageItem
 			$plexItem['imageURL'] = 'api/v2/homepage/image?source=plex&img=' . $plexItem['thumb'] . '&height=' . $height . '&width=' . $width . '&key=' . $plexItem['key'] . '';
 		}
 		if (!$plexItem['nowPlayingThumb']) {
-			$plexItem['nowPlayingOriginalImage'] = $plexItem['nowPlayingImageURL'] = "plugins/images/cache/no-np.png";
+			$plexItem['nowPlayingOriginalImage'] = $plexItem['nowPlayingImageURL'] = "plugins/images/homepage/no-np.png";
 			$plexItem['nowPlayingKey'] = "no-np";
 		}
 		if (!$plexItem['thumb'] || $plexItem['addedAt'] >= (time() - 300)) {
-			$plexItem['originalImage'] = $plexItem['imageURL'] = "plugins/images/cache/no-list.png";
+			$plexItem['originalImage'] = $plexItem['imageURL'] = "plugins/images/homepage/no-list.png";
 			$plexItem['key'] = "no-list";
 		}
 		if (isset($useImage)) {

+ 8 - 8
api/homepage/radarr.php

@@ -285,7 +285,7 @@ trait RadarrHomepageItem
 				} else {
 					$downloaded = "text-danger";
 				}
-				$banner = "/plugins/images/cache/no-np.png";
+				$banner = "/plugins/images/homepage/no-np.png";
 				foreach ($child['images'] as $image) {
 					if ($image['coverType'] == "banner" || $image['coverType'] == "fanart") {
 						if (strpos($image['url'], '://') === false) {
@@ -302,11 +302,11 @@ trait RadarrHomepageItem
 						}
 					}
 				}
-				if ($banner !== "/plugins/images/cache/no-np.png" || (strpos($banner, 'apikey') !== false)) {
-					$cacheDirectory = dirname(__DIR__, 2) . DIRECTORY_SEPARATOR . 'plugins' . DIRECTORY_SEPARATOR . 'images' . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR;
+				if ($banner !== "/plugins/images/homepage/no-np.png" || (strpos($banner, 'apikey') !== false)) {
+					$cacheDirectory = dirname(__DIR__, 2) . DIRECTORY_SEPARATOR . 'data' . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR;
 					$imageURL = $banner;
 					$cacheFile = $cacheDirectory . $movieID . '.jpg';
-					$banner = 'plugins/images/cache/' . $movieID . '.jpg';
+					$banner = 'data/cache/' . $movieID . '.jpg';
 					if (!file_exists($cacheFile)) {
 						$this->cacheImage($imageURL, $movieID);
 						unset($imageURL);
@@ -325,13 +325,13 @@ trait RadarrHomepageItem
 				}
 				$alternativeTitles = empty($alternativeTitles) ? "" : substr($alternativeTitles, 0, -2);
 				$href = $this->config['radarrCalendarLink'] ?? '';
-				if (empty($href) && !empty($this->config['radarrURL'])){
-					$href_arr = explode(',',$this->config['radarrURL']);
+				if (empty($href) && !empty($this->config['radarrURL'])) {
+					$href_arr = explode(',', $this->config['radarrURL']);
 					$href = reset($href_arr);
 				}
-				if (!empty($href)){
+				if (!empty($href)) {
 					$href = $href . '/movie/' . $movieID;
-					$href = str_replace("//movie/","/movie/",$href);
+					$href = str_replace("//movie/", "/movie/", $href);
 				}
 				$details = array(
 					"topTitle" => $movieName,

+ 20 - 21
api/homepage/sickrage.php

@@ -43,7 +43,7 @@ trait SickRageHomepageItem
 		];
 		return array_merge($homepageInformation, $homepageSettings);
 	}
-	
+
 	public function testConnectionSickRage()
 	{
 		if (empty($this->config['sickrageURL'])) {
@@ -75,7 +75,6 @@ trait SickRageHomepageItem
 					$errors .= $ip . ': Response was not JSON';
 					$failed = true;
 				}
-				
 			} catch (Exception $e) {
 				$failed = true;
 				$ip = $value['url'];
@@ -91,7 +90,7 @@ trait SickRageHomepageItem
 			return true;
 		}
 	}
-	
+
 	public function sickrageHomepagePermissions($key = null)
 	{
 		$permissions = [
@@ -110,7 +109,7 @@ trait SickRageHomepageItem
 		];
 		return $this->homepageCheckKeyPermissions($key, $permissions);
 	}
-	
+
 	public function getSickRageCalendar($startDate = null, $endDate = null)
 	{
 		if (!$this->homepageItemPermissions($this->sickrageHomepagePermissions('calendar'), true)) {
@@ -137,7 +136,7 @@ trait SickRageHomepageItem
 		$this->setAPIResponse('success', null, 200, $calendarItems);
 		return $calendarItems;
 	}
-	
+
 	public function formatSickrageCalendarWanted($array, $number)
 	{
 		$array = json_decode($array, true);
@@ -165,11 +164,11 @@ trait SickRageHomepageItem
 				$downloaded = "text-danger";
 			}
 			$bottomTitle = 'S' . sprintf("%02d", $child['season']) . 'E' . sprintf("%02d", $child['episode']) . ' - ' . $child['ep_name'];
-			$cacheDirectory = dirname(__DIR__, 2) . DIRECTORY_SEPARATOR . 'plugins' . DIRECTORY_SEPARATOR . 'images' . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR;
+			$cacheDirectory = dirname(__DIR__, 2) . DIRECTORY_SEPARATOR . 'data' . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR;
 			$cacheFile = $cacheDirectory . $seriesID . '.jpg';
-			$fanart = "/plugins/images/cache/no-np.png";
+			$fanart = "/plugins/images/homepage/no-np.png";
 			if (file_exists($cacheFile)) {
-				$fanart = 'plugins/images/cache/' . $seriesID . '.jpg';
+				$fanart = 'data/cache/' . $seriesID . '.jpg';
 				unset($cacheFile);
 			}
 			$details = array(
@@ -222,11 +221,11 @@ trait SickRageHomepageItem
 				$downloaded = "text-danger";
 			}
 			$bottomTitle = 'S' . sprintf("%02d", $child['season']) . 'E' . sprintf("%02d", $child['episode']) . ' - ' . $child['ep_name'];
-			$cacheDirectory = dirname(__DIR__, 2) . DIRECTORY_SEPARATOR . 'plugins' . DIRECTORY_SEPARATOR . 'images' . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR;
+			$cacheDirectory = dirname(__DIR__, 2) . DIRECTORY_SEPARATOR . 'data' . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR;
 			$cacheFile = $cacheDirectory . $seriesID . '.jpg';
-			$fanart = "/plugins/images/cache/no-np.png";
+			$fanart = "/plugins/images/homepage/no-np.png";
 			if (file_exists($cacheFile)) {
-				$fanart = 'plugins/images/cache/' . $seriesID . '.jpg';
+				$fanart = 'data/cache/' . $seriesID . '.jpg';
 				unset($cacheFile);
 			}
 			$details = array(
@@ -279,11 +278,11 @@ trait SickRageHomepageItem
 				$downloaded = "text-danger";
 			}
 			$bottomTitle = 'S' . sprintf("%02d", $child['season']) . 'E' . sprintf("%02d", $child['episode']) . ' - ' . $child['ep_name'];
-			$cacheDirectory = dirname(__DIR__, 2) . DIRECTORY_SEPARATOR . 'plugins' . DIRECTORY_SEPARATOR . 'images' . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR;
+			$cacheDirectory = dirname(__DIR__, 2) . DIRECTORY_SEPARATOR . 'data' . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR;
 			$cacheFile = $cacheDirectory . $seriesID . '.jpg';
-			$fanart = "/plugins/images/cache/no-np.png";
+			$fanart = "/plugins/images/homepage/no-np.png";
 			if (file_exists($cacheFile)) {
-				$fanart = 'plugins/images/cache/' . $seriesID . '.jpg';
+				$fanart = 'data/cache/' . $seriesID . '.jpg';
 				unset($cacheFile);
 			}
 			$details = array(
@@ -336,11 +335,11 @@ trait SickRageHomepageItem
 				$downloaded = "text-danger";
 			}
 			$bottomTitle = 'S' . sprintf("%02d", $child['season']) . 'E' . sprintf("%02d", $child['episode']) . ' - ' . $child['ep_name'];
-			$cacheDirectory = dirname(__DIR__, 2) . DIRECTORY_SEPARATOR . 'plugins' . DIRECTORY_SEPARATOR . 'images' . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR;
+			$cacheDirectory = dirname(__DIR__, 2) . DIRECTORY_SEPARATOR . 'data' . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR;
 			$cacheFile = $cacheDirectory . $seriesID . '.jpg';
-			$fanart = "/plugins/images/cache/no-np.png";
+			$fanart = "/plugins/images/homepage/no-np.png";
 			if (file_exists($cacheFile)) {
-				$fanart = 'plugins/images/cache/' . $seriesID . '.jpg';
+				$fanart = 'data/cache/' . $seriesID . '.jpg';
 				unset($cacheFile);
 			}
 			$details = array(
@@ -376,7 +375,7 @@ trait SickRageHomepageItem
 		}
 		return false;
 	}
-	
+
 	public function formatSickrageCalendarHistory($array, $number)
 	{
 		$array = json_decode($array, true);
@@ -390,11 +389,11 @@ trait SickRageHomepageItem
 			$episodeAirDate = $child['date'];
 			$downloaded = "text-success";
 			$bottomTitle = 'S' . sprintf("%02d", $child['season']) . 'E' . sprintf("%02d", $child['episode']);
-			$cacheDirectory = dirname(__DIR__, 2) . DIRECTORY_SEPARATOR . 'plugins' . DIRECTORY_SEPARATOR . 'images' . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR;
+			$cacheDirectory = dirname(__DIR__, 2) . DIRECTORY_SEPARATOR . 'data' . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR;
 			$cacheFile = $cacheDirectory . $seriesID . '.jpg';
-			$fanart = "/plugins/images/cache/no-np.png";
+			$fanart = "/plugins/images/homepage/no-np.png";
 			if (file_exists($cacheFile)) {
-				$fanart = 'plugins/images/cache/' . $seriesID . '.jpg';
+				$fanart = 'data/cache/' . $seriesID . '.jpg';
 				unset($cacheFile);
 			}
 			$details = array(

+ 8 - 8
api/homepage/sonarr.php

@@ -272,17 +272,17 @@ trait SonarrHomepageItem
 			} else {
 				$downloaded = "text-danger";
 			}
-			$fanart = "/plugins/images/cache/no-np.png";
+			$fanart = "/plugins/images/homepage/no-np.png";
 			foreach ($child['series']['images'] as $image) {
 				if ($image['coverType'] == "fanart") {
 					$fanart = $image['url'];
 				}
 			}
-			if ($fanart !== "/plugins/images/cache/no-np.png" || (strpos($fanart, '://') === false)) {
-				$cacheDirectory = dirname(__DIR__, 2) . DIRECTORY_SEPARATOR . 'plugins' . DIRECTORY_SEPARATOR . 'images' . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR;
+			if ($fanart !== "/plugins/images/homepage/no-np.png" || (strpos($fanart, '://') === false)) {
+				$cacheDirectory = dirname(__DIR__, 2) . DIRECTORY_SEPARATOR . 'data' . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR;
 				$imageURL = $fanart;
 				$cacheFile = $cacheDirectory . $seriesID . '.jpg';
-				$fanart = 'plugins/images/cache/' . $seriesID . '.jpg';
+				$fanart = 'data/cache/' . $seriesID . '.jpg';
 				if (!file_exists($cacheFile)) {
 					$this->cacheImage($imageURL, $seriesID);
 					unset($imageURL);
@@ -291,13 +291,13 @@ trait SonarrHomepageItem
 			}
 			$bottomTitle = 'S' . sprintf("%02d", $child['seasonNumber']) . 'E' . sprintf("%02d", $child['episodeNumber']) . ' - ' . $child['title'];
 			$href = $this->config['sonarrCalendarLink'] ?? '';
-			if (empty($href) && !empty($this->config['sonarrURL'])){
-				$href_arr = explode(',',$this->config['sonarrURL']);
+			if (empty($href) && !empty($this->config['sonarrURL'])) {
+				$href_arr = explode(',', $this->config['sonarrURL']);
 				$href = reset($href_arr);
 			}
-			if (!empty($href)){
+			if (!empty($href)) {
 				$href = $href . '/series/' . preg_replace('/[^A-Za-z0-9. -]/', '', preg_replace('/[[:space:]]+/', '-', $seriesName));
-				$href = str_replace("//series/","/series/",$href);
+				$href = str_replace("//series/", "/series/", $href);
 			}
 			$details = array(
 				"seasonCount" => $child['series']['seasonCount'] ?? isset($child['series']['seasons']) ? count($child['series']['seasons']) : 0,

+ 11 - 11
api/homepage/tautulli.php

@@ -73,7 +73,7 @@ trait TautulliHomepageItem
 		];
 		return array_merge($homepageInformation, $homepageSettings);
 	}
-	
+
 	public function testConnectionTautulli()
 	{
 		$this->setLoggerChannel('Tautulli Homepage');
@@ -104,7 +104,7 @@ trait TautulliHomepageItem
 			return false;
 		}
 	}
-	
+
 	public function tautulliHomepagePermissions($key = null)
 	{
 		$permissions = [
@@ -123,7 +123,7 @@ trait TautulliHomepageItem
 		];
 		return $this->homepageCheckKeyPermissions($key, $permissions);
 	}
-	
+
 	public function homepageOrdertautulli()
 	{
 		if ($this->homepageItemPermissions($this->tautulliHomepagePermissions('main'))) {
@@ -139,7 +139,7 @@ trait TautulliHomepageItem
 				';
 		}
 	}
-	
+
 	public function getTautulliHomepageData()
 	{
 		$this->setLoggerChannel('Tautulli Homepage');
@@ -158,12 +158,12 @@ trait TautulliHomepageItem
 			$options = $this->requestOptions($this->config['tautulliURL'], $this->config['homepageTautulliRefresh'], $this->config['tautulliDisableCertCheck'], $this->config['tautulliUseCustomCertificate']);
 			$homestats = Requests::get($homestatsUrl, [], $options);
 			if ($homestats->success) {
-				$homepageTautulliViewingStatsExclude = explode(",",$this->config['homepageTautulliViewingStatsExclude']);
+				$homepageTautulliViewingStatsExclude = explode(",", $this->config['homepageTautulliViewingStatsExclude']);
 				$homestats = json_decode($homestats->body, true);
 				foreach ($homestats['response']['data'] as $s => $stats) {
 					foreach ($stats['rows'] as $i => $v) {
 						if (array_key_exists('section_id', $v)) {
-							if (in_array($v['section_id'],$homepageTautulliViewingStatsExclude)) {
+							if (in_array($v['section_id'], $homepageTautulliViewingStatsExclude)) {
 								unset($homestats['response']['data'][$s]['rows'][$i]);
 							}
 						}
@@ -178,8 +178,8 @@ trait TautulliHomepageItem
 					$img = $api['homestats']['data'][$key]['rows'][0];
 					$this->cacheImage($url . '/pms_image_proxy?img=' . $img['art'] . '&rating_key=' . $img['rating_key'] . '&width=' . $nowPlayingWidth . '&height=' . $nowPlayingHeight, $img['rating_key'] . '-np');
 					$this->cacheImage($url . '/pms_image_proxy?img=' . $img['thumb'] . '&rating_key=' . $img['rating_key'] . '&width=' . $width . '&height=' . $height, $img['rating_key'] . '-list');
-					$img['art'] = 'plugins/images/cache/' . $img['rating_key'] . '-np.jpg';
-					$img['thumb'] = 'plugins/images/cache/' . $img['rating_key'] . '-list.jpg';
+					$img['art'] = 'data/cache/' . $img['rating_key'] . '-np.jpg';
+					$img['thumb'] = 'data/cache/' . $img['rating_key'] . '-list.jpg';
 					$api['homestats']['data'][$key]['rows'][0] = $img;
 				}
 				// Cache the platform icon
@@ -191,11 +191,11 @@ trait TautulliHomepageItem
 			$options = $this->requestOptions($this->config['tautulliURL'], $this->config['homepageTautulliRefresh'], $this->config['tautulliDisableCertCheck'], $this->config['tautulliUseCustomCertificate']);
 			$libstats = Requests::get($libstatsUrl, [], $options);
 			if ($libstats->success) {
-				$homepageTautulliLibraryStatsExclude = explode(",",$this->config['homepageTautulliLibraryStatsExclude']);
+				$homepageTautulliLibraryStatsExclude = explode(",", $this->config['homepageTautulliLibraryStatsExclude']);
 				$libstats = json_decode($libstats->body, true);
 				foreach ($libstats['response']['data']['data'] as $i => $v) {
 					if (array_key_exists('section_id', $v)) {
-						if (in_array($v['section_id'],$homepageTautulliLibraryStatsExclude)) {
+						if (in_array($v['section_id'], $homepageTautulliLibraryStatsExclude)) {
 							unset($libstats['response']['data']['data'][$i]);
 						}
 					}
@@ -275,7 +275,7 @@ trait TautulliHomepageItem
 					return $libraryList;
 				}
 			} catch (Requests_Exception $e) {
-				$this->setAPIResponse('error', 'Tautulli Homepage Error - Unable to get list of libraries: '.$e->getMessage(), 500);
+				$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;
 			};

+ 6 - 7
api/homepage/trakt.php

@@ -60,7 +60,7 @@ trait TraktHomepageItem
 		];
 		return array_merge($homepageInformation, $homepageSettings);
 	}
-	
+
 	public function traktHomepagePermissions($key = null)
 	{
 		$permissions = [
@@ -79,7 +79,7 @@ trait TraktHomepageItem
 		];
 		return $this->homepageCheckKeyPermissions($key, $permissions);
 	}
-	
+
 	public function getTraktCalendar($startDate = null)
 	{
 		$startDate = date('Y-m-d', strtotime('-' . $this->config['calendarStartTrakt'] . ' days'));
@@ -106,7 +106,6 @@ trait TraktHomepageItem
 					$calendarItems = array_merge($calendarItems, $traktTv);
 				}
 			}
-			
 		} catch (Requests_Exception $e) {
 			$this->writeLog('error', 'Trakt Connect Function - Error: ' . $e->getMessage(), 'SYSTEM');
 			$this->setAPIResponse('error', $e->getMessage(), 500);
@@ -135,7 +134,7 @@ trait TraktHomepageItem
 		$this->traktOAuthRefresh();
 		return $calendarItems;
 	}
-	
+
 	public function formatTraktCalendarTv($array)
 	{
 		$gotCalendar = array();
@@ -177,7 +176,7 @@ trait TraktHomepageItem
 			} else {
 				$downloaded = "text-danger";
 			}
-			$fanart = "/plugins/images/cache/no-np.png";
+			$fanart = "/plugins/images/homepage/no-np.png";
 			$bottomTitle = 'S' . sprintf("%02d", $child['episode']['season']) . 'E' . sprintf("%02d", $child['episode']['number']) . ' - ' . $child['episode']['title'];
 			$details = array(
 				"seasonCount" => $child['episode']['season'],
@@ -212,7 +211,7 @@ trait TraktHomepageItem
 		}
 		return false;
 	}
-	
+
 	public function formatTraktCalendarMovies($array)
 	{
 		$gotCalendar = array();
@@ -240,7 +239,7 @@ trait TraktHomepageItem
 				$notReleased = 'false';
 			}
 			$downloaded = 'text-dark';
-			$banner = '/plugins/images/cache/no-np.png';
+			$banner = '/plugins/images/homepage/no-np.png';
 			$details = array(
 				'topTitle' => $movieName,
 				'bottomTitle' => $child['movie']['tagline'],

+ 7 - 7
js/functions.js

@@ -5126,8 +5126,8 @@ function buildStreamItem(array,source){
 		switch (v.type) {
 			case 'music':
 				icon = 'icon-music-tone-alt';
-				width = (v.nowPlayingImageURL !== 'plugins/images/cache/no-np.png') ? 56 : 100;
-				bg = (v.nowPlayingImageURL !== 'plugins/images/cache/no-np.png') ? `
+				width = (v.nowPlayingImageURL !== 'plugins/images/homepage/no-np.png') ? 56 : 100;
+				bg = (v.nowPlayingImageURL !== 'plugins/images/homepage/no-np.png') ? `
 				<img class="imageSource imageSourceLeft" src="`+v.nowPlayingImageURL+`">
 				<img class="imageSource imageSourceRight" src="`+v.nowPlayingImageURL+`">
 				` : '';
@@ -5364,7 +5364,7 @@ function buildRequestItem(array, extra=null){
                 var iconType = (v.type == 'tv') ? 'fa-tv ' : 'fa-film';
 				var badge = '';
 				var badge2 = '';
-				var bg = (v.background.includes('.')) ? v.background : 'plugins/images/cache/no-np.png';
+				var bg = (v.background.includes('.')) ? v.background : 'plugins/images/homepage/no-np.png';
 				v.user = (activeInfo.settings.homepage.ombi.alias && service === 'ombi') || (activeInfo.settings.homepage.overseerr.enabled && service === 'overseerr') ? v.userAlias : v.user;
 				//Set Status
 				var status = (v.approved) ? '<span class="badge bg-org m-r-10" lang="en">Approved</span>' : '<span class="badge bg-danger m-r-10" lang="en">Unapproved</span>';
@@ -5793,7 +5793,7 @@ function buildRequestResult(array,media_type=null,list=null,page=null,search=fal
 			total = total + 1;
 			tv = (media_type == 'tv') ? tv + 1 : tv;
 			movie = (media_type == 'movie') ? movie + 1 : movie;
-			var bg = (v.poster_path !== null) ? `https://image.tmdb.org/t/p/w300/`+v.poster_path : 'plugins/images/cache/no-list.png';
+			var bg = (v.poster_path !== null) ? `https://image.tmdb.org/t/p/w300/`+v.poster_path : 'plugins/images/homepage/no-list.png';
 			var top = (v.title) ? v.title : (v.original_title) ? v.original_title : (v.original_name) ? v.original_name : '';
 			var bottom = (v.release_date) ? v.release_date : (v.first_air_date) ? v.first_air_date : '';
 			if(comments){
@@ -7832,7 +7832,7 @@ function buildTautulliItem(array){
                     <div class="card-body h-100 bg-org-alt">
                         <table class="h-100 w-100">
                             <tr>
-                                <td rowspan='2' class="poster-td text-center"><img src="plugins/images/cache/tautulli-`+type+`.svg" class="lib-icon" alt="library icon"></td>
+                                <td rowspan='2' class="poster-td text-center"><img src="data/cache/tautulli-`+type+`.svg" class="lib-icon" alt="library icon"></td>
                                 ${cardTitle}
                             </tr>
                             <tr>
@@ -7903,7 +7903,7 @@ function buildTautulliItem(array){
                                     if(stat == 'top_users') {
                                         card += `<td rowspan="2" class="poster-td text-center"><img src="`+e['rows'][0]['user_thumb']+`" class="poster avatar" alt="user avatar"></td>`;
                                     } else if(stat == 'top_platforms') {
-                                        card += `<td rowspan="2" class="poster-td text-center"><img src="plugins/images/cache/tautulli-`+e['rows'][0]['platform_name']+`.svg" class="poster" alt="platform icon"></td>`;
+                                        card += `<td rowspan="2" class="poster-td text-center"><img src="data/cache/tautulli-`+e['rows'][0]['platform_name']+`.svg" class="poster" alt="platform icon"></td>`;
                                     } else {
                                         card += `<td rowspan="2" class="poster-td"><img src="`+e['rows'][0]['thumb']+`" class="poster" alt="movie poster"></td>`;
                                     }
@@ -10010,7 +10010,7 @@ function buildMediaResults(array,source,term){
 		<div class="col-lg-3 col-md-4 col-sm-6 col-xs-12 m-t-20 request-result-item request-result-movie mouse"  onclick="forceSearch('`+term+`')">
 			<div class="white-box m-b-10">
 				<div class="el-card-item p-b-0">
-					<div class="el-card-avatar el-overlay-1 m-b-5"> <img class="lazyload resultImages mouse" data-src="plugins/images/cache/no-request.png">
+					<div class="el-card-avatar el-overlay-1 m-b-5"> <img class="lazyload resultImages mouse" data-src="plugins/images/homepage/no-request.png">
 						<div class="customPoster">
 							<a href="javascript:void(0);">`+splitPoster(term)+`</a>
 						</div>

+ 0 - 0
plugins/images/cache/livetv.png → plugins/images/homepage/livetv.png


+ 0 - 0
plugins/images/cache/no-list.png → plugins/images/homepage/no-list.png


+ 0 - 0
plugins/images/cache/no-np.png → plugins/images/homepage/no-np.png


+ 0 - 0
plugins/images/cache/no-request.png → plugins/images/homepage/no-request.png