| 36 | } |
| 37 | |
| 38 | void StreamDBOperator::AddStream(const std::shared_ptr<spvr::SpvrStream>& stream) { |
| 39 | if (stream->stream_id_.empty()) { |
| 40 | stream->stream_id_ = GenUUID(); |
| 41 | } |
| 42 | //stream.stream_id = MD5::Hex(stream.stream_id); |
| 43 | stream->bg_color_ = RandomColor(); |
| 44 | stream->created_timestamp_ = (int64_t)TimeUtil::GetCurrentTimestamp(); |
| 45 | stream->updated_timestamp_ = stream->created_timestamp_; |
| 46 | using Storage = decltype(db_->GetStorageTypeValue()); |
| 47 | auto storage = std::any_cast<Storage>(db_->GetDbStorage()); |
| 48 | storage.insert(*stream); |
| 49 | } |
| 50 | |
| 51 | bool StreamDBOperator::HasStream(const std::string& stream_id) { |
| 52 | using Storage = decltype(db_->GetStorageTypeValue()); |
no test coverage detected