Skip to content

Commit

Permalink
Merge 1.1.8 fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jvlflame committed Dec 26, 2019
1 parent e60be11 commit 6a9240f
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 10 deletions.
5 changes: 5 additions & 0 deletions .github/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ 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.8]
### Fixed
- Fixed single-word actresses appending underscore `_` to filename when downloading actress images
- Director and Genre metadata fields being cut off by slash `/` in Plex, replaced text with `-`

## [1.1.7] 12-23-2019
### Changed
- Behavior when description translation fails to let original DMM description be written to nfo metadata
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.7'
ModuleVersion = '1.1.8'

# Supported PSEditions
# CompatiblePSEditions = @()
Expand Down
4 changes: 2 additions & 2 deletions src/Javinizer/Private/Get-MetadataNfo.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function Get-MetadataNfo {

$displayName = (($DataObject.DisplayName -replace '&', '&amp;') -replace '<', '(') -replace , '>', ')'
$alternateTitle = (($DataObject.AlternateTitle -replace '&', '&amp;') -replace '<', '(') -replace , '>', ')'
$director = (($DataObject.Director -replace '&', '&amp;') -replace '<', '(') -replace , '>', ')'
$director = ((($DataObject.Director -replace '&', '&amp;') -replace '<', '(') -replace , '>', ')') -replace '/', '-'
$maker = (($DataObject.Maker -replace '&', '&amp;') -replace '<', '(') -replace , '>', ''
$description = (($DataObject.Description -replace '&', '&amp;') -replace '<', '(') -replace , '>', ')'
$series = (($DataObject.Series -replace '&', '&amp;') -replace '<', '(') -replace , '>', ')'
Expand Down Expand Up @@ -90,7 +90,7 @@ function Get-MetadataNfo {
}

foreach ($genre in $DataObject.Genre) {
$genre = $genre -replace '&', '&amp;'
$genre = ($genre -replace '&', '&amp;') -replace '/', '-'
if ($Settings.Metadata.'normalize-genres' -eq 'True') {
if ($javlibraryGenres -like $genre) {
$index = $javlibraryGenres.IndexOf($genre)
Expand Down
30 changes: 23 additions & 7 deletions src/Javinizer/Private/Set-JavMovie.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -131,18 +131,34 @@ function Set-JavMovie {
if ($null -ne $dataObject.ActressThumbUrl) {
$fixFolderPath = $folderPath.replace('[', '`[').replace(']', '`]')
New-Item -ItemType Directory -Name '.actors' -Path $fixFolderPath -Force:$Force -ErrorAction SilentlyContinue | Out-Null
for ($i = 0; $i -lt $dataObject.ActressThumbUrl.Count; $i++) {
if ($dataObject.ActressThumbUrl.Count -eq 1) {
if ($dataObject.ActressThumbUrl[$i] -match 'https:\/\/pics\.r18\.com\/mono\/actjpgs\/.*\.jpg') {
$first, $second = $dataObject.Actress[$i] -split ' '
if ($null -ne $second -or $second -ne '') {
$actressFileName = $first + '_' + $second + '.jpg'
} else {
$first, $second = $dataObject.Actress -split ' '
if ($null -eq $second -or $second -eq '') {
$actressFileName = $first + '.jpg'
} else {
$actressFileName = $first + '_' + $second + '.jpg'
}
if ($Force.IsPresent) {
$webClient.DownloadFile($dataObject.ActressThumbUrl[$i], (Join-Path -Path $actorPath -ChildPath $actressFileName))
$webClient.DownloadFile($dataObject.ActressThumbUrl, (Join-Path -Path $actorPath -ChildPath $actressFileName))
} elseif (-not (Test-Path -LiteralPath (Join-Path -Path $actorPath -ChildPath $actressFileName))) {
$webClient.DownloadFile($dataObject.ActressThumbUrl[$i], (Join-Path -Path $actorPath -ChildPath $actressFileName))
$webClient.DownloadFile($dataObject.ActressThumbUrl, (Join-Path -Path $actorPath -ChildPath $actressFileName))
}
}
} else {
for ($i = 0; $i -lt $dataObject.ActressThumbUrl.Count; $i++) {
if ($dataObject.ActressThumbUrl[$i] -match 'https:\/\/pics\.r18\.com\/mono\/actjpgs\/.*\.jpg') {
$first, $second = $dataObject.Actress[$i] -split ' '
if ($null -eq $second -or $second -eq '') {
$actressFileName = $first + '.jpg'
} else {
$actressFileName = $first + '_' + $second + '.jpg'
}
if ($Force.IsPresent) {
$webClient.DownloadFile($dataObject.ActressThumbUrl[$i], (Join-Path -Path $actorPath -ChildPath $actressFileName))
} elseif (-not (Test-Path -LiteralPath (Join-Path -Path $actorPath -ChildPath $actressFileName))) {
$webClient.DownloadFile($dataObject.ActressThumbUrl[$i], (Join-Path -Path $actorPath -ChildPath $actressFileName))
}
}
}
}
Expand Down

0 comments on commit 6a9240f

Please sign in to comment.