|
@@ -128,50 +128,59 @@ class Soundcloudcom extends ElementFactory
|
128
|
128
|
|
129
|
129
|
*/
|
130
|
130
|
|
131
|
|
- if (array_key_exists('id', $result) )
|
|
131
|
+ // En premier lieux il nous faut être sur d'avoir le droit d'utiliser le lecteur exportable
|
|
132
|
+ $sharing = false;
|
|
133
|
+ if (array_key_exists('sharing', $result) && array_key_exists('embeddable_by', $result))
|
132
|
134
|
{
|
133
|
|
- $this->element->setData(Element::DATA_REF_ID, $result['id']);
|
134
|
|
- }
|
135
|
|
-
|
136
|
|
- if (array_key_exists('artwork_url', $result) )
|
137
|
|
- {
|
138
|
|
- $this->element->setData(Element::DATA_THUMB_URL, $result['artwork_url']);
|
139
|
|
- }
|
140
|
|
-
|
141
|
|
- if (array_key_exists('kind', $result) )
|
142
|
|
- {
|
143
|
|
- $this->element->setData(Element::DATA_TYPE, $result['kind']);
|
144
|
|
- }
|
145
|
|
-
|
146
|
|
- if (array_key_exists('downloadable', $result) )
|
147
|
|
- {
|
148
|
|
- $this->element->setData(Element::DATA_DOWNLOAD, $result['downloadable']);
|
149
|
|
- // FIXME
|
150
|
|
- $this->element->setData(Element::DATA_DOWNLOAD_URL, $this->element->getUrl().'/download');
|
151
|
|
- }
|
152
|
|
-
|
153
|
|
- if (array_key_exists('title', $result) )
|
154
|
|
- {
|
155
|
|
- $this->element->setData(Element::DATA_TITLE, $result['title']);
|
156
|
|
- }
|
157
|
|
-
|
158
|
|
- if (array_key_exists('user', $result) )
|
159
|
|
- {
|
160
|
|
- $this->element->setData(Element::DATA_ARTIST, $result['user']['username']);
|
|
135
|
+ if ($result['sharing'] == 'public' && ($result['embeddable_by'] == 'all' || $result['embeddable_by'] == 'me'))
|
|
136
|
+ {
|
|
137
|
+ $sharing = true;
|
|
138
|
+ }
|
161
|
139
|
}
|
162
|
140
|
|
163
|
|
- if (array_key_exists('genre', $result) )
|
|
141
|
+ if ($sharing)
|
164
|
142
|
{
|
165
|
|
- if (strlen($result['genre']))
|
|
143
|
+ if (array_key_exists('id', $result) )
|
|
144
|
+ {
|
|
145
|
+ $this->element->setData(Element::DATA_REF_ID, $result['id']);
|
|
146
|
+ }
|
|
147
|
+
|
|
148
|
+ if (array_key_exists('artwork_url', $result) )
|
166
|
149
|
{
|
167
|
|
- $this->element->setData(Element::DATA_TAGS, array($result['genre']));
|
|
150
|
+ $this->element->setData(Element::DATA_THUMB_URL, $result['artwork_url']);
|
|
151
|
+ }
|
|
152
|
+
|
|
153
|
+ if (array_key_exists('kind', $result) )
|
|
154
|
+ {
|
|
155
|
+ $this->element->setData(Element::DATA_TYPE, $result['kind']);
|
|
156
|
+ }
|
|
157
|
+
|
|
158
|
+ if (array_key_exists('downloadable', $result) )
|
|
159
|
+ {
|
|
160
|
+ $this->element->setData(Element::DATA_DOWNLOAD, $result['downloadable']);
|
|
161
|
+ // FIXME
|
|
162
|
+ $this->element->setData(Element::DATA_DOWNLOAD_URL, $this->element->getUrl().'/download');
|
|
163
|
+ }
|
|
164
|
+
|
|
165
|
+ if (array_key_exists('title', $result) )
|
|
166
|
+ {
|
|
167
|
+ $this->element->setData(Element::DATA_TITLE, $result['title']);
|
|
168
|
+ }
|
|
169
|
+
|
|
170
|
+ if (array_key_exists('user', $result) )
|
|
171
|
+ {
|
|
172
|
+ $this->element->setData(Element::DATA_ARTIST, $result['user']['username']);
|
|
173
|
+ }
|
|
174
|
+
|
|
175
|
+ if (array_key_exists('genre', $result) )
|
|
176
|
+ {
|
|
177
|
+ if (strlen($result['genre']))
|
|
178
|
+ {
|
|
179
|
+ $this->element->setData(Element::DATA_TAGS, array($result['genre']));
|
|
180
|
+ }
|
168
|
181
|
}
|
169
|
182
|
}
|
170
|
|
-
|
171
|
|
- /*
|
172
|
|
- * TODO: Il y a un parametre share:public si a pas public pas de lecteur intégré ??
|
173
|
|
- */
|
174
|
|
-
|
|
183
|
+
|
175
|
184
|
}
|
176
|
185
|
}
|
177
|
186
|
|