From 478e23d0ee6350eec7abe43c57d316a60a53348e Mon Sep 17 00:00:00 2001 From: jvlflame Date: Wed, 12 Aug 2020 01:45:12 -0700 Subject: [PATCH] Add initial data/aggregated functions --- .../Public/Get-JavAggregatedData.ps1 | 55 ++++++++++++ src/Javinizer/Public/Get-JavData.ps1 | 83 +++++++++++++++++++ 2 files changed, 138 insertions(+) create mode 100644 src/Javinizer/Public/Get-JavAggregatedData.ps1 create mode 100644 src/Javinizer/Public/Get-JavData.ps1 diff --git a/src/Javinizer/Public/Get-JavAggregatedData.ps1 b/src/Javinizer/Public/Get-JavAggregatedData.ps1 new file mode 100644 index 00000000..ad696076 --- /dev/null +++ b/src/Javinizer/Public/Get-JavAggregatedData.ps1 @@ -0,0 +1,55 @@ +function Get-JavAggregatedData { + [CmdletBinding()] + param ( + [Parameter(ValueFromPipelineByPropertyName = $true)] + [Alias('sort.metadata.priority.actress')] + [Array]$ActressPriority, + [Parameter(ValueFromPipelineByPropertyName = $true)] + [Alias('sort.metadata.priority.alternatetitle')] + [Array]$AlternateTitlePriority, + [Parameter(ValueFromPipelineByPropertyName = $true)] + [Alias('sort.metadata.priority.coverurl')] + [Array]$CoverUrlPriority, + [Parameter(ValueFromPipelineByPropertyName = $true)] + [Alias('sort.metadata.priority.description')] + [Array]$DescriptionPriority, + [Parameter(ValueFromPipelineByPropertyName = $true)] + [Alias('sort.metadata.priority.director')] + [Array]$DirectorPriority, + [Parameter(ValueFromPipelineByPropertyName = $true)] + [Alias('sort.metadata.priority.genre')] + [Array]$GenrePriority, + [Parameter(ValueFromPipelineByPropertyName = $true)] + [Alias('sort.metadata.priority.id')] + [Array]$IdPriority, + [Parameter(ValueFromPipelineByPropertyName = $true)] + [Alias('sort.metadata.priority.label')] + [Array]$LabelPriority, + [Parameter(ValueFromPipelineByPropertyName = $true)] + [Alias('sort.metadata.priority.maker')] + [Array]$MakerPriority, + [Parameter(ValueFromPipelineByPropertyName = $true)] + [Alias('sort.metadata.priority.releasedate')] + [Array]$ReleaseDatePriority, + [Parameter(ValueFromPipelineByPropertyName = $true)] + [Alias('sort.metadata.priority.runtime')] + [Array]$RuntimePriority, + [Parameter(ValueFromPipelineByPropertyName = $true)] + [Alias('sort.metadata.priority.series')] + [Array]$SeriesPriority, + [Parameter(ValueFromPipelineByPropertyName = $true)] + [Alias('sort.metadata.priority.screenshoturl')] + [Array]$ScreenshotUrlPriority, + [Parameter(ValueFromPipelineByPropertyName = $true)] + [Alias('sort.metadata.priority.title')] + [Array]$TitlePriority, + [Parameter(ValueFromPipelineByPropertyName = $true)] + [Alias('sort.metadata.priority.trailerurl')] + [Array]$TrailerUrlPriority + ) + + process { + Write-Host $ActressPriority + Write-Host $LabelPriority + } +} diff --git a/src/Javinizer/Public/Get-JavData.ps1 b/src/Javinizer/Public/Get-JavData.ps1 new file mode 100644 index 00000000..2cf3e144 --- /dev/null +++ b/src/Javinizer/Public/Get-JavData.ps1 @@ -0,0 +1,83 @@ +function Get-JavData { + [CmdletBinding()] + param ( + [Parameter(Mandatory = $true, Position = 0)] + [String]$Id, + [Parameter(ValueFromPipelineByPropertyName = $true)] + [Boolean]$R18, + [Parameter(ValueFromPipelineByPropertyName = $true)] + [Boolean]$R18Zh, + [Parameter(ValueFromPipelineByPropertyName = $true)] + [Boolean]$Javlibrary, + [Parameter(ValueFromPipelineByPropertyName = $true)] + [Boolean]$JavlibraryJa, + [Parameter(ValueFromPipelineByPropertyName = $true)] + [Boolean]$JavlibraryZh, + [Parameter(ValueFromPipelineByPropertyName = $true)] + [Boolean]$Dmm, + [Parameter(ValueFromPipelineByPropertyName = $true)] + [Boolean]$Javbus, + [Parameter(ValueFromPipelineByPropertyName = $true)] + [Boolean]$JavbusJa, + [Parameter(ValueFromPipelineByPropertyName = $true)] + [Boolean]$JavbusZh, + [Parameter(ValueFromPipelineByPropertyName = $true)] + [Boolean]$Jav321 + ) + + process { + $javinizerDataObject = @() + + if ($R18) { + Write-JLog -Level Info -Message "Searching [R18] for Id: [$Id]" + $javinizerDataObject += Get-R18Url -Id $Id -Language en | Get-R18Data + } + + if ($R18Zh) { + Write-JLog -Level Info -Message "Searching [R18Zh] for Id: [$Id]" + $javinizerDataObject += Get-R18Url -Id $Id -Language zh | Get-R18Data + } + + if ($Javlibrary) { + Write-JLog -Level Info -Message "Searching [Javlibrary] for Id: [$Id]" + $javinizerDataObject += Get-JavlibraryUrl -Id $Id -Language en | Get-JavlibraryData + } + + if ($JavlibraryJa) { + Write-JLog -Level Info -Message "Searching [JavlibraryJa] for Id: [$Id]" + $javinizerDataObject += Get-JavlibraryUrl -Id $Id -Language ja | Get-JavlibraryData + } + + if ($JavlibraryZh) { + Write-JLog -Level Info -Message "Searching [JavlibraryZh] for Id: [$Id]" + $javinizerDataObject += Get-JavlibraryUrl -Id $Id -Language zh | Get-JavlibraryData + } + + if ($Dmm) { + Write-JLog -Level Info -Message "Searching [Dmm] for Id: [$Id]" + $javinizerDataObject += Get-DmmUrl -Id $Id | Get-DmmData + } + + if ($Javbus) { + Write-JLog -Level Info -Message "Searching [Javbus] for Id: [$Id]" + $javbusDataObject += Get-JavbusUrl -Id $Id -Language en | Get-JavbusData + } + + if ($JavbusJa) { + Write-JLog -Level Info -Message "Searching [JavbusJa] for Id: [$Id]" + $javbusDataObject += Get-JavbusUrl -Id $Id -Language ja | Get-JavbusData + } + + if ($JavbusZh) { + Write-JLog -Level Info -Message "Searching [JavbusZh] for Id: [$Id]" + $javbusDataObject += Get-JavbusUrl -Id $Id -Language zh | Get-JavbusData + } + + if ($Jav321) { + Write-JLog -Level Info -Message "Searching [Jav321] for Id: [$Id]" + $javbusDataObject += Get-Jav321Url -Id $Id | Get-Jav321Data + } + + Write-Output $javinizerDataObject + } +}