CC-2110 : Soundcloud file metadata
added all defaults or ways to input a default for soundcloud metadata.
This commit is contained in:
parent
a6927442ec
commit
5a105ff4c8
7 changed files with 126 additions and 10 deletions
|
@ -28,7 +28,7 @@ class ATSoundcloud {
|
|||
return $token;
|
||||
}
|
||||
|
||||
public function uploadTrack($filepath, $filename, $description, $tags=array())
|
||||
public function uploadTrack($filepath, $filename, $description, $tags=array(), $release=null)
|
||||
{
|
||||
if($this->getToken())
|
||||
{
|
||||
|
@ -50,6 +50,33 @@ class ATSoundcloud {
|
|||
|
||||
);
|
||||
|
||||
if(isset($release)) {
|
||||
$release = str_replace(" ", "-", $release);
|
||||
$release = str_replace(":", "-", $release);
|
||||
|
||||
//YYYY-MM-DD-HH-mm-SS
|
||||
$release = explode("-", $release);
|
||||
|
||||
$track_data['track[release_year]'] = $release[0];
|
||||
$track_data['track[release_month]'] = $release[1];
|
||||
$track_data['track[release_day]'] = $release[2];
|
||||
}
|
||||
|
||||
$genre = Application_Model_Preference::GetSoundCloudGenre();
|
||||
if ($genre != "") {
|
||||
$track_data['track[genre]'] = $genre;
|
||||
}
|
||||
|
||||
$track_type = Application_Model_Preference::GetSoundCloudTrackType();
|
||||
if ($track_type != "") {
|
||||
$track_data['track[track_type]'] = $track_type;
|
||||
}
|
||||
|
||||
$license = Application_Model_Preference::GetSoundCloudLicense();
|
||||
if ($license != "") {
|
||||
$track_data['track[license]'] = $license;
|
||||
}
|
||||
|
||||
$response = json_decode(
|
||||
$this->_soundcloud->post('tracks', $track_data),
|
||||
true
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue