Move song art cache
This commit is contained in:
parent
1ec8577d63
commit
2af984d395
@ -2,12 +2,7 @@ import fs from "fs";
|
|||||||
import fetch from "node-fetch";
|
import fetch from "node-fetch";
|
||||||
import path from "path";
|
import path from "path";
|
||||||
import sharp from "sharp";
|
import sharp from "sharp";
|
||||||
|
import cacheDir from "../../../../src/caches/SongArtCacheDir";
|
||||||
const cacheDir = process.cwd() + path.sep + "cache";
|
|
||||||
if (!fs.existsSync(cacheDir)) {
|
|
||||||
fs.mkdirSync(cacheDir);
|
|
||||||
console.log("Created cache directory");
|
|
||||||
}
|
|
||||||
|
|
||||||
export default async function handler(req, res) {
|
export default async function handler(req, res) {
|
||||||
const mapHash = req.query.hash.replace("custom_level_", "").toLowerCase();
|
const mapHash = req.query.hash.replace("custom_level_", "").toLowerCase();
|
||||||
|
7
src/caches/SongArtCacheDir.js
Normal file
7
src/caches/SongArtCacheDir.js
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
const cacheDir = process.cwd() + path.sep + "cache";
|
||||||
|
if (!fs.existsSync(cacheDir)) {
|
||||||
|
fs.mkdirSync(cacheDir);
|
||||||
|
console.log("Created art cache directory");
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = cacheDir;
|
Reference in New Issue
Block a user