Browse Source

fix ombi importer api endpoint method
fix ombi api qualify url

causefx 7 years ago
parent
commit
0a62b4bdea
2 changed files with 4 additions and 4 deletions
  1. 2 2
      api/functions/homepage-connect-functions.php
  2. 2 2
      api/functions/sso-functions.php

+ 2 - 2
api/functions/homepage-connect-functions.php

@@ -1801,10 +1801,10 @@ function ombiImport($type = null)
 				case 'emby_local':
 				case 'emby_connect':
 				case 'emby_all':
-					$response = Requests::get($url . "/api/v1/Job/embyuserimporter", $headers, $options);
+					$response = Requests::post($url . "/api/v1/Job/embyuserimporter", $headers, $options);
 					break;
 				case 'plex':
-					$response = Requests::get($url . "/api/v1/Job/plexuserimporter", $headers, $options);
+					$response = Requests::post($url . "/api/v1/Job/plexuserimporter", $headers, $options);
 					break;
 				default:
 					break;

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

@@ -26,7 +26,7 @@ function getOmbiToken($username, $password, $oAuthToken = null)
 {
 	$token = null;
 	try {
-		$url = $GLOBALS['ombiURL'] . '/api/v1/Token';
+		$url = qualifyURL($GLOBALS['ombiURL']);
 		$headers = array(
 			"Accept" => "application/json",
 			"Content-Type" => "application/json"
@@ -37,7 +37,7 @@ function getOmbiToken($username, $password, $oAuthToken = null)
 			"rememberMe" => "true"
 		);
 		$options = (localURL($url)) ? array('verify' => false) : array();
-		$response = Requests::post($url, $headers, json_encode($data), $options);
+		$response = Requests::post($url . '/api/v1/Token', $headers, json_encode($data), $options);
 		if ($response->success) {
 			$token = json_decode($response->body, true)['access_token'];
 			writeLog('success', 'Ombi Token Function - Grabbed token.', $username);