Add a movie to an accounts watch list.

@param sessionId sessionId
@param accountId accountId
@param mediaId mediaId
@param mediaType mediaType
@return StatusCode
@throws MovieDbException exception
323858
public StatusCode addToWatchList(String sessionId, int accountId, MediaType mediaType, Integer mediaId) throws MovieDbException {
        return tmdbAccount.modifyWatchList(sessionId, accountId, mediaType, mediaId, true);
    }
633934
public function setMedias(Account $account, $medias)
    {
        $mediaIds = array_map(
            function($media) {
                return $media['id'];
            },
            $medias
        );

        $foundMedias = $this->mediaRepository->findById($mediaIds);
        $foundMediaIds = array_map(
            function($mediaEntity) {
                return $mediaEntity->getId();
            },
            $foundMedias
        );

        if ($missingMediaIds = array_diff($mediaIds, $foundMediaIds)) {
            throw new EntityNotFoundException($this->mediaRepository->getClassName(), reset($missingMediaIds));
        }

        $account->getMedias()->clear();
        foreach ($foundMedias as $media) {
            $account->addMedia($media);
        }
    }
475830
public JSONObject videoFaceliveness(String sessionId, String video, HashMap<String, String> options) {
        try {
            byte[] data = Util.readFileByBytes(video);
            return videoFaceliveness(sessionId, data, options);
        } catch (IOException e) {
            e.printStackTrace();
            return AipError.IMAGE_READ_ERROR.toJsonResult();
        }
    }
559622
public ResultList<ContentRating> getTVContentRatings(int tvID) throws MovieDbException {
        TmdbParameters parameters = new TmdbParameters();
        parameters.add(Param.ID, tvID);

        URL url = new ApiUrl(apiKey, MethodBase.TV).subMethod(MethodSub.CONTENT_RATINGS).buildUrl(parameters);
        WrapperGenericList<ContentRating> wrapper = processWrapper(getTypeReference(ContentRating.class), url, "content rating");
        return wrapper.getResultsList();
    }
788911
public StatusCode removeItem(String sessionId, String listId, int mediaId) throws MovieDbException {
        return modifyMovieList(sessionId, listId, mediaId, MethodSub.REMOVE_ITEM);
    }
1291128
public ResultList<MovieBasic> getRatedMovies(String sessionId, int accountId, Integer page, String sortBy, String language) throws MovieDbException {
        return tmdbAccount.getRatedMovies(sessionId, accountId, page, sortBy, language);
    }
76314
public AccountUpdater setAvatar(BufferedImage avatar, String fileType) {
        delegate.setAvatar(avatar, fileType);
        return this;
    }
810328
public ResultList<Video> getTVVideos(int tvID, String language) throws MovieDbException {
        TmdbParameters parameters = new TmdbParameters();
        parameters.add(Param.ID, tvID);
        parameters.add(Param.LANGUAGE, language);

        URL url = new ApiUrl(apiKey, MethodBase.TV).subMethod(MethodSub.VIDEOS).buildUrl(parameters);
        String webpage = httpTools.getRequest(url);

        try {
            WrapperVideos wrapper = MAPPER.readValue(webpage, WrapperVideos.class);
            ResultList<Video> results = new ResultList<>(wrapper.getVideos());
            wrapper.setResultProperties(results);
            return results;
        } catch (IOException ex) {
            throw new MovieDbException(ApiExceptionType.MAPPING_FAILED, "Failed to get videos", url, ex);
        }
    }
943970
public boolean checkItemStatus(String listId, int mediaId) throws MovieDbException {
        TmdbParameters parameters = new TmdbParameters();
        parameters.add(Param.ID, listId);
        parameters.add(Param.MOVIE_ID, mediaId);

        URL url = new ApiUrl(apiKey, MethodBase.LIST).subMethod(MethodSub.ITEM_STATUS).buildUrl(parameters);
        String webpage = httpTools.getRequest(url);

        try {
            return MAPPER.readValue(webpage, ListItemStatus.class).isItemPresent();
        } catch (IOException ex) {
            throw new MovieDbException(ApiExceptionType.MAPPING_FAILED, "Failed to get item status", url, ex);
        }
    }
753686
public ResultList<ReleaseInfo> getMovieReleaseInfo(int movieId, String language) throws MovieDbException {
        TmdbParameters parameters = new TmdbParameters();
        parameters.add(Param.ID, movieId);
        parameters.add(Param.LANGUAGE, language);

        URL url = new ApiUrl(apiKey, MethodBase.MOVIE).subMethod(MethodSub.RELEASES).buildUrl(parameters);
        String webpage = httpTools.getRequest(url);

        try {
            WrapperReleaseInfo wrapper = MAPPER.readValue(webpage, WrapperReleaseInfo.class);
            ResultList<ReleaseInfo> results = new ResultList<>(wrapper.getCountries());
            wrapper.setResultProperties(results);
            return results;
        } catch (IOException ex) {
            throw new MovieDbException(ApiExceptionType.MAPPING_FAILED, "Failed to get release information", url, ex);
        }
    }
833687
public ResultList<MovieBasic> getKeywordMovies(String keywordId, String language, Integer page) throws MovieDbException {
        TmdbParameters parameters = new TmdbParameters();
        parameters.add(Param.ID, keywordId);
        parameters.add(Param.LANGUAGE, language);
        parameters.add(Param.PAGE, page);

        URL url = new ApiUrl(apiKey, MethodBase.KEYWORD).subMethod(MethodSub.MOVIES).buildUrl(parameters);
        WrapperGenericList<MovieBasic> wrapper = processWrapper(getTypeReference(MovieBasic.class), url, "keyword movies");
        return wrapper.getResultsList();
    }
151714
function (mediaStreamId, options, plugin) {
    var Proto = function MediaStreamTrack () {},
        api = new Proto();

    api.id = options.id;
    api.kind = options.kind;
    api.label = options.label;
    api.enabled = $.castToBoolean(options.enabled);
    api.streamId = mediaStreamId;

    api.setEnabled = function (enabled) {
      api.enabled = $.castToBoolean(enabled);

      if (api.enabled) {
        plugin._.enableMediaStreamTrack(mediaStreamId, api.id);
      }
      else {
        plugin._.disableMediaStreamTrack(mediaStreamId, api.id);
      }
    };

    return api;
  }
224236
public ResultList<MovieBasic> getGuestRatedMovies(String guestSessionId, String language, Integer page, SortBy sortBy) throws MovieDbException {
        TmdbParameters parameters = new TmdbParameters();
        parameters.add(Param.ID, guestSessionId);
        parameters.add(Param.LANGUAGE, language);
        parameters.add(Param.PAGE, page);
        if (sortBy != null) {
            // Only created_at is supported
            parameters.add(Param.SORT_BY, "created_at");

            if (sortBy.getPropertyString().endsWith("asc")) {
                parameters.add(Param.SORT_ORDER, "asc");
            } else {
                parameters.add(Param.SORT_ORDER, "desc");
            }
        }

        URL url = new ApiUrl(apiKey, MethodBase.GUEST_SESSION).subMethod(MethodSub.RATED_MOVIES_GUEST).buildUrl(parameters);
        WrapperGenericList<MovieBasic> wrapper = processWrapper(getTypeReference(MovieBasic.class), url, "Guest Session Movies");
        return wrapper.getResultsList();
    }
43053
public ResultList<ReleaseInfo> getMovieReleaseInfo(int movieId, String language) throws MovieDbException {
        return tmdbMovies.getMovieReleaseInfo(movieId, language);
    }
63402
public Account getAccount(String sessionId) throws MovieDbException {
        TmdbParameters parameters = new TmdbParameters();
        parameters.add(Param.SESSION_ID, sessionId);

        URL url = new ApiUrl(apiKey, MethodBase.ACCOUNT).buildUrl(parameters);
        String webpage = httpTools.getRequest(url);

        try {
            return MAPPER.readValue(webpage, Account.class);
        } catch (IOException ex) {
            throw new MovieDbException(ApiExceptionType.MAPPING_FAILED, "Failed to get Account", url, ex);
        }
    }
1267431
protected Response getConfiguration(final String extensionId, final Sid accountSid, final MediaType responseType) {
        //Parameter "extensionId" could be the extension Sid or extension name.

        ExtensionConfiguration extensionConfiguration = null;
        ExtensionConfiguration extensionAccountConfiguration = null;
        Sid extensionSid = null;
        String extensionName = null;

        if(Sid.pattern.matcher(extensionId).matches()){
            extensionSid = new Sid(extensionId);
        } else {
            extensionName = extensionId;
        }

        if (Sid.pattern.matcher(extensionId).matches()) {
            try {
                extensionConfiguration = extensionsConfigurationDao.getConfigurationBySid(extensionSid);
            } catch (Exception e) {
                return status(NOT_FOUND).build();
            }
        } else {
            try {
                extensionConfiguration = extensionsConfigurationDao.getConfigurationByName(extensionName);
            } catch (Exception e) {
                return status(NOT_FOUND).build();
            }
        }

        if (accountSid!=null) {
            if(extensionSid == null ){
                extensionSid = extensionConfiguration.getSid();
            }
            try {
                extensionAccountConfiguration = extensionsConfigurationDao.getAccountExtensionConfiguration(accountSid.toString(), extensionSid.toString());
                extensionConfiguration.setConfigurationData(extensionAccountConfiguration.getConfigurationData(), extensionAccountConfiguration.getConfigurationType());
            } catch (Exception e) {
                return status(NOT_FOUND).build();
            }
        }

        if (extensionConfiguration == null) {
            return status(NOT_FOUND).build();
        } else {
            if (APPLICATION_XML_TYPE.equals(responseType)) {
                final RestCommResponse response = new RestCommResponse(extensionConfiguration);
                return ok(xstream.toXML(response), APPLICATION_XML).build();
            } else if (APPLICATION_JSON_TYPE.equals(responseType)) {
                return ok(gson.toJson(extensionConfiguration), APPLICATION_JSON).build();
            } else {
                return null;
            }
        }
    }
612460
public TokenSession getSessionToken(TokenAuthorisation token) throws MovieDbException {
        TmdbParameters parameters = new TmdbParameters();

        if (!token.getSuccess()) {
            throw new MovieDbException(ApiExceptionType.AUTH_FAILURE, "Authorisation token was not successful!");
        }

        parameters.add(Param.TOKEN, token.getRequestToken());
        URL url = new ApiUrl(apiKey, MethodBase.AUTH).subMethod(MethodSub.SESSION_NEW).buildUrl(parameters);
        String webpage = httpTools.getRequest(url);

        try {
            return MAPPER.readValue(webpage, TokenSession.class);
        } catch (IOException ex) {
            throw new MovieDbException(ApiExceptionType.MAPPING_FAILED, "Failed to get Session Token", url, ex);
        }
    }