def isDeletableInAllProjectsFut()

in project_restorer/src/main/scala/PlutoCoreMessageProcessor.scala [52:64]


  def isDeletableInAllProjectsFut(item: OnlineOutputMessage): Future[(SendRemoveActionTarget.Value, OnlineOutputMessage)] = {
    // The first project id is the id of the triggering project, so we don't need to check the status of that
    val otherProjectIds = getCrosslinkProjectIds(item)
    logger.debug(s"All project for ${item.vidispineItemId.getOrElse("<missing vidispineItemId>")}: ${item.projectIds}, getting statuses for $otherProjectIds")

    getStatusesForProjects(otherProjectIds).map(statusMaybes =>
      statusMaybes.collect({ case Some(value) => value }) match {
        case crosslinkedProjectStatuses if stillInUse(crosslinkedProjectStatuses) => (SendRemoveActionTarget.Neither, item)
        case crosslinkedProjectStatuses if isHeld(crosslinkedProjectStatuses) => (SendRemoveActionTarget.OnlyOnline, item)
        case crosslinkedProjectStatuses if releasedByAll(crosslinkedProjectStatuses) => (SendRemoveActionTarget.Both, item)
        case _ => (SendRemoveActionTarget.Neither, item)
      })
  }