浏览代码

Anomalie #707: url deezer pas de jackett

Bastien Sevajol 11 年前
父节点
当前提交
7ee8efded1
共有 1 个文件被更改,包括 18 次插入2 次删除
  1. 18 2
      src/Muzich/CoreBundle/Factory/Elements/Soundcloudcom.php

+ 18 - 2
src/Muzich/CoreBundle/Factory/Elements/Soundcloudcom.php 查看文件

@@ -163,9 +163,25 @@ class Soundcloudcom extends ElementFactory
163 163
 
164 164
         if (array_key_exists('artwork_url', $result) )
165 165
         {
166
-          $this->element->setData(Element::DATA_THUMB_URL, $result['artwork_url']);
166
+          if ($result['artwork_url'])
167
+          {
168
+            $this->element->setData(Element::DATA_THUMB_URL, $result['artwork_url']);
169
+          }
170
+          else
171
+          {
172
+            if (array_key_exists('user', $result) )
173
+            {
174
+              if (array_key_exists('avatar_url', $result['user']) )
175
+              {
176
+                if ($result['user']['avatar_url'])
177
+                {
178
+                  $this->element->setData(Element::DATA_THUMB_URL, $result['user']['avatar_url']);
179
+                }
180
+              }
181
+            }
182
+          }
167 183
         }
168
-
184
+        
169 185
         if (array_key_exists('kind', $result) )
170 186
         {
171 187
           $this->element->setData(Element::DATA_TYPE, $result['kind']);