Skip to content

Commit

Permalink
Update function names
Browse files Browse the repository at this point in the history
  • Loading branch information
jvlflame committed Aug 12, 2020
1 parent 564ce1a commit d7b4967
Show file tree
Hide file tree
Showing 6 changed files with 100 additions and 26 deletions.
2 changes: 1 addition & 1 deletion src/Javinizer/Public/Get-DmmData.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function Get-DmmDataObject {
function Get-DmmData {
[CmdletBinding()]
param (
[Parameter(Mandatory = $true, Position = 0, ValueFromPipeline = $true)]
Expand Down
44 changes: 22 additions & 22 deletions src/Javinizer/Public/Get-Jav321Data.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function Get-Jav321DataObject {
function Get-Jav321Data {
[CmdletBinding()]
param (
[Parameter(Mandatory = $true, Position = 0, ValueFromPipeline = $true)]
Expand All @@ -8,28 +8,28 @@ function Get-Jav321DataObject {
process {
$movieDataObject = @()

try {
Write-JLog -Level Debug -Message "Performing [GET] on URL [$Url]"
$webRequest = Invoke-RestMethod -Uri $Url -Verbose:$false
} catch {
Write-JLog -Level Error -Message "Error [GET] on URL [$Url]: $PSItem"
}
try {
Write-JLog -Level Debug -Message "Performing [GET] on URL [$Url]"
$webRequest = Invoke-RestMethod -Uri $Url -Verbose:$false
} catch {
Write-JLog -Level Error -Message "Error [GET] on URL [$Url]: $PSItem"
}

$movieDataObject = [pscustomobject]@{
Source = 'jav321'
Url = $Url
Id = Get-Jav321Id -WebRequest $webRequest
Title = Get-Jav321Title -WebRequest $webRequest
Date = Get-Jav321ReleaseDate -WebRequest $webRequest
Year = Get-Jav321ReleaseYear -WebRequest $webRequest
Runtime = Get-Jav321Runtime -WebRequest $webRequest
Maker = Get-Jav321Maker -WebRequest $webRequest
Actress = (Get-Jav321Actress -WebRequest $webRequest).Name
ActressThumbUrl = (Get-Jav321Actress -WebRequest $webRequest).ThumbUrl
Genre = Get-Jav321Genre -WebRequest $webRequest
CoverUrl = Get-Jav321CoverUrl -WebRequest $webRequest
ScreenshotUrl = Get-Jav321ScreenshotUrl -WebRequest $webRequest
}
$movieDataObject = [pscustomobject]@{
Source = 'jav321'
Url = $Url
Id = Get-Jav321Id -WebRequest $webRequest
Title = Get-Jav321Title -WebRequest $webRequest
Date = Get-Jav321ReleaseDate -WebRequest $webRequest
Year = Get-Jav321ReleaseYear -WebRequest $webRequest
Runtime = Get-Jav321Runtime -WebRequest $webRequest
Maker = Get-Jav321Maker -WebRequest $webRequest
Actress = (Get-Jav321Actress -WebRequest $webRequest).Name
ActressThumbUrl = (Get-Jav321Actress -WebRequest $webRequest).ThumbUrl
Genre = Get-Jav321Genre -WebRequest $webRequest
CoverUrl = Get-Jav321CoverUrl -WebRequest $webRequest
ScreenshotUrl = Get-Jav321ScreenshotUrl -WebRequest $webRequest
}

Write-JLog -Level Debug -Message "Jav321 data object: $($movieDataObject | ConvertTo-Json -Depth 32 -Compress)"
Write-Output $movieDataObject
Expand Down
2 changes: 1 addition & 1 deletion src/Javinizer/Public/Get-JavbusData.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function Get-JavbusDataObject {
function Get-JavbusData {
[CmdletBinding()]
param (
[Parameter(Mandatory = $true, Position = 0, ValueFromPipeline = $true)]
Expand Down
74 changes: 74 additions & 0 deletions src/Javinizer/Public/Get-JavinizerData.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
function Get-JavinizerData {
[CmdletBinding()]
param (
[Parameter(Mandatory = $true, ValueFromPipeline = $true)]
[String]$Id,
[Parameter()]
[Switch]$R18,
[Parameter()]
[Switch]$R18Zh,
[Parameter()]
[Switch]$Javlibrary,
[Parameter()]
[Switch]$JavlibraryJa,
[Parameter()]
[Switch]$JavlibraryZh,
[Parameter()]
[Switch]$Dmm,
[Parameter()]
[Switch]$Javbus,
[Parameter()]
[Switch]$JavbusJa,
[Parameter()]
[Switch]$JavbusZh,
[Parameter()]
[Switch]$Jav321
)

process {
$javinizerDataObject = @()

if ($R18) {
$javinizerDataObject += Get-R18Url -Id $Id -Language en | Get-R18Data
}

if ($R18Zh) {
$javinizerDataObject += Get-R18Url -Id $Id -Language zh | Get-R18Data
}

if ($Javlibrary) {
$javinizerDataObject += Get-JavlibraryUrl -Id $Id -Language en | Get-JavlibraryData
}

if ($JavlibraryJa) {
$javinizerDataObject += Get-JavlibraryUrl -Id $Id -Language ja | Get-JavlibraryData
}

if ($JavlibraryZh) {
$javinizerDataObject += Get-JavlibraryUrl -Id $Id -Language zh | Get-JavlibraryData
}

if ($Dmm) {
$javinizerDataObject += Get-DmmUrl -Id $Id | Get-DmmData
}

if ($Javbus) {
$javbusDataObject += Get-JavbusUrl -Id $Id -Language en | Get-JavbusData
}

if ($JavbusJa) {
$javbusDataObject += Get-JavbusUrl -Id $Id -Language ja | Get-JavbusData
}

if ($JavbusZh) {
$javbusDataObject += Get-JavbusUrl -Id $Id -Language zh | Get-JavbusData
}

if ($Jav321) {
$javbusDataObject += Get-Jav321Url -Id $Id | Get-Jav321Data
}

Write-Output $javinizerDataObject
}

}
2 changes: 1 addition & 1 deletion src/Javinizer/Public/Get-JavlibraryData.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function Get-JavlibraryDataObject {
function Get-JavlibraryData {
[CmdletBinding()]
param (
[Parameter(Mandatory = $true, Position = 0, ValueFromPipeline = $true)]
Expand Down
2 changes: 1 addition & 1 deletion src/Javinizer/Public/Get-R18Data.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function Get-R18DataObject {
function Get-R18Data {
[CmdletBinding()]
param (
[Parameter(Mandatory = $true, Position = 0, ValueFromPipeline = $true)]
Expand Down

0 comments on commit d7b4967

Please sign in to comment.