Skip to content

Commit

Permalink
fixed issue with subfolder video activations
Browse files Browse the repository at this point in the history
  • Loading branch information
hngrylobster committed Sep 28, 2022
1 parent 792f3a2 commit 1911f57
Showing 1 changed file with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,16 @@ private ReplicationResult activateNew(Asset _asset, ServiceUtil serviceUtil, Vid
LOGGER.trace("UPDATING RENDITIONS FOR THIS ASSET");
serviceUtil.updateRenditions(_asset, video);

Node assetNode = _asset.adaptTo(Node.class);
LOGGER.trace("CHECKING PARENT FOR BRC_FOLDER_ID: " + assetNode.getParent().getPath());
if (assetNode.getParent().hasProperty("brc_folder_id")) {
// this is in a subfolder so we need to formally move the asset to this folder
String brc_folder_id = assetNode.getParent().getProperty("brc_folder_id").getString();
LOGGER.trace("SUBFOLDER FOUND - SETTING THE FOLDER ID to '" + brc_folder_id + "'");
serviceUtil.moveVideoToFolder(
brc_folder_id,
api_resp.getString(Constants.VIDEOID));
}

replicationLog.info("BC: ACTIVATION SUCCESSFUL >> {}" , _asset.getPath());
result = ReplicationResult.OK;
Expand Down Expand Up @@ -411,6 +421,17 @@ private ReplicationResult activateModified(Asset _asset, ServiceUtil serviceUtil
LOGGER.trace("UPDATING RENDITIONS FOR THIS ASSET");
serviceUtil.updateRenditions(_asset, video);

Node assetNode = _asset.adaptTo(Node.class);
LOGGER.trace("CHECKING PARENT FOR BRC_FOLDER_ID: " + assetNode.getParent().getPath());
if (assetNode.getParent().hasProperty("brc_folder_id")) {
// this is in a subfolder so we need to formally move the asset to this folder
String brc_folder_id = assetNode.getParent().getProperty("brc_folder_id").getString();
LOGGER.trace("SUBFOLDER FOUND - SETTING THE FOLDER ID to '" + brc_folder_id + "'");
serviceUtil.moveVideoToFolder(
brc_folder_id,
api_resp.getString(Constants.VIDEOID));
}

replicationLog.info(Constants.REP_ACTIVATION_SUCCESS_TMPL, _asset.getPath());
long current_time_millisec = new Date().getTime();
brc_lastsync_map.put(Constants.BRC_LASTSYNC, current_time_millisec);
Expand Down

0 comments on commit 1911f57

Please sign in to comment.