Repository navigation
New 'inline' mode in when detecting regions from filename corrected to 'snap' detections to front of priorities - #253
mattfeeder18 wants to merge 7 commits into
Conversation
… mode
This change would go through the regionPrios list, snap any in there that are also detected in the filename to the front, and keep them in the order they were in regionPrios. Any detected filenames that are not in regionPrios get added before the remaining regionsPrios.
Example:
If regionPrios = {"eu", "us", "jp"},
and we have "Game A (USA, Europe, Brazil)",
then this edited function would generate the 3 following lists:
detectedAndPrioritized = {"eu", "us"},
addRegionPrios = {"br"},
remainingConfigPrios = {"jp"},
and then stitch them together like this to form the order to check:
{"eu", "us", "br", "jp"}
Clarified region priority behaviour for intended 'inline' behaviour so that 'inline' and 'first' both pull detected regions to the front, but 'first' preserves the filename order and 'inline' preserves the regionPrios order.
Clarified the behaviour of region prioritisation and filename detection.
|
Makes sense, thanks. Let me review it in detail in the next days. Please keep the trailing double spaces in the markdown files. They do have a function (newline without paragraph spacing). Maybe you have to configure your editor to keep trailing spaces (at least for markdown files). |
|
Okay, great, thanks for looking into it, and glad it makes sense. Apologies for the double spaces - I must have removed some when tidying up and not realised their importance. Please add them back where needed. I'll ensure my editor keeps the trailing spaces from now on. I haven't checked all unit tests, I was a little busy when I submitted the PR and only managed to edit the files, with some superficial testing. Please make sure you fully test the PR and make any changes to the logic/syntax/names that you feel necessary. |
|
I cannot proceed with the PR in the current state, @mattfeeder18 . Your wording at the beginning does not fit the proposed implementation. Below is a testcase of your statements. Pls insert them it in void testRegionsFromFilenameOptionInlinePR253() {
settings.regionPrios = QStringList({"eu", "us", "jp"});
settings.regionFromFilename = "inline";
scraper = new AbstractScraper(&settings, NULL);
qDebug() << "Configured region prios:" << settings.regionPrios;
QList<QString> regionPriosExp = QStringList({"eu", "us", "br", "jp"});
matchRegion("Game A' (USA, Europe, Brazil).zip", regionPriosExp);
}
And when you are on it pls restore the double spaces in the markdown. Thanks. |
|
Apologies for the delay in replying and sorting this. I am currently editing/testing based on the corrections you requested, and will let you know when I believe it is ready. |
|
No worries. // map to Skyscraper's short-names (sky_regio_key)
if (regionsInline) {
- if (!regionPrios.contains(sky_regio_key) &&
+ if (
!addRegionPrios.contains(sky_regio_key)) {
addRegionPrios.append(sky_regio_key);
+ qDebug() << " append" << sky_regio_key;
}Just let me know if I should push my changes in your PR or do you want to have the files as whole as a GitHub gist? Also I noticed, when following your documented behaviour, that between "first" and "inline" is only a small difference. I have not found a proper adjective for these modes, working titles would be "first-asis" (as ordered in the filename) and "first-ordered" (by region prios) |
|
Feel free to push your changes to my PR and I'll continue my tests to check it works as it should and make any further changes from there. For the names, maybe 'first' could be 'static', and 'inline' could be 'dynamic', which indicates how the prios are included from the filename? Static would leave the prios from the config as is, and dynamic would change the order dynamically based on the filename order. Let me know if that makes sense to you. |
… in PR253 - restored trailing double spaces in markdown
…nto mattfeeder18_main_pr253
Just did. Looks a lot, but in essence it is the one change I highlighted before and the extended testcases.
Whoever wrote this was either not human or completely out of his/her mind. Please align the first and second statement. |
|
Closing due to insufficient contributor communication. |
New 'inline' mode in when detecting regions from filename corrected to 'snap' detections to front of priorities - old logic wasn't quite what I needed so I can made the edits necessary and adjusted the documentation to support this.
Example (for 'inline'):
If regionPrios = {"eu", "us", "jp"},
and we have "Game A (USA, Europe, Brazil)",
then this edited function would generate the 3 following lists:
detectedAndPrioritized = {"eu", "us"},
addRegionPrios = {"br"},
remainingConfigPrios = {"jp"},
and then stitch them together like this to form the order to check:
{"eu", "us", "br", "jp"}
This keeps the regionPrios in order, but shift any detections to the front and inserts detection not in regionPrios accordingly.
Again, apologies I didn't pick this up before the previous branch was committed to main.