mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-15 10:16:12 +01:00
Sound system improvements
- Fix sound ACP uploads - Display soundpack names with sound files - Soundpacks can have sounds with identical names - Link sounds during build step - Generate map of sound name to file name during build step - Change how soundpacks work. It's now done via a field in plugin.json
This commit is contained in:
@@ -5,7 +5,7 @@ var winston = require('winston');
|
||||
|
||||
var buildStart;
|
||||
|
||||
var valid = ['js', 'clientCSS', 'acpCSS', 'tpl', 'lang'];
|
||||
var valid = ['js', 'clientCSS', 'acpCSS', 'tpl', 'lang', 'sound'];
|
||||
|
||||
exports.buildAll = function (callback) {
|
||||
exports.build(valid.join(','), callback);
|
||||
@@ -46,7 +46,7 @@ exports.buildTargets = function (targets, callback) {
|
||||
var cacheBuster = require('./cacheBuster');
|
||||
var meta = require('../meta');
|
||||
var numCpus = require('os').cpus().length;
|
||||
var strategy = (targets.length > 1 && numCpus > 1);
|
||||
var parallel = targets.length > 1 && numCpus > 1;
|
||||
|
||||
buildStart = buildStart || Date.now();
|
||||
|
||||
@@ -59,13 +59,13 @@ exports.buildTargets = function (targets, callback) {
|
||||
next();
|
||||
};
|
||||
|
||||
if (strategy) {
|
||||
if (parallel) {
|
||||
winston.verbose('[build] Utilising multiple cores/processes');
|
||||
} else {
|
||||
winston.verbose('[build] Utilising single-core');
|
||||
}
|
||||
|
||||
async[strategy ? 'parallel' : 'series']([
|
||||
async[parallel ? 'parallel' : 'series']([
|
||||
function (next) {
|
||||
if (targets.indexOf('js') !== -1) {
|
||||
winston.info('[build] Building javascript');
|
||||
@@ -111,6 +111,12 @@ exports.buildTargets = function (targets, callback) {
|
||||
meta.languages.build(step.bind(this, startTime, target, next));
|
||||
break;
|
||||
|
||||
case 'sound':
|
||||
winston.info('[build] Linking sound files');
|
||||
startTime = Date.now();
|
||||
meta.sounds.build(step.bind(this, startTime, target, next));
|
||||
break;
|
||||
|
||||
default:
|
||||
winston.warn('[build] Unknown build target: \'' + target + '\'');
|
||||
setImmediate(next);
|
||||
|
||||
Reference in New Issue
Block a user