MCPcopy Create free account
hub / github.com/Soundux/Soundux / markFavorite

Method markFavorite

src/core/objects/data.cpp:150–169  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

148 }
149 }
150 void Data::markFavorite(const std::uint32_t &id, bool favourite)
151 {
152 auto sound = getSound(id);
153 if (sound)
154 {
155 sound->get().isFavorite = favourite;
156 if (favourite)
157 {
158 Globals::gFavorites->insert({id, sound->get()});
159 }
160 else
161 {
162 auto scopedFavorites = Globals::gFavorites.scoped();
163 if (scopedFavorites->find(id) != scopedFavorites->end())
164 {
165 scopedFavorites->erase(id);
166 }
167 }
168 }
169 }
170 std::vector<std::uint32_t> Data::getFavoriteIds()
171 {
172 auto scopedFavorites = Globals::gFavorites.scoped();

Callers 1

exposeFunctionsMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected