Skip to content

Commit

Permalink
Release 1.8.2: Auphonic integration Enhancements
Browse files Browse the repository at this point in the history
- Preset is only applied once
- Add Text for "Open Production" button
- "Start Production" button more prominent
  • Loading branch information
eteubert committed Jul 27, 2013
1 parent 4d49dda commit 3e0370b
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 14 deletions.
30 changes: 18 additions & 12 deletions lib/modules/auphonic/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,14 @@ var PODLOVE = PODLOVE || {};

/**
* Extract Auphonic relevant data from WordPress web form.
*
* @param {string} mode "init" or "update". Default: "init". Update ignores presets and output files.
*
* @return json In the correct format for the Auphonic API.
*/
function extract_auphonic_data_from_form() {
function extract_auphonic_data_from_form(mode) {
mode = typeof mode !== 'undefined' ? mode : 'init';

var presetuuid = $("#auphonic").data('presetuuid'),
chapter_asset_assignment = $("#auphonic").data('assignment-chapter'),
cover_art_asset_assignment = $("#auphonic").data('assignment-image'),
Expand All @@ -163,15 +167,17 @@ var PODLOVE = PODLOVE || {};

data.metadata = {};

if(typeof presetuuid !== undefined && presetuuid !== "") {
data.preset = presetuuid;
} else {
// no preset? add some output files
data.output_files = [
{"format":"aac", "bitrate":"128", "ending":"m4a"},
{"format":"mp3", "bitrate":"128", "ending":"mp3"},
{"format":"opus", "bitrate":"96", "ending":"opus"}
]
if (mode === "init") {
if(typeof presetuuid !== undefined && presetuuid !== "") {
data.preset = presetuuid;
} else {
// no preset? add some output files
data.output_files = [
{"format":"aac", "bitrate":"128", "ending":"m4a"},
{"format":"mp3", "bitrate":"128", "ending":"mp3"},
{"format":"opus", "bitrate":"96", "ending":"opus"}
]
}
}

var service = $("#auphonic_services").val(),
Expand All @@ -188,7 +194,7 @@ var PODLOVE = PODLOVE || {};
}

data.length_timestring = $("#_podlove_meta_duration").val();
data.output_basename= $("#_podlove_meta_slug").val();
data.output_basename = $("#_podlove_meta_slug").val();
data.metadata.title = $("#title").val();
data.metadata.subtitle = $("#_podlove_meta_subtitle").val();
data.metadata.summary = $("#_podlove_meta_summary").val();
Expand Down Expand Up @@ -220,7 +226,7 @@ var PODLOVE = PODLOVE || {};

function update_auphonic_production(production_uuid, callback) {
var url = 'https://auphonic.com/api/production/{uuid}.json'
data = extract_auphonic_data_from_form();
data = extract_auphonic_data_from_form("update");

var xhr = PODLOVE.Auphonic.createCORSRequest("POST", url.replace("{uuid}", production_uuid));
xhr.setRequestHeader("Content-type","application/json");
Expand Down
3 changes: 2 additions & 1 deletion lib/modules/auphonic/auphonic.php
Original file line number Diff line number Diff line change
Expand Up @@ -228,9 +228,10 @@ public function auphonic_episodes_form() {
<span class="indicating_button_wrapper">
<i class="podlove-icon-share"></i>
</span>
Open Production
</button>

<button class="button" id="start_auphonic_production_button">
<button class="button button-primary" id="start_auphonic_production_button">
<span class="indicating_button_wrapper">
<span class="state_idle"><i class="podlove-icon-cogs"></i></span>
<span class="state_working"><i class="podlove-icon-spinner rotate"></i></span>
Expand Down
2 changes: 1 addition & 1 deletion podlove.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: Podlove Podcast Publisher
* Plugin URI: http://wordpress.org/extend/plugins/podlove-podcasting-plugin-for-wordpress/
* Description: The one and only next generation podcast feed generator. Seriously. It's magical and sparkles a lot.
* Version: 1.8.1-alpha
* Version: 1.8.2-alpha
* Author: eteubert
* Author URI: [email protected]
* License: MIT
Expand Down
6 changes: 6 additions & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,12 @@ Find the setting Flattr > Advanced Settings > Flattrable content > Post Types an

== Changelog ==

= 1.8.2 (2013-07-27) =
Auphonic integration Enhancements
- Preset is only applied once
- Add Text for "Open Production" button
- "Start Production" button more prominent

= 1.8.1 (2013-07-27) =
* Fix Release

Expand Down

0 comments on commit 3e0370b

Please sign in to comment.