Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fix][Enhancement] Improved Convert-JVTitle and fixed issues related to multi-part files. #101

Merged
merged 5 commits into from
Sep 25, 2020

Conversation

seeyabye
Copy link
Collaborator

@seeyabye seeyabye commented Sep 22, 2020

The latest version (v2.0.2) of Javinizer's -Update allows re-downloading of trailers and re-creation of NFO files, but there's a bug if match.regex is not used.

For instance, if I have the following set of files:

├── bbi-094a.wmv
└── bbi-094b.wmv

The initial multi-part files are bbi-094a.wmv and bbi-094b.wmv respectively.

Using only dmmja as the sole aggregator and running Javinizer for renaming and moving files, I would then obtain

├── bbi00094-pt1.wmv
├── bbi00094-pt1.nfo
├── bbi00094-pt2.wmv
└── bbi00094-pt2.nfo

If we now run Javinizer -Update to force an update, you will see that Javinizer is unable to match any search results.

[2020-09-22T16:59:19][DEBUG] [BBI00094-PT-1] [Get-DmmUrl] Performing [GET] on URL [https://www.dmm.co.jp/search/?redirect=1&enc=UTF-8&category=&searchstr=BBI0009400000T]
[2020-09-22T16:59:19][DEBUG] [BBI00094-PT-2] [Get-DmmUrl] Performing [GET] on URL [https://www.dmm.co.jp/search/?redirect=1&enc=UTF-8&category=&searchstr=BBI0009400000T]
[2020-09-22T16:59:19][DEBUG] [BBI00094-PT-1] [Get-DmmUrl] Searching [3] of [5] results for [BBI00094-PT-1]
[2020-09-22T16:59:19][DEBUG] [BBI00094-PT-2] [Get-DmmUrl] Searching [3] of [5] results for [BBI00094-PT-2]
[2020-09-22T16:59:19][DEBUG] [BBI00094-PT-1] [Get-DmmUrl] Performing [GET] on URL [https://www.dmm.co.jp/digital/videoa/-/detail/=/cid=pred00251/]
[2020-09-22T16:59:19][DEBUG] [BBI00094-PT-2] [Get-DmmUrl] Performing [GET] on URL [https://www.dmm.co.jp/digital/videoa/-/detail/=/cid=pred00251/]
[2020-09-22T16:59:19][DEBUG] [BBI00094-PT-1] [Get-DmmUrl] Result [1] is [pred00251]
[2020-09-22T16:59:19][DEBUG] [BBI00094-PT-1] [Get-DmmUrl] Performing [GET] on URL [https://www.dmm.co.jp/digital/videoa/-/detail/=/cid=h_1340buzx00001/]
[2020-09-22T16:59:19][DEBUG] [BBI00094-PT-2] [Get-DmmUrl] Result [1] is [pred00251]
[2020-09-22T16:59:19][DEBUG] [BBI00094-PT-2] [Get-DmmUrl] Performing [GET] on URL [https://www.dmm.co.jp/digital/videoa/-/detail/=/cid=h_1340buzx00001/]
[2020-09-22T16:59:20][DEBUG] [BBI00094-PT-1] [Get-DmmUrl] Result [2] is [h_1340buzx00001]
[2020-09-22T16:59:20][DEBUG] [BBI00094-PT-1] [Get-DmmUrl] Performing [GET] on URL [https://www.dmm.co.jp/digital/videoa/-/detail/=/cid=ssni00877/]
[2020-09-22T16:59:20][DEBUG] [BBI00094-PT-2] [Get-DmmUrl] Result [2] is [h_1340buzx00001]
[2020-09-22T16:59:20][DEBUG] [BBI00094-PT-2] [Get-DmmUrl] Performing [GET] on URL [https://www.dmm.co.jp/digital/videoa/-/detail/=/cid=ssni00877/]
[2020-09-22T16:59:20][DEBUG] [BBI00094-PT-1] [Get-DmmUrl] Result [3] is [ssni00877]
[2020-09-22T16:59:20][WARN ] [BBI00094-PT-1] [Get-DmmUrl] not matched on DMM
[2020-09-22T16:59:20][DEBUG] [BBI00094-PT-1] [Get-JVData] [Search - Dmm] [Url - ]
[2020-09-22T16:59:20][DEBUG] [BBI00094-PT-1] [Get-JVData] [Success - Scraper jobs] []
[2020-09-22T16:59:20][DEBUG] [BBI00094-PT-1] [Get-JVData] [Removed - Scraper jobs]
[2020-09-22T16:59:20][WARN ] [bbi00094-pt1.wmv] Skipped -- not matched
[2020-09-22T16:59:21][DEBUG] [BBI00094-PT-2] [Get-DmmUrl] Result [3] is [ssni00877]
[2020-09-22T16:59:21][WARN ] [BBI00094-PT-2] [Get-DmmUrl] not matched on DMM
[2020-09-22T16:59:21][DEBUG] [BBI00094-PT-2] [Get-JVData] [Search - Dmm] [Url - ]
[2020-09-22T16:59:21][DEBUG] [BBI00094-PT-2] [Get-JVData] [Success - Scraper jobs] []
[2020-09-22T16:59:21][DEBUG] [BBI00094-PT-2] [Get-JVData] [Removed - Scraper jobs]
[2020-09-22T16:59:21][WARN ] [bbi00094-pt2.wmv] Skipped -- not matched

As it appears, the filenames were not converted by Convert-JVTitle properly. This PR hopes to solve that problem.

In addition to the updates, I've included the following changes:

  • Streamlined the conversion process of Alphabetical parts to part numbers without using too many if..elseif..else statements
  • Streamlined ID matching to a single regex.
  • Included Unit Test for validating different use cases.

Note: There are a couple of edge-cases that I've not tested. It may be necessary to include them for unit testing.

@seeyabye seeyabye changed the title Fixed an update bug for multipart files [Fix][Enhancement] Improved Convert-JVTitle and fixed issues related to multi-part files. Sep 22, 2020
@jvlflame jvlflame self-requested a review September 22, 2020 23:54
@seeyabye seeyabye marked this pull request as draft September 23, 2020 01:34
@seeyabye seeyabye marked this pull request as ready for review September 24, 2020 09:46
@jvlflame jvlflame added the enhancement New feature or request label Sep 25, 2020
@jvlflame jvlflame added this to In progress in 2.1.0 via automation Sep 25, 2020
Copy link
Collaborator

@jvlflame jvlflame left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything else looks good!

Thanks for adding additional test cases for the other use-cases, that was helpful when I was going through it to check. I also updated the build/test function to not error out based on code coverage % so builds shouldn't fail with the tests.

We can merge now.

@jvlflame jvlflame merged commit 480e5ab into javinizer:dev Sep 25, 2020
2.1.0 automation moved this from In progress to Done Sep 25, 2020
@seeyabye seeyabye deleted the fix/update-parts branch September 25, 2020 05:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
No open projects
2.1.0
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants