Pārlūkot izejas kodu

fixs: conditions de récupération des données auprés des api mis ajour pour soundCloud.

Sevajol Bastien 11 gadus atpakaļ
vecāks
revīzija
c3bfaaeff9

+ 7 - 9
src/Muzich/CoreBundle/Factory/Elements/Soundcloudcom.php Parādīt failu

@@ -57,24 +57,22 @@ class Soundcloudcom extends ElementFactory
57 57
       curl_setopt_array( $ch, $options );
58 58
       $result = json_decode(curl_exec($ch));
59 59
 
60
-      if (!isset($result->errors))
60
+      if (isset($result->errors))
61 61
       {
62
-        return;
63
-      }
64
-      
65
-      if (count($result->errors))
66
-      {
67
-        return;  
62
+        if (count($result->errors))
63
+        {
64
+          return;  
65
+        }
68 66
       }
69 67
       
70 68
       if (!isset($result->location))
71 69
       {
72
-        return null;
70
+        return;
73 71
       }
74 72
       
75 73
       if (!$result->location)
76 74
       {
77
-        return null;
75
+        return;
78 76
       }
79 77
       
80 78
       $getjsonurl = $result->location;

+ 2 - 2
src/Muzich/CoreBundle/Tests/ElementFactory/ElementFactoryTest.php Parādīt failu

@@ -353,7 +353,7 @@ class ElementFactoryTest extends UnitTest
353 353
     $this->assertEquals(array(
354 354
       'data_ref_id' => 3770,
355 355
       'data_title' => 'Library Project',
356
-      'data_thumb_url' => 'http://i1.sndcdn.com/artworks-000000514203-fsvbcj-large.jpg?04ad178',
356
+      'data_thumb_url' => 'http://i1.sndcdn.com/artworks-000000514203-fsvbcj-large.jpg?51826bf',
357 357
       'data_type' => 'playlist',
358 358
       'data_download' => null,
359 359
       'data_download_url' => 'http://soundcloud.com/matas/sets/library-project/download',
@@ -368,7 +368,7 @@ class ElementFactoryTest extends UnitTest
368 368
     $this->assertEquals(array(
369 369
       'data_ref_id' => 3154252,
370 370
       'data_title' => 'Above Hyperion (redux)',
371
-      'data_thumb_url' => 'http://i1.sndcdn.com/artworks-000001536693-gb1n5v-large.jpg?04ad178',
371
+      'data_thumb_url' => 'http://i1.sndcdn.com/artworks-000001536693-gb1n5v-large.jpg?51826bf',
372 372
       'data_type' => 'track',
373 373
       'data_download' => false,
374 374
       'data_download_url' => 'http://soundcloud.com/matas/above-hyperion-redux/download',