mirror of
https://github.com/gabehf/Tdarr_Plugins.git
synced 2026-03-16 10:45:53 -07:00
Add/update encodeURIComponent to allow for successful path uri encoding (#248)
* Add/update encodeURIComponent to allow for successful path uri encoding * Breakup line to meet 120 char limit enforced by the tests * concat string Co-authored-by: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com>
This commit is contained in:
parent
bf37a65a17
commit
7ffcd4d4f7
2 changed files with 3 additions and 2 deletions
|
|
@ -93,7 +93,7 @@ const plugin = (file, librarySettings, inputs, otherArguments) => {
|
||||||
let filepath = '';
|
let filepath = '';
|
||||||
const response = {};
|
const response = {};
|
||||||
filepath = `${file.file.split('/').slice(0, -1).join('/')}/`;
|
filepath = `${file.file.split('/').slice(0, -1).join('/')}/`;
|
||||||
filepath = encodeURI(filepath);
|
filepath = encodeURIComponent(filepath);
|
||||||
|
|
||||||
// Check if all inputs have been configured. If they haven't then exit plugin.
|
// Check if all inputs have been configured. If they haven't then exit plugin.
|
||||||
if (
|
if (
|
||||||
|
|
|
||||||
|
|
@ -186,7 +186,8 @@ const plugin = async (file, librarySettings, inputs, otherArguments) => {
|
||||||
response.infoLog += `Attempting to update Plex path ${filePath} in library ${key}\n`;
|
response.infoLog += `Attempting to update Plex path ${filePath} in library ${key}\n`;
|
||||||
|
|
||||||
const portIfUsed = port ? `:${port}` : '';
|
const portIfUsed = port ? `:${port}` : '';
|
||||||
const urlNoToken = `${type}://${url}${portIfUsed}/library/sections/${key}/refresh?path=${filePath}&X-Plex-Token=`;
|
const urlNoToken = `${type}://${url}${portIfUsed}/library/sections/${key}/refresh?`
|
||||||
|
+ `path=${encodeURIComponent(filePath)}&X-Plex-Token=`;
|
||||||
|
|
||||||
if (type === 'http') {
|
if (type === 'http') {
|
||||||
await new Promise((resolve) => {
|
await new Promise((resolve) => {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue