Skip to content
Snippets Groups Projects
Commit 995ca5b1 authored by Yassine Doghri's avatar Yassine Doghri
Browse files

fix(podcast-model): always query podcast from database when clearing cache

this prevents from having any unexpected caching side effects
parent 7c98b55a
No related branches found
No related tags found
No related merge requests found
Pipeline #18795 passed
Pipeline: Castopod

#18800

    Pipeline: Castopod

    #18799

      Pipeline: castopod.org

      #18798

        ......@@ -335,7 +335,7 @@ class PodcastModel extends Model
        */
        public function clearCache(array $data): array
        {
        $podcast = (new self())->getPodcastById((int) (is_array($data['id']) ? $data['id'][0] : $data['id']));
        $podcast = (new self())->find((int) (is_array($data['id']) ? $data['id'][0] : $data['id']));
        // delete cache for users' podcasts
        cache()
        ......@@ -427,7 +427,7 @@ class PodcastModel extends Model
        */
        protected function setActorAvatar(array $data): array
        {
        $podcast = (new self())->getPodcastById((int) (is_array($data['id']) ? $data['id'][0] : $data['id']));
        $podcast = (new self())->find((int) (is_array($data['id']) ? $data['id'][0] : $data['id']));
        if ($podcast instanceof Podcast) {
        $podcastActor = (new ActorModel())->find($podcast->actor_id);
        ......@@ -452,7 +452,7 @@ class PodcastModel extends Model
        */
        protected function updatePodcastActor(array $data): array
        {
        $podcast = (new self())->getPodcastById((int) (is_array($data['id']) ? $data['id'][0] : $data['id']));
        $podcast = (new self())->find((int) (is_array($data['id']) ? $data['id'][0] : $data['id']));
        if ($podcast instanceof Podcast) {
        $actorModel = new ActorModel();
        ......
        0% Loading or .
        You are about to add 0 people to the discussion. Proceed with caution.
        Finish editing this message first!
        Please register or to comment