From 61554be12a64d59ab99fab810b1b05632b408f3a Mon Sep 17 00:00:00 2001
From: Benjamin Bellamy <ben@podlibre.org>
Date: Tue, 31 Aug 2021 08:52:28 +0000
Subject: [PATCH] fix(partner): set correct image URL

---
 app/Entities/Episode.php | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/app/Entities/Episode.php b/app/Entities/Episode.php
index 1e22dd36b7..264afdaa98 100644
--- a/app/Entities/Episode.php
+++ b/app/Entities/Episode.php
@@ -626,15 +626,12 @@ class Episode extends Entity
 
     public function getPartnerImageUrl(string $serviceSlug = null): string
     {
-        if ($serviceSlug !== null) {
-            return '&_from=' . $serviceSlug;
-        }
-
         return rtrim($this->getPodcast()->partner_image_url, '/') .
             '?pid=' .
             $this->getPodcast()
                 ->partner_id .
             '&guid=' .
-            urlencode($this->attributes['guid']);
+            urlencode($this->attributes['guid']) .
+            ($serviceSlug !== null ? '&_from=' . $serviceSlug : '');
     }
 }
-- 
GitLab