"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const utils = require("../features/utils/library-utils");
const storyboard_1 = require("storyboard");
function default_1(app) {
    app.post('/api/tracks/toggle-hidden', (req, res) => {
        utils.toggleHideTrack(req.body.track).then(() => {
            res.status(200).send({ success: true });
        }).catch((err) => {
            res.status(500).send({
                success: false,
                error: 'An error occurred, please see logs for more details'
            });
            storyboard_1.mainStory.error('utils', err.message, { attach: err });
        });
    });
    app.post('/api/tracks/remove', (req, res) => {
        utils.removeTrack(req.body.track).then(() => {
            res.status(200).send({ success: true });
        }).catch((err) => {
            res.status(500).send({
                success: false,
                error: 'An error occurred, please see logs for more details'
            });
            storyboard_1.mainStory.error('utils', err.message, { attach: err });
        });
    });
    app.post('/api/tracks/set-artist', (req, res) => {
        utils.changeTrackArtist(req.body.track, req.body.artist).then(() => {
            res.status(200).send({ success: true });
        }).catch((err) => {
            res.status(500).send({
                success: false,
                error: 'An error occurred, please see logs for more details'
            });
            storyboard_1.mainStory.error('utils', err.message, { attach: err });
        });
    });
}
exports.default = default_1;
//# sourceMappingURL=utils.js.map