| 2146 | } |
| 2147 | |
| 2148 | void SessionActor::create_container( |
| 2149 | caf::actor actor, |
| 2150 | caf::typed_response_promise<std::pair<utility::Uuid, UuidActor>> rp, |
| 2151 | const Uuid &uuid_before, |
| 2152 | const bool into) { |
| 2153 | |
| 2154 | mail(detail_atom_v) |
| 2155 | .request(actor, infinite) |
| 2156 | .await( |
| 2157 | [=](const ContainerDetail &detail) mutable { |
| 2158 | playlists_[detail.uuid_] = actor; |
| 2159 | link_to(actor); |
| 2160 | join_event_group(this, actor); |
| 2161 | PlaylistItem tmp(detail.name_, detail.type_, detail.uuid_); |
| 2162 | auto cuuid = base_.insert_container(tmp, uuid_before, into); |
| 2163 | if (not cuuid) { |
| 2164 | cuuid = base_.insert_container(tmp); |
| 2165 | } |
| 2166 | base_.send_changed(); |
| 2167 | mail(utility::event_atom_v, add_playlist_atom_v, UuidActor(detail.uuid_, actor)) |
| 2168 | .send(base_.event_group()); |
| 2169 | |
| 2170 | rp.deliver(std::make_pair(*cuuid, UuidActor(detail.uuid_, actor))); |
| 2171 | }, |
| 2172 | [=](error &err) mutable { rp.deliver(err); }); |
| 2173 | } |
| 2174 | |
| 2175 | // this is gonna be fun... |
| 2176 | // we need to serialise all items under and including uuid |
nothing calls this directly
no test coverage detected