Skip to content

Commit

Permalink
Fix writing thumbs
Browse files Browse the repository at this point in the history
  • Loading branch information
jvlflame committed Dec 16, 2019
1 parent d0e9906 commit 0dcf573
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 31 deletions.
7 changes: 6 additions & 1 deletion .github/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## [1.1.1]

## [1.1.2] - 12-15-2019
### Fixed
- Additional issues to writing missing actresses to `r18-thumbs.csv`

## [1.1.1] - 12-15-2019
### Fixed
- Videos with 2+ actresses not writing to `r18-thumbs.csv` if missing

Expand Down
2 changes: 1 addition & 1 deletion src/Javinizer/Javinizer.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
RootModule = 'Javinizer.psm1'

# Version number of this module.
ModuleVersion = '1.1.1'
ModuleVersion = '1.1.2'

# Supported PSEditions
# CompatiblePSEditions = @()
Expand Down
26 changes: 1 addition & 25 deletions src/Javinizer/Private/Get-MetadataNfo.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -145,26 +145,6 @@ function Get-MetadataNfo {
"@
} else {
for ($i = 0; $i -lt $DataObject.Actress.Count; $i++) {
if (-not ($R18ThumbCsv.FullName -like $DataObject.Actress[$i])) {
if (-not (($DataObject.ActressThumbUrl[$i] -like '*nowprinting*') -or ($null -eq $DataObject.ActressThumbUrl[$i]))) {
$actressFirstName, $actressLastName = $DataObject.Actress[$i] -split ' '
$actressFullName = $actressFirstName + ' ' + $actressLastName
$actressFullNameReversed = $actressLastName + ' ' + $actressFirstName

$actressObject = [pscustomobject]@{
FirstName = $actressFirstName.Trim()
LastName = $actressLastName.Trim()
FullName = $actressFullName.Trim()
FullNameReversed = $actressFullNameReversed.Trim()
ThumbUrl = $DataObject.ActressThumbUrl[$i]
Alias = ''
}

$actressObject | Export-Csv -LiteralPath $r18CsvPath -Append -NoTypeInformation
Write-Verbose "[$($MyInvocation.MyCommand.Name)] Actress [$($DataObject.Actress[$i])] written to [$r18CsvPath]"
}
}

if ($null -eq $DataObject.ActressThumbUrl) {
# Create empty array amounting to number of actresses found if scraped from javlibrary
# This will allow matching actresses from r18 thumb csv
Expand All @@ -174,11 +154,10 @@ function Get-MetadataNfo {
}
} else {
if (-not ($R18ThumbCsv.FullName -like $DataObject.Actress[$i])) {
if (-not (($DataObject.ActressThumbUrl[$i] -like '*nowprinting*') -or ($null -eq $DataObject.ActressThumbUrl[$i]))) {
if (-not (($DataObject.ActressThumbUrl[$i] -like '*nowprinting*') -or ($null -eq $DataObject.ActressThumbUrl[$i]) -or ($DataObject.ActressThumbUrl[$i] -eq ''))) {
$actressFirstName, $actressLastName = $DataObject.Actress[$i] -split ' '
$actressFullName = $actressFirstName + ' ' + $actressLastName
$actressFullNameReversed = $actressLastName + ' ' + $actressFirstName

$actressObject = [pscustomobject]@{
FirstName = $actressFirstName.Trim()
LastName = $actressLastName.Trim()
Expand Down Expand Up @@ -221,8 +200,6 @@ function Get-MetadataNfo {
"@
}


}
}

Expand All @@ -239,7 +216,6 @@ function Get-MetadataNfo {
}



<#
if match actress + ActressThumbUrl
Expand Down
4 changes: 2 additions & 2 deletions src/Javinizer/Private/Set-JavMovie.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ function Set-JavMovie {
if ($Settings.General.'move-to-folder' -eq 'True') {
$fixedDestinationPath = $DestinationPath.replace('[', '`[').replace(']', '`]')
New-Item -ItemType Directory -Name $dataObject.FolderName -Path $fixedDestinationPath -Force:$Force -ErrorAction 'SilentlyContinue' | Out-Null
Get-MetadataNfo -DataObject $dataObject -Settings $Settings -R18ThumbCsv $r18ThumbCsv -ErrorAction SilentlyContinue | Out-File -LiteralPath $fixednfoPath -Force:$Force -ErrorAction Stop
Get-MetadataNfo -DataObject $dataObject -Settings $Settings -R18ThumbCsv $r18ThumbCsv | Out-File -LiteralPath $fixednfoPath -Force:$Force -ErrorAction Stop
Rename-Item -LiteralPath $Path -NewName $newFileName -PassThru -Force:$Force -ErrorAction Stop | Move-Item -Destination $folderPath -Force:$Force -ErrorAction Stop
} else {
Rename-Item -LiteralPath $Path -NewName $newFileName -PassThru -Force:$Force -ErrorAction Stop | Out-Null
Get-MetadataNfo -DataObject $dataObject -Settings $Settings -R18ThumbCsv $r18ThumbCsv -ErrorAction SilentltyContinue | Out-File -LiteralPath $fixedNfoPath -Force:$Force -ErrorAction Stop
Get-MetadataNfo -DataObject $dataObject -Settings $Settings -R18ThumbCsv $r18ThumbCsv | Out-File -LiteralPath $fixedNfoPath -Force:$Force -ErrorAction Stop
}

if ($Settings.Metadata.'download-thumb-img' -eq 'True') {
Expand Down
4 changes: 3 additions & 1 deletion src/Javinizer/r18-thumbs.csv
Original file line number Diff line number Diff line change
Expand Up @@ -9630,7 +9630,6 @@ Kurumi,Asano,Kurumi Asano,Asano Kurumi,https://pics.r18.com/mono/actjpgs/asano_k
Momo,Aida,Momo Aida,Aida Momo,https://pics.r18.com/mono/actjpgs/aida_momo.jpg,,,,
Yuri,&amp,Yuri &amp,&amp Yuri,https://pics.r18.com/mono/actjpgs/yuri&mari.jpg,,,,
Kana,&amp,Kana &amp,&amp Kana,https://pics.r18.com/mono/actjpgs/kana&nana.jpg,,,,
Hikaru,Minazuki,Hikaru Minazuki,Minazuki Hikaru,https://pics.r18.com/mono/actjpgs/minazuki_hikaru.jpg,,,,
Sora,Aoi,Sora Aoi,Aoi Sora,http://pics.r18.com/mono/actjpgs/aoi_sora.jpg,,,,
Nao,Ayukawa,Nao Ayukawa,Ayukawa Nao,http://pics.r18.com/mono/actjpgs/ayukawa_nao.jpg,,,,
Hitomi,Fujiwara,Hitomi Fujiwara,Fujiwara Hitomi,http://pics.r18.com/mono/actjpgs/huziwara_hitomi2.jpg,,,,
Expand Down Expand Up @@ -9744,3 +9743,6 @@ Shiho,Fujie,Shiho Fujie,Fujie Shiho,https://pics.r18.com/mono/actjpgs/huzie_siho
Towa,Aokaze,Towa Aokaze,Aokaze Towa,https://pics.r18.com/mono/actjpgs/aokaze_towa.jpg,,,,
Arisu,Toyonaka,Arisu Toyonaka,Toyonaka Arisu,https://pics.r18.com/mono/actjpgs/toyonaka_arisu.jpg,,,,
Kana,Mito,Kana Mito,Mito Kana,https://pics.r18.com/mono/actjpgs/mito_kana.jpg,,,,
"Hikaru","Minazuki","Hikaru Minazuki","Minazuki Hikaru","https://pics.r18.com/mono/actjpgs/minazuki_hikaru.jpg",""
"Ko","Asumi","Ko Asumi","Asumi Ko","https://pics.r18.com/mono/actjpgs/koizumi_mari.jpg",""
"Kokoro","Hirahara","Kokoro Hirahara","Hirahara Kokoro","https://pics.r18.com/mono/actjpgs/hirahara_kokoro.jpg",""
2 changes: 1 addition & 1 deletion src/Javinizer/settings.ini
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ multi-sort-throttle-limit=3
# <ID> <TITLE> <STUDIO> <YEAR> <RELEASEDATE> <RUNTIME>
move-to-folder=True
rename-file-string="<ID>"
rename-folder-string="[<ID>] <STUDIO> - <TITLE> (<YEAR>)"
rename-folder-string="<ID> [<STUDIO>] - <TITLE> (<YEAR>)"
cms-displayname-string="[<ID>] <TITLE>"
# I recommend keeping this at a maximum of 200 due to OS path-length limitations
# You may need to adjust this lower depending on how deeply nested your directory is
Expand Down

0 comments on commit 0dcf573

Please sign in to comment.