Skip to content

Commit

Permalink
Remove set-owned from default workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
jvlflame committed Jul 21, 2020
1 parent 5786743 commit 47749e9
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 56 deletions.
12 changes: 0 additions & 12 deletions src/Javinizer/Private/Set-JavMovie.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -211,18 +211,6 @@ function Set-JavMovie {
Write-Log -Log $javinizerLogPath -Level ERROR -OriginalFile $DataObject.OriginalFileName -Text "Skipped: [$($DataObject.OriginalFileName)] Error downloading trailer video $($PSItem.ToString())"
throw $_
}

try {
if ($Settings.JavLibrary.'set-owned' -eq 'True') {
if (!($javlibraryOwnedMovies -match $DataObject.Id)) {
Set-JavlibraryOwned -AjaxId $DataObject.AjaxId -JavlibraryUrl $DataObject.JavlibraryUrl -Settings $Settings
}
}
} catch {
Write-Warning "[$(Get-TimeStamp)][$($MyInvocation.MyCommand.Name)] Error downloading trailer video"
Write-Log -Log $javinizerLogPath -Level ERROR -OriginalFile $DataObject.OriginalFileName -Text "Skipped: [$($DataObject.OriginalFileName)] Error setting owned status on JavLibrary $($PSItem.ToString())"
throw $_
}
}
}

Expand Down
45 changes: 1 addition & 44 deletions src/Javinizer/Public/Javinizer.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -692,46 +692,6 @@ function Javinizer {
}
}

try {
if ($Settings.JavLibrary.'set-owned' -eq 'True') {
Write-Debug "[$(Get-TimeStamp)][$($MyInvocation.MyCommand.Name)] Getting owned movies on JAVLibrary"
if (!($global:javlibraryOwnedMovies)) {
$request = Invoke-WebRequest -Uri "https://www.javlibrary.com/en/mv_owned_print.php" -Verbose:$false -Headers @{
"method" = "GET"
"authority" = "www.javlibrary.com"
"scheme" = "https"
"path" = "/en/mv_owned_print.php"
"upgrade-insecure-requests" = "1"
"user-agent" = $session.UserAgent
"accept" = "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9"
"sec-fetch-site" = "none"
"sec-fetch-mode" = "navigate"
"sec-fetch-user" = "?1"
"sec-fetch-dest" = "document"
"accept-encoding" = "gzip, deflate, br"
"accept-language" = "en-US,en;q=0.9"
"cookie" = "__cfduid=$SessionCFDUID; timezone=420; over18=18; userid=$($Settings.JavLibrary.username); session=$($Settings.JavLibrary.'session-cookie')"
}

$javlibraryOwnedMovies = ($request.content -split '<td class="title">' | ForEach-Object { (($_ -split '<\/td>')[0] -split ' ')[0] })
$global:javlibraryOwnedMovies = $javlibraryOwnedMovies[2..($javlibraryOwnedMovies.Length - 1)]
}
} else {
$global:javlibraryOwnedMovies = $null
}
} catch {
Write-Error "[$(Get-TimeStamp)][$($MyInvocation.MyCommand.Name)] Error getting existing owned movies on JAVLibrary: $PSItem"
}

if ($null -ne $global:javlibraryOwnedMovies) {
if ($global:javlibraryOwnedMovies.Count -gt 1) {
if ($javlibraryOwnedMovies[0].Length -le 1) {
Write-Error "[$(Get-TimeStamp)][$($MyInvocation.MyCommand.Name)] Error authenticating to JAVLibrary to set owned movies, check that your username and session-cookie are valid"
return
}
}
}

#Write-Debug "[$(Get-TimeStamp)][$($MyInvocation.MyCommand.Name)] Converted file details: [$($fileDetails)]"

# Match a single file and perform actions on it
Expand Down Expand Up @@ -761,7 +721,7 @@ function Javinizer {
if ($Multi.IsPresent) {
$throttleCount = $Settings.General.'multi-sort-throttle-limit'
try {
if ($Javlibrary -or $Settings.JavLibrary.'set-owned' -eq 'True') {
if ($Javlibrary) {
if ($null -eq $session) {
New-CloudflareSession -ScriptRoot $ScriptRoot
}
Expand Down Expand Up @@ -810,9 +770,6 @@ function Javinizer {

$Settings = $using:Settings

if ($Settings.JavLibrary.'set-owned' -eq 'True') {
$global:javlibraryOwnedMovies = $using:javlibraryOwnedMovies
}
Javinizer -Path $using:filePath -DestinationPath:($using:DestinationPath) -ScriptRoot $using:ScriptRoot -Strict:($using:Strict) -MoveToFolder:($using:movePreference) -RenameFile:($using:renamePreference) -Force:($using:Force)
} | Out-Null
}
Expand Down

0 comments on commit 47749e9

Please sign in to comment.