浏览代码

Add "href" and "icon" to radarr.php

For buildCalendarMetadata()
Jesse Hickman 4 年之前
父节点
当前提交
72cb9239a6
共有 1 个文件被更改,包括 9 次插入1 次删除
  1. 9 1
      api/homepage/radarr.php

+ 9 - 1
api/homepage/radarr.php

@@ -322,6 +322,12 @@ trait RadarrHomepageItem
 					}
 					}
 				}
 				}
 				$alternativeTitles = empty($alternativeTitles) ? "" : substr($alternativeTitles, 0, -2);
 				$alternativeTitles = empty($alternativeTitles) ? "" : substr($alternativeTitles, 0, -2);
+				$href = "";
+				if (!empty($this->config['radarrURL'])){
+					$href_arr = explode(',',$this->config['radarrURL']);
+					$href = reset($href_arr) . '/movie/' . $movieID;
+					$href = str_replace("//movie/","/movie/",$href);
+				}
 				$details = array(
 				$details = array(
 					"topTitle" => $movieName,
 					"topTitle" => $movieName,
 					"bottomTitle" => $alternativeTitles,
 					"bottomTitle" => $alternativeTitles,
@@ -338,6 +344,8 @@ trait RadarrHomepageItem
 					"genres" => $child['genres'],
 					"genres" => $child['genres'],
 					"year" => isset($child['year']) ? $child['year'] : '',
 					"year" => isset($child['year']) ? $child['year'] : '',
 					"studio" => isset($child['studio']) ? $child['studio'] : '',
 					"studio" => isset($child['studio']) ? $child['studio'] : '',
+					"href" => strtolower($href),
+					"icon" => "/plugins/images/tabs/radarr.png",
 				);
 				);
 				array_push($gotCalendar, array(
 				array_push($gotCalendar, array(
 					"id" => "Radarr-" . $number . "-" . $i,
 					"id" => "Radarr-" . $number . "-" . $i,
@@ -358,4 +366,4 @@ trait RadarrHomepageItem
 		}
 		}
 		return false;
 		return false;
 	}
 	}
-}
+}