MT#63070 Add request for sems to clear its audio cache

This patch add the request for sems to clear its audio cache when the SoundSet is updated.

Change-Id: Id6970b429b211f93d088703dcdfac15dd8d43088
(cherry picked from commit 0850b11f8a)
(cherry picked from commit d0cd764c7e)
mr13.3.1
Fabricio Santolin da Silva 3 months ago
parent 175f0435e4
commit e8abe76842

@ -31,6 +31,16 @@ sub get_journal_methods{
sub update_item_model {
my ($self, $c, $item, $old_resource, $resource, $form) = @_;
my $old_parent_id = $old_resource->{parent_id};
my $new_parent_id = $resource->{parent_id};
if ((!defined $old_parent_id && defined $new_parent_id)
|| (defined $old_parent_id && !defined $new_parent_id)
|| (defined $old_parent_id && defined $new_parent_id && $old_parent_id != $new_parent_id)
) {
$c->log->debug("Parent changed: clearing cache for set " . $item->id);
NGCP::Panel::Utils::Sems::clear_audio_cache($c, $item->id);
}
my $copy_from_default_params = { map {$_ => delete $resource->{$_}} (qw/copy_from_default loopplay replace_existing language/) };
$item->update($resource);
if ($copy_from_default_params->{copy_from_default}) {

Loading…
Cancel
Save