Skip to content

Commit

Permalink
Remove hardcoded module import path
Browse files Browse the repository at this point in the history
  • Loading branch information
jvlflame committed Sep 1, 2020
1 parent 96f53a0 commit d1699b6
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions src/Javinizer/Public/Get-JVData.ps1
Expand Up @@ -66,82 +66,85 @@ function Get-JVData {
}

try {
# You need to change this path if you're running the script from outside of the Javinizer module folder
$jvModulePath = Join-Path -Path ((Get-Item $PSScriptRoot).Parent) -ChildPath 'Javinizer.psm1'

if ($R18) {
Write-JLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Searching R18"
Start-ThreadJob -Name "$Id-R18" -ScriptBlock {
Import-Module X:\git\Projects\JAV-Organizer\src\Javinizer\Javinizer.psm1
Import-Module $using:jvModulePath
Get-R18Url -Id $using:Id -Language en | Get-R18Data
} | Out-Null
}

if ($R18Zh) {
Write-JLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Searching R18Zh"
Start-ThreadJob -Name "$Id-R18Zh" -ScriptBlock {
Import-Module X:\git\Projects\JAV-Organizer\src\Javinizer\Javinizer.psm1
Import-Module $using:jvModulePath
Get-R18Url -Id $using:Id -Language zh | Get-R18Data
} | Out-Null
}

if ($Javlibrary) {
Write-JLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Searching Javlibrary"
Start-ThreadJob -Name "$Id-Javlibrary" -ScriptBlock {
Import-Module X:\git\Projects\JAV-Organizer\src\Javinizer\Javinizer.psm1
Import-Module $using:jvModulePath
Get-JavlibraryUrl -Id $using:Id -Language en | Get-JavlibraryData
} | Out-Null
}

if ($JavlibraryJa) {
Write-JLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Searching JavlibraryJa"
Start-ThreadJob -Name "$Id-JavlibraryJa" -ScriptBlock {
Import-Module X:\git\Projects\JAV-Organizer\src\Javinizer\Javinizer.psm1
Import-Module $using:jvModulePath
Get-JavlibraryUrl -Id $using:Id -Language ja | Get-JavlibraryData
} | Out-Null
}

if ($JavlibraryZh) {
Write-JLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Searching JavlibraryZh"
Start-ThreadJob -Name "$Id-JavlibraryZh" -ScriptBlock {
Import-Module X:\git\Projects\JAV-Organizer\src\Javinizer\Javinizer.psm1
Import-Module $using:jvModulePath
Get-JavlibraryUrl -Id $using:Id -Language zh | Get-JavlibraryData
} | Out-Null
}

if ($Dmm) {
Write-JLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Searching Dmm"
Start-ThreadJob -Name "$Id-Dmm" -ScriptBlock {
Import-Module X:\git\Projects\JAV-Organizer\src\Javinizer\Javinizer.psm1
Import-Module $using:jvModulePath
Get-DmmUrl -Id $using:Id | Get-DmmData
} | Out-Null
}

if ($Javbus) {
Write-JLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Searching Javbus"
Start-ThreadJob -Name "$Id-Javbus" -ScriptBlock {
Import-Module X:\git\Projects\JAV-Organizer\src\Javinizer\Javinizer.psm1
Import-Module $using:jvModulePath
Get-JavbusUrl -Id $using:Id -Language en | Get-JavbusData
} | Out-Null
}

if ($JavbusJa) {
Write-JLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Searching JavbusJa"
Start-ThreadJob -Name "$Id-JavbusJa" -ScriptBlock {
Import-Module X:\git\Projects\JAV-Organizer\src\Javinizer\Javinizer.psm1
Import-Module $using:jvModulePath
Get-JavbusUrl -Id $using:Id -Language ja | Get-JavbusData
} | Out-Null
}

if ($JavbusZh) {
Write-JLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Searching JavbusZh"
Start-ThreadJob -Name "$Id-JavbusZh" -ScriptBlock {
Import-Module X:\git\Projects\JAV-Organizer\src\Javinizer\Javinizer.psm1
Import-Module $using:jvModulePath
Get-JavbusUrl -Id $using:Id -Language zh | Get-JavbusData
} | Out-Null
}

if ($Jav321) {
Write-JLog -Level Debug -Message "[$Id] [$($MyInvocation.MyCommand.Name)] Searching Jav321"
Start-ThreadJob -Name "$Id-Jav321" -ScriptBlock {
Import-Module X:\git\Projects\JAV-Organizer\src\Javinizer\Javinizer.psm1
Import-Module $using:jvModulePath
Get-Jav321Url -Id $using:Id | Get-Jav321Data
} | Out-Null
}
Expand Down

0 comments on commit d1699b6

Please sign in to comment.