UnknownSec Bypass
403
:
/
var
/
www
/
stp-bhaktisagar-backend
/
src
/
models
/ [
drwxrwxr-x
]
Menu
Upload
Mass depes
Mass delete
Terminal
Info server
About
name :
audio.model.js
const { runMySqlQuery } = require("../config/mysql"); const commonModel = require("./common.model"); exports.getPlaylistById = async (id) => { let results = await runMySqlQuery( ` SELECT * FROM playlist WHERE type='audio' AND FIND_IN_SET(?,items); `, [id] ); return results; }; exports.removeFromPlaylistById = async (id) => { let playlist = await this.getPlaylistById(id); for (const plData of playlist) { let plAudio = plData.items ? plData.items.split(",") : []; let index = plAudio.indexOf(id); plAudio.splice(index, 1); plAudio = plAudio.join(","); await commonModel.insertOrUpdate( "playlist", { items: plAudio }, "where type='audio' AND id=?", [plData.id] ); } }; exports.getAudios = async (id) => { let results = await runMySqlQuery( // ` SELECT audio.*,playlist.id as pid,playlist.title as playlist_title FROM audio left join playlist on FIND_IN_SET(audio.id,playlist.items) where audio.id=1; // `, `SELECT audio.*,(SELECT CONCAT("[", GROUP_CONCAT( CONCAT('{"title":"',title,'"'), CONCAT(',"title_hi":"',title_hi,'"'), CONCAT(',"id":"',id,'"}') ) ,"]") FROM playlist where type='audio' AND FIND_IN_SET(audio.id,playlist.items)) as playlist FROM audio ` ); return results; };
Copyright © 2025 - UnknownSec