Skip to content

Commit

Permalink
Add timeout interval on JAVLibrary set-owned
Browse files Browse the repository at this point in the history
Adding a user-defined timeout interval between
setting owned movies on JAVLibrary is required due to erroring out
when setting too quickly
  • Loading branch information
jvlflame committed Jul 21, 2020
1 parent 47749e9 commit c000254
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -439,6 +439,7 @@ server-api-key | String value | The API key for your Emby/Jellyfin server instan
set-owned | True/False | Sets sorted movies as "Owned" on JAVLibrary, requires a JAVLibrary account
username | String value | Your JAVLibrary username
session-cookie | String value | After logging in, view the cookies under the `www.javlibrary.com/cookies/session` directory and copy the cookie content
request-timeout-interval-sec | Interger value (0+) | Sets the timeout value in seconds on how long Javinizer will wait between setting a movie as owned on JAVLibrary. This is required due to JAVLibrary erroring when setting movies as owned too quickly
request-timeout-sec | Integer value (0+) | Sets the timeout value in seconds on how long Javinizer will continue polling Javinizer to set the owned status (polls every 3 seconds)
log-path | String value (Path) | Sets the path to your log file; If left blank, it will default to a location within your module folder
check-updates | True/False | Checks for updates to the Javinizer module upon your first console session runtime
Expand Down
3 changes: 2 additions & 1 deletion src/Javinizer/Private/Validate-Settings.ps1
Expand Up @@ -56,7 +56,8 @@ function Test-Settings {
'minimum-filesize-to-sort',
'regex-id-match',
'regex-pt-match',
'request-timeout-sec'
'request-timeout-sec',
'request-timeout-interval-sec'
)

$javlibrarySettings = @(
Expand Down
1 change: 1 addition & 0 deletions src/Javinizer/Public/Javinizer.ps1
Expand Up @@ -598,6 +598,7 @@ function Javinizer {
$ajaxId = $javlibObject.AjaxId
$url = $javlibObject.Url
Set-JavlibraryOwned -AjaxId $ajaxId -JavlibraryUrl $url -Settings $settings
Start-Sleep -Seconds $Settings.JavLibrary.'request-timeout-interval-sec'
} else {
Write-Warning "[$(Get-TimeStamp)][$($MyInvocation.MyCommand.Name)] Movie [$movie] not matched on JAVLibrary, skipping..."
}
Expand Down
1 change: 1 addition & 0 deletions src/Javinizer/settings.ini
Expand Up @@ -112,6 +112,7 @@ server-api-key=
set-owned=False
username=
session-cookie=
request-timeout-interval-sec=15
request-timeout-sec=90

[Other]
Expand Down

0 comments on commit c000254

Please sign in to comment.