Skip to content

Commit

Permalink
Merge pull request #114 from jvlflame/dev
Browse files Browse the repository at this point in the history
2.1.0
  • Loading branch information
jvlflame authored Sep 30, 2020
2 parents 52f6135 + 0e3337b commit 4291255
Show file tree
Hide file tree
Showing 32 changed files with 774 additions and 190 deletions.
30 changes: 30 additions & 0 deletions .github/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,36 @@ 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.1.0]

### Added
- **EXPERIMENTAL** Dl.getchu scraper (#51)
- This is scraper is only available via the `-Url` parameter when sorting a single file or using `-Find` to search the Url
- Setting `sort.metadata.nfo.mediainfo` added to allow user to add video/audio metadata to nfo (#94)
- [MediaInfo](https://mediaarea.net/en/MediaInfo) required for use. MediaInfo will need to be added to your system PATH
- `<RESOLUTION>` added to file formats
- Setting `sort.metadata.nfo.unknownactress` to allow `Unknown` actress to be written to nfo file when no actresses are scraped (#105)
- Setting `sort.metadata.nfo.format.tagline` to allow user to set a tagline which accepts file format strings (#106)
- Setting `sort.metadata.priority.contentid` to set the priority of the ContentId displayed by aggregated data object
- `<CONTENTID>` added to file formats

### Changed
- Default file matcher updated to better match multipart videos and support DMM ContentId (#111)
- Setting `sort.metadata.nfo.seriesastag` is now `sort.metadata.nfo.format.tag`
- This setting is now an array, which allows multiple file format strings to be created as separate tags (#106)
- Javinizer now performs a retry on the Javlibrary URL scraper and continues to run despite webrequest errors (#109)
- AggregatedData object now contains `ContentId`

### Fixed
- Get-DmmUrl now correctly assigns the URLs when searching for a movie with ID with a letter suffix (#107)
- Manually sorting with a DmmJa URL now functions properly (#111)
- Nfo file now correctly renames to the movie name when `sort.renamefile` is set to false, and `sort.create.nfoperfile` is true (#102)
- `<ACTORS>` file rename format now properly falls back to the alternate language when the primary is missing (#103)
- R18 scraper now properly assigns the genre and label fields for Amateur videos (#108)
- Extra html on the Description field for the DMM scraper is now removed



## [2.0.2]

### Fixed
Expand Down
14 changes: 13 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,17 @@
"files.insertFinalNewline": true,
"editor.insertSpaces": true,
"editor.tabSize": 4,
"powershell.codeFormatting.preset": "OTBS"
"powershell.codeFormatting.preset": "OTBS",
"powershell.codeFormatting.autoCorrectAliases": true,
"powershell.codeFormatting.useCorrectCasing": true,
"powershell.codeFormatting.trimWhitespaceAroundPipe": true,
"powershell.codeFormatting.ignoreOneLineBlock": true,
"powershell.codeFormatting.alignPropertyValuePairs": true,
"powershell.codeFormatting.addWhitespaceAroundPipe": true,
"powershell.codeFolding.showLastLine": true,
"powershell.codeFormatting.pipelineIndentationStyle": "NoIndentation",
"powershell.codeFormatting.whitespaceAfterSeparator": true,
"powershell.codeFormatting.whitespaceAroundOperator": true,
"powershell.codeFormatting.whitespaceBeforeOpenBrace": true,
"powershell.codeFormatting.whitespaceBeforeOpenParen": true
}
68 changes: 44 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,11 @@ A rebuild of my previous project [JAV-Sort-Scrape-javlibrary](https://github.com

### Install module dependencies

- [PowerShell 6/7](https://github.com/PowerShell/PowerShell)
- [PowerShell 6/7](https://github.com/PowerShell/PowerShell) *Recommended PowerShell 7
- [Python 3](https://www.python.org/downloads/)
- [Pillow](https://pypi.org/project/Pillow/)
- [Googletrans](https://pypi.org/project/googletrans/)
- [MediaInfo](https://mediaarea.net/en/MediaInfo) *MediaInfo will need to be added to your PATH

```powershell
# Python
Expand Down Expand Up @@ -401,9 +402,17 @@ ID-###_0\d - ID-069_01, ID-069_02
ID-###-cd\d - ID-069-cd1, ID-069-cd2
```

### In-depth usage
## In-depth usage

#### Metadata Priorities
### Media Library Setup

| CMS | How to use |
| ------------- | ------------- |
| Plex | Set-up a `Movie` library with custom agent [XBMCnfoMoviesImporter.bundle](https://github.com/gboudreau/XBMCnfoMoviesImporter.bundle). Turn on settings `Enable generating collections from tags` and `Use plot instead of outline` |
| Emby | Set-up a `Movie` library with all metadata/image downloaders disabled. Input your server url and API key in the `jvSettings.json` file and use `Javinizer -SetEmbyThumbs` to set actress thumbnails |
| Jellyfin | Set-up a `Movie` library with all metadata/image downloaders disabled. Input your server url and API key in the `jvSettings.json` file and use `Javinizer -SetEmbyThumbs` to set actress thumbnails |

### Metadata Priorities

Scrapers by default are english. Scrapers appended by Ja are Japanese, Zh are Chinese.
Current metadata scrapers include:
Expand All @@ -427,7 +436,22 @@ For example, if your actress priority looks like this: `"sort.metadata.priority.
- If actresses are not found on the R18 scraper but are found on the Javlibrary scraper => Javlibrary actresses will be assigned to the metadata field
- If actresses are not found on the R18 and Javlibrary scrapers but are found on the JavBus scraper => JavBus actresses will be assigned to the metadata field

#### Actress Thumb Csv
### Metadata Format Strings

- <\ID>
- <\CONTENTID>
- <\TITLE>
- <\RELEASEDATE>
- <\YEAR>
- <\STUDIO>
- <\RUNTIME>
- <\SET>
- <\LABEL>
- <\ACTORS>
- <\ORIGINALTITLE>
- <\RESOLUTION> - requires `sort.metadata.nfo.mediainfo` as true

### Actress Thumb Csv

Javinizer can utilize a csv file of actresses scraped from R18.com to further match actresses and their respective names/thumbnail URLs.

Expand Down Expand Up @@ -464,7 +488,7 @@ Nagase Yui | Nagase | Yui | 永瀬ゆい |https://[..]/nagase_yui2.jpg | Aika

If `sort.metadata.thumbcsv.autoadd` is enabled in addition to `sort.metadata.thumbcsv`, then Javinizer will automatically add any missing actresses scraped from the R18 or R18Zh scrapers to your thumbnail csv if the actress has a thumbnail.

#### Genre Csv
### Genre Csv

Javinizer can utilize a csv file of genres to replace them with a genre of your choice.

Expand Down Expand Up @@ -528,20 +552,24 @@ For example, if your jvGenres.csv file looks like this:
| `sort.download.screenshotimg` | Specifies to download screenshot images when sorting a movie. | 0, 1
| `sort.download.trailervid` | Specifies to download the trailer video when sorting a movie. | 0, 1
| `sort.format.delimiter` | Specifies the delimiter between actresses when using \<ACTORS> in the format string. | Any string value
| `sort.format.file` | Specifies the format string when renaming a file. | <\ID>, <\TITLE>, <\RELEASEDATE>, <\YEAR>, <\STUDIO>, <\RUNTIME>, <\SET>, <\LABEL>, <\ACTORS>, <\ORIGINALTITLE>
| `sort.format.folder` | Specifies the format string when creating the folder. | <\ID>, <\TITLE>, <\RELEASEDATE>, <\YEAR>, <\STUDIO>, <\RUNTIME>, <\SET>, <\LABEL>, <\ACTORS>, <\ORIGINALTITLE>
| `sort.format.posterimg` | Specifies an array of format string when creating the poster image. Multiple strings will allow you to create multiple poster image files. | <\ID>, <\TITLE>, <\RELEASEDATE>, <\YEAR>, <\STUDIO>, <\RUNTIME>, <\SET>, <\LABEL>, <\ACTORS>, <\ORIGINALTITLE>
| `sort.format.thumbimg` | Specifies the format string when creating the thumbnail image. | <\ID>, <\TITLE>, <\RELEASEDATE>, <\YEAR>, <\STUDIO>, <\RUNTIME>, <\SET>, <\LABEL>, <\ACTORS>, <\ORIGINALTITLE>
| `sort.format.trailervid` | Specifies the format string when creating the trailer video. | <\ID>, <\TITLE>, <\RELEASEDATE>, <\YEAR>, <\STUDIO>, <\RUNTIME>, <\SET>, <\LABEL>, <\ACTORS>, <\ORIGINALTITLE>
| `sort.format.nfo` | Specifies the format string when creating the nfo. | <\ID>, <\TITLE>, <\RELEASEDATE>, <\YEAR>, <\STUDIO>, <\RUNTIME>, <\SET>, <\LABEL>, <\ACTORS>, <\ORIGINALTITLE>
| `sort.format.screenshotimg` | Specifies the format string when creating the screenshot images. | <\ID>, <\TITLE>, <\RELEASEDATE>, <\YEAR>, <\STUDIO>, <\RUNTIME>, <\SET>, <\LABEL>, <\ACTORS>, <\ORIGINALTITLE>
| `sort.format.screenshotfolder` | Specifies the format string when creating the screenshot images folder. | <\ID>, <\TITLE>, <\RELEASEDATE>, <\YEAR>, <\STUDIO>, <\RUNTIME>, <\SET>, <\LABEL>, <\ACTORS>, <\ORIGINALTITLE>
| `sort.format.actressimgfolder` | Specifies the format string when creating the actress image folder. | <\ID>, <\TITLE>, <\RELEASEDATE>, <\YEAR>, <\STUDIO>, <\RUNTIME>, <\SET>, <\LABEL>, <\ACTORS>, <\ORIGINALTITLE>
| `sort.metadata.nfo.translatedescription` | Specifies to translate the description | 0, 1
| `sort.format.file` | Specifies the format string when renaming a file. | [Format Strings](#Metadata-Format-Strings)
| `sort.format.folder` | Specifies the format string when creating the folder. | [Format Strings](#Metadata-Format-Strings)
| `sort.format.posterimg` | Specifies an array of format strings when creating the poster image. Multiple strings will allow you to create multiple poster image files. | [Format Strings](#Metadata-Format-Strings)
| `sort.format.thumbimg` | Specifies the format string when creating the thumbnail image. | [Format Strings](#Metadata-Format-Strings)
| `sort.format.trailervid` | Specifies the format string when creating the trailer video. | [Format Strings](#Metadata-Format-Strings)
| `sort.format.nfo` | Specifies the format string when creating the nfo. | [Format Strings](#Metadata-Format-Strings)
| `sort.format.screenshotimg` | Specifies the format string when creating the screenshot images. | [Format Strings](#Metadata-Format-Strings)
| `sort.format.screenshotfolder` | Specifies the format string when creating the screenshot images folder. | [Format Strings](#Metadata-Format-Strings)
| `sort.format.actressimgfolder` | Specifies the format string when creating the actress image folder. | [Format Strings](#Metadata-Format-Strings)
| `sort.metadata.nfo.mediainfo` | Specifies to add media metadata information to the nfo file. This requires the MediaInfo command line application. | 0, 1
| `sort.metadata.nfo.translatedescription` | Specifies to translate the description. | 0, 1
| `sort.metadata.nfo.translatedescription.language` | Specifies which language to translate to. | Check [here](https://developers.google.com/admin-sdk/directory/v1/languages) for language codes
| `sort.metadata.nfo.displayname` | Specifies the format string of the displayname in the metadata nfo file. | <\ID>, <\TITLE>, <\RELEASEDATE>, <\YEAR>, <\STUDIO>, <\RUNTIME>, <\SET>, <\LABEL>, <\ACTORS>, <\ORIGINALTITLE>
| `sort.metadata.nfo.displayname` | Specifies the format string of the displayname in the metadata nfo file. | [Format Strings](#Metadata-Format-Strings)
| `sort.metadata.nfo.seriesastag` | Specifies to add the <\SET> metadata as <\TAG> as well for Emby/Jellyfin support | 0, 1
| `sort.metadata.nfo.format.tag` | Specifies an array of format strings to add tags to the aggregated data object | [Format Strings](#Metadata-Format-Strings)
| `sort.metadata.nfo.format.tagline` | Specifies the format string to add a tagline to the aggregated data object | [Format Strings](#Metadata-Format-Strings)
| `sort.metadata.nfo.actresslanguageja` | Specifies to prefer Japanese names when creating the metadata nfo. | 0, 1
| `sort.metadata.nfo.unknownactress` | Specifies to add an 'Unknown' actress to scraped movies without any actresses | 0, 1
| `sort.metadata.thumbcsv` | Specifies to use the thumbnail csv when aggregating metadata. | 0, 1
| `sort.metadata.thumbcsv.autoadd` | Specifies to automatically add missing actresses to the thumbnail csv when scraping using the R18 or R18Zh scrapers. | 0, 1
| `sort.metadata.thumbcsv.convertalias` | Specifies to use the thumbnail csv alias field to replace actresses in the metadata. | 0, 1
Expand Down Expand Up @@ -569,11 +597,3 @@ For example, if your jvGenres.csv file looks like this:
| `javlibrary.baseurl` | Specifies the base URL of the Javlibrary instance you want to scrape. This is useful if you are running into CloudFlare errors on the main site and want to use a mirror such as g46e.com or m45e.com | http:\\/\\/javlibrary.com
| `admin.log` | Specifies to write debug, warning, error, and verbose messages to the log file. | 0, 1
| `admin.log.level` | Specifies the level of logs that will be written to the log file. | Debug, Info, Warning, Error

## Media Library Setup

| CMS | How to use |
| ------------- | ------------- |
| Plex | Set-up a `Movie` library with custom agent [XBMCnfoMoviesImporter.bundle](https://github.com/gboudreau/XBMCnfoMoviesImporter.bundle). Turn on settings `Enable generating collections from tags` and `Use plot instead of outline` |
| Emby | Set-up a `Movie` library with all metadata/image downloaders disabled. Input your server url and API key in the `jvSettings.json` file and use `Javinizer -SetEmbyThumbs` to set actress thumbnails |
| Jellyfin | Set-up a `Movie` library with all metadata/image downloaders disabled. Input your server url and API key in the `jvSettings.json` file and use `Javinizer -SetEmbyThumbs` to set actress thumbnails |
2 changes: 1 addition & 1 deletion src/Javinizer.build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ Add-BuildTask Test {
Assert-Build($numberFails -eq 0) ('Failed "{0}" unit tests.' -f $numberFails)

# Ensure our builds fail until if below a minimum defined code test coverage threshold
$coverageThreshold = 50
$coverageThreshold = 0

if ($testResults.CodeCoverage.NumberOfCommandsExecuted -ne 0) {
$coveragePercent = '{0:N2}' -f ($testResults.CodeCoverage.NumberOfCommandsExecuted / $testResults.CodeCoverage.NumberOfCommandsAnalyzed * 100)
Expand Down
2 changes: 1 addition & 1 deletion src/Javinizer/Javinizer.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

# Version number of this module.

ModuleVersion = '2.0.2'
ModuleVersion = '2.1.0'

# Supported PSEditions
# CompatiblePSEditions = @('Core')
Expand Down
32 changes: 26 additions & 6 deletions src/Javinizer/Private/Convert-JVString.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -58,20 +58,39 @@ function Convert-JVString {

$actressObject = @()
if ($ActressLanguageJa) {
$actressObject = $Data.Actress.JapaneseName
if ($null -ne $Data.Actress.Japanese) {
$actressObject = $Data.Actress.JapaneseName
} elseif ($FirstNameOrder) {
foreach ($actress in $Data.Actress) {
$actressObject += "$($actress.FirstName) $($actress.LastName)".Trim()
}
} else {
foreach ($actress in $Data.Actress) {
$actressObject += "$($actress.LastName) $($actress.FirstName)".Trim()
}
}
} elseif ($FirstNameOrder) {
foreach ($actress in $Data.Actress) {
$actressObject += "$($actress.FirstName) $($actress.LastName)".Trim()
if ($null -ne $Data.Actress.FirstName) {
foreach ($actress in $Data.Actress) {
$actressObject += "$($actress.FirstName) $($actress.LastName)".Trim()
}
} else {
$actressObject = $Data.Actress.JapaneseName
}
} else {
foreach ($actress in $Data.Actress) {
$actressObject += "$($actress.LastName) $($actress.FirstName)".Trim()
if ($null -ne $Data.Actress.FirstName) {
foreach ($actress in $Data.Actress) {
$actressObject += "$($actress.LastName) $($actress.FirstName)".Trim()
}
} else {
$actressObject = $Data.Actress.JapaneseName
}
}

$actresses = ($actressObject | Sort-Object) -join $Delimiter
$convertedName = $FormatString `
-replace '<ID>', "$($Data.Id)" `
-replace '<CONTENTID>', "$($Data.ContentId)" `
-replace '<TITLE>', "$($Data.Title)" `
-replace '<RELEASEDATE>', "$($Data.ReleaseDate)" `
-replace '<YEAR>', "$(($Data.ReleaseDate -split '-')[0])" `
Expand All @@ -80,7 +99,8 @@ function Convert-JVString {
-replace '<SET>', "$($Data.Series)" `
-replace '<LABEL>', "$($Data.Label)" `
-replace '<ACTORS>', "$actresses" `
-replace '<ORIGINALTITLE>', "$($Data.AlternateTitle)"
-replace '<ORIGINALTITLE>', "$($Data.AlternateTitle)" `
-replace '<RESOLUTION>', "$($Data.MediaInfo.VideoHeight)"

foreach ($symbol in $invalidSymbols) {
if ([regex]::Escape($symbol) -eq '/') {
Expand Down
Loading

0 comments on commit 4291255

Please sign in to comment.