CC-2795: Give option to set download flag of recorded shows
uploaded to Soundcloud by default - done
This commit is contained in:
parent
8ef8dbc668
commit
7e3d25eeaa
8 changed files with 73 additions and 8 deletions
|
@ -438,5 +438,21 @@ class Application_Model_Preference
|
|||
public static function GetAirtimeVersion(){
|
||||
return self::GetValue("system_version");
|
||||
}
|
||||
|
||||
public static function SetUploadToSoundcloudOption($upload) {
|
||||
self::SetValue("soundcloud_upload_option", $upload);
|
||||
}
|
||||
|
||||
public static function GetUploadToSoundcloudOption() {
|
||||
return self::GetValue("soundcloud_upload_option");
|
||||
}
|
||||
|
||||
public static function SetSoundCloudDownloadbleOption($upload) {
|
||||
self::SetValue("soundcloud_downloadable", $upload);
|
||||
}
|
||||
|
||||
public static function GetSoundCloudDownloadbleOption() {
|
||||
return self::GetValue("soundcloud_downloadable");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -40,13 +40,15 @@ class Application_Model_AtSoundcloud {
|
|||
$tags = Application_Model_Preference::GetSoundCloudTags();
|
||||
}
|
||||
|
||||
$downloadable = Application_Model_Preference::GetSoundCloudDownloadbleOption() == '1'?true:false;
|
||||
|
||||
$track_data = array(
|
||||
'track[sharing]' => 'private',
|
||||
'track[title]' => $filename,
|
||||
'track[asset_data]' => '@' . $filepath,
|
||||
'track[tag_list]' => $tags,
|
||||
'track[description]' => $description,
|
||||
'track[downloadable]' => true,
|
||||
'track[downloadable]' => $downloadable,
|
||||
|
||||
);
|
||||
|
||||
|
|
|
@ -931,19 +931,18 @@ class Application_Model_StoredFile {
|
|||
public function uploadToSoundCloud()
|
||||
{
|
||||
global $CC_CONFIG;
|
||||
|
||||
|
||||
$file = $this->_file;
|
||||
if(is_null($file)) {
|
||||
return "File does not exist";
|
||||
}
|
||||
if(Application_Model_Preference::GetDoSoundCloudUpload())
|
||||
if(Application_Model_Preference::GetUploadToSoundcloudOption())
|
||||
{
|
||||
for($i=0; $i<$CC_CONFIG['soundcloud-connection-retries']; $i++) {
|
||||
$description = $file->getDbTrackTitle();
|
||||
$tag = "";
|
||||
$genre = $file->getDbGenre();
|
||||
$release = $file->getDbYear();
|
||||
|
||||
try {
|
||||
$soundcloud = new Application_Model_AtSoundcloud();
|
||||
$soundcloud_id = $soundcloud->uploadTrack($this->getFilePath(), $this->getName(), $description, $tag, $release, $genre);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue