'use strict'; const conf = require('>/conf'); // Ask Emby to (re)scan its libraries so a newly filed item gets indexed. async function refresh(){ let res = await fetch(`${conf.emby.url}/Library/Refresh?api_key=${conf.emby.apiKey}`, { method: 'POST', }); if(!res.ok){ let error = new Error('EmbyError'); error.message = `Emby library refresh failed( ${res.status})`; error.status = 502; throw error; } return true; } module.exports = { refresh };