* null if the video could not be updated.
*/
private VideoEntry updateVideoDescription(VideoSubmission videoSubmission,
String prependText, String newTag) {
YouTubeApiHelper userYouTubeApi = new YouTubeApiHelper(adminConfigDao);
UserAuthToken userAuthToken = userAuthTokenDao
.getUserAuthToken(videoSubmission.getYouTubeName());
if (!userAuthToken.getAuthSubToken().isEmpty()) {
userYouTubeApi.setAuthSubToken(userAuthToken.getAuthSubToken());
} else {
userYouTubeApi.setClientLoginToken(userAuthToken.getClientLoginToken());
}
String videoId = videoSubmission.getVideoId();
LOG.info(String.format(
"Updating description and tags of id '%s' (YouTube video id '%s').",
videoSubmission.getId(), videoId));
VideoEntry videoEntry = userYouTubeApi.getUploadsVideoEntry(videoId);
if (videoEntry == null) {
LOG.warning(String.format(
"Couldn't get video with id '%s' in the uploads feed of user "
+ "'%s'. Perhaps the AuthSub token has been revoked?", videoId,
videoSubmission.getYouTubeName()));