mirror of
https://github.com/gabehf/Tdarr_Plugins.git
synced 2026-03-15 10:15:54 -07:00
Use original library file
This commit is contained in:
parent
107161ebfb
commit
f87bad2549
2 changed files with 17 additions and 14 deletions
|
|
@ -70,7 +70,8 @@ const plugin = async (args: IpluginInputArgs): Promise<IpluginOutputArgs> => {
|
|||
const { arr, arr_api_key } = args.inputs;
|
||||
const arr_host = String(args.inputs.arr_host).trim();
|
||||
|
||||
const { meta } = args.inputFileObj;
|
||||
const fileName = args.originalLibraryFile?.meta?.FileName || '';
|
||||
|
||||
const arrHost = arr_host.endsWith('/') ? arr_host.slice(0, -1) : arr_host;
|
||||
|
||||
const headers = {
|
||||
|
|
@ -86,7 +87,7 @@ const plugin = async (args: IpluginInputArgs): Promise<IpluginOutputArgs> => {
|
|||
|
||||
const requestConfig = {
|
||||
method: 'get',
|
||||
url: `${arrHost}/api/v3/parse?title=${encodeURIComponent(meta?.FileName || '')}`,
|
||||
url: `${arrHost}/api/v3/parse?title=${encodeURIComponent(fileName)}`,
|
||||
headers,
|
||||
};
|
||||
|
||||
|
|
@ -111,7 +112,7 @@ const plugin = async (args: IpluginInputArgs): Promise<IpluginOutputArgs> => {
|
|||
|
||||
const requestConfig = {
|
||||
method: 'get',
|
||||
url: `${arrHost}/api/v3/parse?title=${encodeURIComponent(meta?.FileName || '')}`,
|
||||
url: `${arrHost}/api/v3/parse?title=${encodeURIComponent(fileName)}`,
|
||||
headers,
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue