Example #1
0
 public static function system_agents($params)
 {
     $r = Plex_XML_Data::createSysContainer();
     $addcontributors = false;
     $mediaType = $_REQUEST['mediaType'];
     if (count($params) >= 3 && $params[1] == 'config') {
         $mediaType = $params[2];
         $addcontributors = true;
     }
     if ($mediaType) {
         switch ($mediaType) {
             case '1':
                 Plex_XML_Data::setSysMovieAgents($r);
                 break;
             case '2':
                 Plex_XML_Data::setSysTVShowAgents($r);
                 break;
             case '13':
                 Plex_XML_Data::setSysPhotoAgents($r);
                 break;
             case '8':
                 Plex_XML_Data::setSysMusicAgents($r);
                 break;
             case '9':
                 Plex_XML_Data::setSysMusicAgents($r, 'Albums');
                 break;
             default:
                 self::createError(404);
                 break;
         }
     } else {
         Plex_XML_Data::setSysAgents($r);
     }
     if ($addcontributors) {
         Plex_XML_Data::setAgentsContributors($r, $mediaType, 'com.plexapp.agents.none');
     }
     Plex_XML_Data::setContainerSize($r);
     self::apiOutputXml($r->asXML());
 }