|
@@ -170,37 +170,6 @@ export default {
|
|
);
|
|
);
|
|
}),
|
|
}),
|
|
|
|
|
|
- /**
|
|
|
|
- * Gets a set of songs
|
|
|
|
- *
|
|
|
|
- * @param {object} session - the session object automatically added by the websocket
|
|
|
|
- * @param set - the set number to return
|
|
|
|
- * @param cb
|
|
|
|
- */
|
|
|
|
- getSet: isAdminRequired(async function getSet(session, set, cb) {
|
|
|
|
- const songModel = await DBModule.runJob("GET_MODEL", { modelName: "song" }, this);
|
|
|
|
- async.waterfall(
|
|
|
|
- [
|
|
|
|
- next => {
|
|
|
|
- songModel
|
|
|
|
- .find({})
|
|
|
|
- .skip(15 * (set - 1))
|
|
|
|
- .limit(15)
|
|
|
|
- .exec(next);
|
|
|
|
- }
|
|
|
|
- ],
|
|
|
|
- async (err, songs) => {
|
|
|
|
- if (err) {
|
|
|
|
- err = await UtilsModule.runJob("GET_ERROR", { error: err }, this);
|
|
|
|
- this.log("ERROR", "SONGS_GET_SET", `Failed to get set from songs. "${err}"`);
|
|
|
|
- return cb({ status: "error", message: err });
|
|
|
|
- }
|
|
|
|
- this.log("SUCCESS", "SONGS_GET_SET", `Got set from songs successfully.`);
|
|
|
|
- return cb({ status: "success", message: "Successfully got set of songs.", data: { songs } });
|
|
|
|
- }
|
|
|
|
- );
|
|
|
|
- }),
|
|
|
|
-
|
|
|
|
/**
|
|
/**
|
|
* Gets songs, used in the admin songs page by the AdvancedTable component
|
|
* Gets songs, used in the admin songs page by the AdvancedTable component
|
|
*
|
|
*
|