/* eslint-disable import/prefer-default-export */ import { Client as Discogs } from "disconnect"; import { discogsToken } from "../config"; export const getBaseUrl = (req) => `${req.protocol}://${req.get("host")}`; export const searchSong = async (q) => { const dis = new Discogs({ userToken: discogsToken }).database(); const res = await dis.search({ q, type: "release", }); return res; }; export const getAlbumDetails = async (id) => { const dis = new Discogs({ userToken: discogsToken }).database(); const res = await dis.getRelease(id); return res; };