Bläddra i källkod

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

Sevajol Bastien 12 år sedan
förälder
incheckning
c3bfaaeff9

+ 7 - 9
src/Muzich/CoreBundle/Factory/Elements/Soundcloudcom.php Visa fil

57
       curl_setopt_array( $ch, $options );
57
       curl_setopt_array( $ch, $options );
58
       $result = json_decode(curl_exec($ch));
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
       if (!isset($result->location))
68
       if (!isset($result->location))
71
       {
69
       {
72
-        return null;
70
+        return;
73
       }
71
       }
74
       
72
       
75
       if (!$result->location)
73
       if (!$result->location)
76
       {
74
       {
77
-        return null;
75
+        return;
78
       }
76
       }
79
       
77
       
80
       $getjsonurl = $result->location;
78
       $getjsonurl = $result->location;

+ 2 - 2
src/Muzich/CoreBundle/Tests/ElementFactory/ElementFactoryTest.php Visa fil

353
     $this->assertEquals(array(
353
     $this->assertEquals(array(
354
       'data_ref_id' => 3770,
354
       'data_ref_id' => 3770,
355
       'data_title' => 'Library Project',
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
       'data_type' => 'playlist',
357
       'data_type' => 'playlist',
358
       'data_download' => null,
358
       'data_download' => null,
359
       'data_download_url' => 'http://soundcloud.com/matas/sets/library-project/download',
359
       'data_download_url' => 'http://soundcloud.com/matas/sets/library-project/download',
368
     $this->assertEquals(array(
368
     $this->assertEquals(array(
369
       'data_ref_id' => 3154252,
369
       'data_ref_id' => 3154252,
370
       'data_title' => 'Above Hyperion (redux)',
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
       'data_type' => 'track',
372
       'data_type' => 'track',
373
       'data_download' => false,
373
       'data_download' => false,
374
       'data_download_url' => 'http://soundcloud.com/matas/above-hyperion-redux/download',
374
       'data_download_url' => 'http://soundcloud.com/matas/above-hyperion-redux/download',