Skip to content

Commit

Permalink
Allow user-defined thumb csv path
Browse files Browse the repository at this point in the history
  • Loading branch information
jvlflame committed Sep 1, 2020
1 parent b6d16ee commit 42467f2
Show file tree
Hide file tree
Showing 4 changed files with 103 additions and 232 deletions.
11 changes: 7 additions & 4 deletions src/Javinizer/Public/Get-JVAggregatedData.ps1
Expand Up @@ -79,12 +79,16 @@ function Get-JVAggregatedData {
[Alias('sort.metadata.thumbcsv')]
[Boolean]$ThumbCsv,

[Parameter(ValueFromPipelineByPropertyName = $true, ParameterSetName = 'Setting')]
[Alias('sort.metadata.thumbcsv.path')]
[Boolean]$ThumbCsvPath = (Join-Path -Path ((Get-Item $PSScriptRoot).Parent) -ChildPath 'jvThumbs.csv'),

[Parameter(ValueFromPipelineByPropertyName = $true, ParameterSetName = 'Setting')]
[Alias('sort.metadata.thumbcsv.convertalias')]
[Boolean]$ThumbCsvAlias,

[Parameter(ValueFromPipelineByPropertyName = $true, ParameterSetName = 'Setting')]
[Alias('sort.metadata.genre.replace')]
[Alias('sort.metadata.genrecsv')]
[Boolean]$ReplaceGenre,

[Parameter(ValueFromPipelineByPropertyName = $true, ParameterSetName = 'Setting')]
Expand Down Expand Up @@ -124,7 +128,7 @@ function Get-JVAggregatedData {
$DisplayNameFormat = $Settings.'sort.metadata.nfo.displayname'
$ThumbCsv = $Settings.'sort.metadata.thumbcsv'
$ThumbCsvAlias = $Settings.'sort.metadata.thumbcsv.convertalias'
$ReplaceGenre = $Settings.'sort.metadata.genre.replace'
$ReplaceGenre = $Settings.'sort.metadata.genrecsv'
$IgnoreGenre = $Settings.'sort.metadata.genre.ignore'
$Translate = $Settings.'sort.metadata.nfo.translate'
$TranslateLanguage = $Settings.'sort.metadata.nfo.translate.language'
Expand Down Expand Up @@ -187,8 +191,7 @@ function Get-JVAggregatedData {
$aggregatedDataObject.DisplayName = Convert-JVString -Data $aggregatedDataObject -FormatString $DisplayNameFormat

if ($ThumbCsv) {
$thumbCsvPath = Join-Path -Path ((Get-Item $PSScriptRoot).Parent) -ChildPath 'jvThumbs.csv'
if (Test-Path -LiteralPath $thumbCsvPath) {
if (Test-Path -LiteralPath $ThumbCsvPath) {
try {
$actressCsv = Import-Csv -LiteralPath $thumbCsvPath
} catch {
Expand Down

0 comments on commit 42467f2

Please sign in to comment.