Skip to content

Commit

Permalink
Merge branch 'develop' into audio-preset-group
Browse files Browse the repository at this point in the history
  • Loading branch information
hanazarraa authored Jul 24, 2023
2 parents 37e24ab + 8ddbbde commit 93bfbad
Show file tree
Hide file tree
Showing 3 changed files with 77 additions and 41 deletions.
4 changes: 3 additions & 1 deletion bbbeasy-backend/app/src/Models/Preset.php
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,9 @@ public function getPresetSettings(): array
$presetSett = new PresetSetting();

foreach ($attributes as $attribute) {
$presetSettings = $presetSett->getByName($attribute);

$presetSettings = $presetSett->getByNameAndGroup($attribute,$categoryName);

if (!$presetSettings->dry() && $presetSettings->enabled) {
if (!$settings[$categoryName]) {
$settings += [$categoryName => [$presetSettings->name => '']];
Expand Down
8 changes: 8 additions & 0 deletions bbbeasy-backend/app/src/Models/PresetSetting.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,14 @@ public function getByName(string $name): self
return $this;
}

public function getByNameAndGroup(string $name,string $group): self
{
$this->load(['name = ? and group = ? ', $name,$group]);

return $this;
}


public function savePresetSettings(array $presets): bool|string
{
foreach ($presets as $preset) {
Expand Down
Loading

0 comments on commit 93bfbad

Please sign in to comment.