diff --git a/package-lock.json b/package-lock.json index 3e97c08..d1ceab8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -34,9 +34,9 @@ "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" }, "uuid": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-7.0.2.tgz", - "integrity": "sha512-vy9V/+pKG+5ZTYKf+VcphF5Oc6EFiu3W8Nv3P3zIh0EqVI80ZxOzuPfe9EHjkFNvf8+xuTHVeei4Drydlx4zjw==" + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-7.0.3.tgz", + "integrity": "sha512-DPSke0pXhTZgoF/d+WSt2QaKMCFSfx7QegxEWT+JOuHF5aWrKEn0G+ztjuJg/gG8/ItK+rbPCD/yNv8yyih6Cg==" } } } diff --git a/package.json b/package.json index 4812e01..63fc5c9 100644 --- a/package.json +++ b/package.json @@ -30,6 +30,6 @@ "homepage": "https://github.com/Wifsimster/pavie#readme", "dependencies": { "axios": "^0.19.2", - "uuid": "^7.0.2" + "uuid": "^7.0.3" } } diff --git a/test/history.js b/test/history.js index 91a89db..f576e00 100644 --- a/test/history.js +++ b/test/history.js @@ -4,12 +4,18 @@ const Pavie = require("../pavie") const pavie = new Pavie(settings) -pavie - .signin() - .then(async () => { - const response = await pavie.getHistory() +main() + +async function main() { + await pavie + .signin() + .catch(err => { console.error(err) }) + + const response = await pavie + .getHistory() + .catch(err => { console.error(err) }) + + if(response) { console.log(response) - }) - .catch(err => { - console.error(err) - }) + } +} \ No newline at end of file diff --git a/test/image.js b/test/image.js index efd0a0b..b07b3d4 100644 --- a/test/image.js +++ b/test/image.js @@ -4,12 +4,19 @@ const Pavie = require("../pavie") const pavie = new Pavie(settings) -pavie - .signin() - .then(async () => { - const response = await pavie.getImage(`/library/metadata/25963/thumb/1557058611?X-Plex-Token=fPHNF2Wkg84qDPprCbqy`) +main() + +async function main() { + await pavie + .signin() + .catch(err => { console.error(err) }) + + const response = await pavie + .getImage(`/library/metadata/25963/thumb/1557058611?X-Plex-Token=fPHNF2Wkg84qDPprCbqy`) + .catch(err => { console.error(err) }) + + if(response) { console.log(response) - }) - .catch(err => { - console.error(err) - }) + } +} + diff --git a/test/playlists.js b/test/playlists.js index df4a25a..127a85e 100644 --- a/test/playlists.js +++ b/test/playlists.js @@ -4,25 +4,19 @@ const Pavie = require("../pavie") const pavie = new Pavie(settings) -// pavie -// .signin() -// .then(async () => { -// const response = await pavie.getPlaylists() -// console.log(response) -// }) -// .catch(err => { -// console.error(err) -// }) +main() -pavie - .signin() - .then(async () => { - const response = await pavie.addPlaylistFiles({ +async function main() { + await pavie + .signin() + .catch(err => { console.error(err) }) + + const response = await pavie + .addPlaylist({ uri: "server://2c59cf8256eccd8629081638e98e27bf8349c3e7/com.plexapp.plugins.library/library/metadata/8412", title: "lorem" }) - console.log(response) - }) - .catch(err => { - console.error(err) - }) + .catch(err => { console.error(err) }) + + console.log(response) +} \ No newline at end of file diff --git a/test/signin.js b/test/signin.js index 651a26b..9982d63 100644 --- a/test/signin.js +++ b/test/signin.js @@ -4,12 +4,16 @@ const Pavie = require("../pavie") const pavie = new Pavie(settings) -pavie - .signin() - .then(async () => { - const response = await pavie.getActions() - console.log(response) - }) - .catch(err => { - console.error(err) - }) +main() + +async function main() { + await pavie + .signin() + .catch(err => { console.error(err) }) + + const response = await pavie + .getActions() + .catch(err => { console.error(err) }) + + console.log(response) +} \ No newline at end of file