Browse Source

Added homepage plex stream username auth

causefx 8 years ago
parent
commit
ec15734277

+ 1 - 0
api/config/default.php

@@ -46,6 +46,7 @@ return array(
 	'homepageOrdernoticeguest' => '14',
 	'homepageOrdertransmisson' => '15',
     'homepageShowStreamNames' => false,
+    'homepageShowStreamNamesAuth' => '1',
     'homepageStreamRefresh' => '60000',
     'homepageRecentRefresh' => '60000',
     'homepagePlexStreams' => false,

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

@@ -104,7 +104,7 @@ function resolvePlexItem($item) {
         $plexItem['stream'] = isset($item->Media->Part->Stream['decision']) ? (string)$item->Media->Part->Stream['decision']: '';
         $plexItem['id'] = str_replace('"', '', (string)$item->Player['machineIdentifier']);
         $plexItem['state'] = (((string)$item->Player['state'] == "paused") ? "pause" : "play");
-        $plexItem['user'] = ($GLOBALS['homepageShowStreamNames'] && qualifyRequest(1) ) ? (string)$item->User['title'] : "";
+        $plexItem['user'] = ($GLOBALS['homepageShowStreamNames'] && qualifyRequest($GLOBALS['homepageShowStreamNamesAuth']) ) ? (string)$item->User['title'] : "";
         $plexItem['address'] = $GLOBALS['plexTabURL'] ? $GLOBALS['plexTabURL']."/web/index.html#!/server/".$GLOBALS['plexID']."/details?key=/library/metadata/".$item['ratingKey'] : "https://app.plex.tv/web/app#!/server/".$GLOBALS['plexID']."/details?key=/library/metadata/".$item['ratingKey'];
         $plexItem['nowPlayingOriginalImage'] = 'api/?v1/image&source=plex&img='.$plexItem['nowPlayingThumb'].'&height='.$nowPlayingHeight.'&width='.$nowPlayingWidth.'&key='.$plexItem['nowPlayingKey'].'$'.randString();
         $plexItem['originalImage'] = 'api/?v1/image&source=plex&img='.$plexItem['thumb'].'&height='.$height.'&width='.$width.'&key='.$plexItem['key'].'$'.randString();

+ 16 - 10
api/functions/homepage-functions.php

@@ -158,6 +158,13 @@ function getHomepageList(){
             			'name' => 'homepagePlexEnabled',
             			'label' => 'Enable',
             			'value' => $GLOBALS['homepagePlexEnabled']
+            		),
+					array(
+            			'type' => 'select',
+            			'name' => 'homepagePlexAuth',
+            			'label' => 'Minimum Authentication',
+            			'value' => $GLOBALS['homepagePlexAuth'],
+                        'options' => $groups
             		)
                 ),
                 'Connection' => array(
@@ -165,7 +172,8 @@ function getHomepageList(){
                         'type' => 'input',
                         'name' => 'plexURL',
                         'label' => 'URL',
-                        'value' => $GLOBALS['plexURL']
+                        'value' => $GLOBALS['plexURL'],
+						'placeholder' => 'http(s)://hostname:port'
                     ),
                     array(
                         'type' => 'input',
@@ -180,15 +188,6 @@ function getHomepageList(){
                         'value' => $GLOBALS['plexID']
                     )
                 ),
-                'Authentication' => array(
-                    array(
-            			'type' => 'select',
-            			'name' => 'homepagePlexAuth',
-            			'label' => 'Minimum Authentication',
-            			'value' => $GLOBALS['homepagePlexAuth'],
-                        'options' => $groups
-            		)
-                ),
                 'Modules' => array(
                     array(
             			'type' => 'switch',
@@ -224,6 +223,13 @@ function getHomepageList(){
             			'label' => 'Show Usernames',
             			'value' => $GLOBALS['homepageShowStreamNames']
             		),
+					array(
+    					'type' => 'select',
+    					'name' => 'homepageShowStreamNamesAuth',
+                        'label' => 'Username Authorization',
+    					'value' => $GLOBALS['homepageShowStreamNamesAuth'],
+    					'options' => $groups
+    				),
                     array(
     					'type' => 'select',
     					'name' => 'homepageStreamRefresh',

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

@@ -251,7 +251,7 @@ function getSettingsMain(){
                 'class' => 'embyAuth switchAuth',
     			'label' => 'Emby URL',
     			'value' => $GLOBALS['embyURL'],
-    			'placeholder' => ''
+    			'placeholder' => 'http(s)://hostname:port'
     		),
             array(
     			'type' => 'input',
@@ -324,7 +324,7 @@ function getSSO(){
     			'name' => 'ombiURL',
     			'label' => 'Ombi URL',
     			'value' => $GLOBALS['ombiURL'],
-    			'placeholder' => 'http(s)://hostname'
+    			'placeholder' => 'http(s)://hostname:port'
     		),
     		array(
     			'type' => 'switch',
@@ -339,7 +339,7 @@ function getSSO(){
     			'name' => 'tautulliURL',
     			'label' => 'Tautulli URL',
     			'value' => $GLOBALS['tautulliURL'],
-    			'placeholder' => 'http(s)://hostname'
+    			'placeholder' => 'http(s)://hostname:port'
     		),
     		array(
     			'type' => 'switch',