Refactor fsHelper

This commit is contained in:
Nikhil Nawgiri 2024-10-27 00:43:04 +02:00
parent 738cd98618
commit ca880154bf

View file

@ -1,6 +1,9 @@
import * as fs from "fs";
export const saveJsonToDisk = (content: {}) => {
const outputPath = `../database.json`;
fs.writeFileSync(outputPath, JSON.stringify(content));
}
const JELLYFIN_CONTENT_PATH = "../jellyfin_content.json";
const WISHLIST_PATH = "../wishlist.json";
const saveToDisk = (path: string, content: any) => fs.writeFileSync(path, JSON.stringify(content));
export const saveJfItemsToDisk = (content: {}) => saveToDisk(JELLYFIN_CONTENT_PATH, content);
export const saveWishlistToDisk = (content: {}) => saveToDisk(WISHLIST_PATH, content);