Skip to content

Commit

Permalink
Merge 446afd8 into f700338
Browse files Browse the repository at this point in the history
  • Loading branch information
jvlflame authored Sep 3, 2020
2 parents f700338 + 446afd8 commit af7905d
Show file tree
Hide file tree
Showing 76 changed files with 15,598 additions and 25,625 deletions.
57 changes: 56 additions & 1 deletion .github/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,62 @@ 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/).

## [2.0.0-alpha3]
### Added
- Javinizer now runs multi-threaded by default by use of Invoke-Parallel (Allowed up to 10 threads)
- `-Depth` parameter to specify `-Recurse` depth
- `-Set` parameter to update any setting from the commandline via a hashtable
- `-SettingsPath` parameter to specify an external settings file
- `-HideProgress` parameter to hide the progress bar when sorting
- PSEdition Core requirement added to all public functions
- Settings validation function
- Re-added `-MoveToFolder` and `-RenameFile` parameters
- Re-added `-Strict` parameter

### Changed
- `FullName` column added to thumbnail csv - Not required if adding actress manually
- Changed function name `Update-JVThumbs` -> `Update-JVThumbCsv`
- Setting name `sort.metadata.thumbcsv.path` -> `location.thumbcsv`
- Setting name `sort.metadata.genrecsv.path` -> 'location.genrecsv`
- Setting name `admin.log.path` -> `location.log`
- `-Version` parameter output
- Url matches using `-Find` are more intuitive

### Fixed
- Missing setting `scraper.movie.javbuzh` added to jvSettings.json file
- Encoding errors where `sort.metadata.nfo.translate` is enabled
- Error when running `-Find` without any scrapers enabled

### Removed
- `Logging` module dependency


## [2.0.0-alpha1]
### Added
- Site scrapers now run in asynchronous threads
- Scraping a single movie with -Url now works more intuitively
- Thumbnail csv is improved with both English/Japanese names
- Thumbnail csv now supports multiple actress aliases with '|' delimiter in the Alias column
- Thumbnail csv now better matches actresses
- Allow to prefer English or Japanese actress names in metadata
- If a Japanese name is found from site metadata, thumbnail csv will automatically be used to try to match it to its English name and vice-versa
- User definable genre csv path
- User definable thumbnail csv path
- User definable javlibrary baseUrl - some reports of cloudflare issues
- Improved logging
- Functions now public for power users

### Changed:
- Settings file changed from .ini to .json format
- Path/DestinationPath now work a bit differently.
- Running Javinizer -Path $Path used to automatically set the DestinationPath as $Path. Now it is either required to be set in the command line or it will default to the path in the settings file

### Removed
- \<year> data in nfo
- \<rating> data in nfo



## [1.7.3]
### Changed
- Restored some scraper settings defaults
Expand Down Expand Up @@ -459,4 +515,3 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- Initial functionality release
- Web searching with `-Find`
- File and directory sort with `-Path` and `-Apply`

367 changes: 136 additions & 231 deletions README.md

Large diffs are not rendered by default.

10 changes: 7 additions & 3 deletions actions_bootstrap.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ $null = $modulesToInstall.Add(([PSCustomObject]@{
ModuleVersion = '0.12.0'
}))

$null = $modulesToInstall.Add(([PSCustomObject]@{
ModuleName = 'Logging'
ModuleVersion = '4.4.0'
}))

'Installing PowerShell Modules'
foreach ($module in $modulesToInstall) {
$installSplat = @{
Expand All @@ -43,10 +48,9 @@ foreach ($module in $modulesToInstall) {
Install-Module @installSplat
Import-Module -Name $module.ModuleName -ErrorAction Stop
' - Successfully installed {0}' -f $module.ModuleName
}
catch {
} catch {
$message = 'Failed to install {0}' -f $module.ModuleName
" - $message"
throw $message
}
}
}
7 changes: 7 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Javinizer Docs

## Installation

## Usage

## FAQ
2 changes: 1 addition & 1 deletion src/Javinizer.build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ Add-BuildTask FormattingCheck {

if ($scriptAnalyzerResults) {
$scriptAnalyzerResults | Format-Table
throw ' PSScriptAnalyzer code formatting check did not adhere to {0} standards' -f $scriptAnalyzerParams.Setting
throw ' PSScriptAnalyzer code formatting check did not adhere to {0} standards' -f $scriptAnalyzerParams.Setting
} else {
Write-Build Green ' ...Formatting Analyze Complete!'
}
Expand Down
37 changes: 27 additions & 10 deletions src/Javinizer/Javinizer.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@

# Version number of this module.

ModuleVersion = '1.7.3'
ModuleVersion = '2.0.0'

# Supported PSEditions
# CompatiblePSEditions = @()
# CompatiblePSEditions = @('Core')

# ID used to uniquely identify this module
GUID = '31b44904-fe6e-4bfe-8c6f-99dfb294a164'
Expand All @@ -34,7 +34,7 @@
Description = 'A command-line based tool to scrape and sort your local Japanese Adult Video (JAV) files'

# Minimum version of the PowerShell engine required by this module
# PowerShellVersion = ''
# PowerShellVersion = '6'

# Name of the PowerShell host required by this module
# PowerShellHostName = ''
Expand All @@ -52,7 +52,7 @@
# ProcessorArchitecture = ''

# Modules that must be imported into the global environment prior to importing this module
# RequiredModules = @()
# RequiredModules = @()

# Assemblies that must be loaded prior to importing this module
# RequiredAssemblies = @()
Expand All @@ -70,7 +70,26 @@
# NestedModules = @()

# Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export.
FunctionsToExport = @('Javinizer')
FunctionsToExport = @(
'Javinizer',
'Get-DmmData',
'Get-DmmUrl',
'Get-Jav321Data',
'Get-Jav321Url',
'Get-JavBusData',
'Get-JavbusUrl',
'Get-JavlibraryData',
'Get-JavlibraryUrl',
'Get-JVAggregatedData',
'Get-JVData',
'Get-JVItem',
'Get-JVNfo',
'Get-R18Data',
'Get-R18Url',
'Set-JVEmbyThumbs',
'Set-JVMovie',
'Update-JVThumbCsv'
)

# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export.
CmdletsToExport = '*'
Expand All @@ -96,10 +115,10 @@
PSData = @{

# Tags applied to this module. These help with module discovery in online galleries.
# Tags = @()
Tags = @('JAV', 'Scraper')

# A URL to the license for this module.
# LicenseUri = ''
LicenseUri = 'https://github.com/jvlflame/Javinizer/blob/master/LICENSE'

# A URL to the main website for this project.
ProjectUri = 'https://github.com/jvlflame/Javinizer'
Expand All @@ -111,7 +130,7 @@
ReleaseNotes = 'https://github.com/jvlflame/Javinizer/blob/master/.github/CHANGELOG.md'

# Prerelease string of this module
# Prerelease = ''
Prerelease = 'alpha3'

# Flag to indicate whether the module requires explicit user acceptance for install/update/save
RequireLicenseAcceptance = $false
Expand All @@ -130,5 +149,3 @@
# DefaultCommandPrefix = ''

}


23 changes: 0 additions & 23 deletions src/Javinizer/Private/Convert-CommaDelimitedString.ps1

This file was deleted.

6 changes: 3 additions & 3 deletions src/Javinizer/Private/Convert-HTMLCharacter.ps1
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
function Convert-HTMLCharacter {
[CmdletBinding()]
param (
[string]$String
[Parameter(Mandatory = $true, Position = 0, ValueFromPipeline = $true)]
[AllowEmptyString()]
[String]$String
)

process {
Expand All @@ -17,8 +19,6 @@ function Convert-HTMLCharacter {
-replace '&#039', ''

$newString = $String.Trim()
# Write-Debug "[$(Get-TimeStamp)][$($MyInvocation.MyCommand.Name)] Begin String: [$String]; End string: [$newString]"
Write-Output $newString

}
}
75 changes: 75 additions & 0 deletions src/Javinizer/Private/Convert-JVString.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
function Convert-JVString {
[CmdletBinding()]
param (
[Parameter(Mandatory = $true)]
[PSObject]$Data,

[Parameter(Mandatory = $true)]
[String]$FormatString,

[Parameter()]
[Int]$PartNumber,

[Parameter()]
[Int]$MaxTitleLength
)

process {
# These symbols need to be removed to create a valid Windows filesystem name
$invalidSymbols = @(
'\',
'/',
':',
'*',
'?',
'"',
'<',
'>',
'|',
"'"
)

if ($maxTitleLength) {
if ($Data.Title.Length -ge $MaxTitleLength) {
$shortTitle = $Data.Title.Substring(0, $MaxTitleLength)
$splitTitle = $shortTitle -split ' '
if ($splitTitle.Count -gt 1) {
# Remove the last word of the title just in case it is cut off
$title = ($splitTitle[0..($splitTitle.Length - 2)] -join ' ')
if ($title[-1] -match '\W') {
$Data.Title = ($title.Substring(0, $title.Length - 2)) + '...'
} else {
$Data.Title = $title + '...'
}
} else {
$Data.Title = $shortTitle + '...'
}
}
}

$convertedName = $FormatString `
-replace '<ID>', "$($Data.Id)" `
-replace '<TITLE>', "$($Data.Title)" `
-replace '<RELEASEDATE>', "$($Data.ReleaseDate)" `
-replace '<YEAR>', "$(($Data.ReleaseDate -split '-')[0])" `
-replace '<STUDIO>', "$($Data.Maker)" `
-replace '<RUNTIME>', "$($Data.Runtime)" `
-replace '<SET>', "$($Data.Series)" `
-replace '<LABEL>', "$($Data.Label)" `
-replace '<ORIGINALTITLE>', "$($Data.AlternateTitle)"

foreach ($symbol in $invalidSymbols) {
if ([regex]::Escape($symbol) -eq '/') {
$convertedName = $convertedName -replace [regex]::Escape($symbol), '-'
} else {
$convertedName = $convertedName -replace [regex]::Escape($symbol), ''
}
}

if ($PartNumber) {
$convertedName += "-pt$PartNumber"
}

Write-Output $convertedName
}
}
Loading

0 comments on commit af7905d

Please sign in to comment.