Skip to content

Commit

Permalink
Add initial data/aggregated functions
Browse files Browse the repository at this point in the history
  • Loading branch information
jvlflame committed Aug 12, 2020
1 parent e9c2c57 commit 478e23d
Show file tree
Hide file tree
Showing 2 changed files with 138 additions and 0 deletions.
55 changes: 55 additions & 0 deletions src/Javinizer/Public/Get-JavAggregatedData.ps1
Original file line number Diff line number Diff line change
@@ -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
}
}
83 changes: 83 additions & 0 deletions src/Javinizer/Public/Get-JavData.ps1
Original file line number Diff line number Diff line change
@@ -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
}
}

0 comments on commit 478e23d

Please sign in to comment.