#68 Fix jdb title autofill, and also get genres

Merged
spaghetti merged 5 commits from xoru:fix-jdb-autofill into master 5 years ago
xoru commented 5 years ago

There’s probably a “smart” way we can remove some of the entries in the mapping like adding each key with both space removed, and space replaced by a period. For example Bunny Girl adding both bunnygirl and bunny.girl to the genre list, as their existence is checked later on anyway. But of course it’s simpler to just hardcode it.

There's probably a "smart" way we can remove some of the entries in the mapping like adding each key with both space removed, and space replaced by a period. For example `Bunny Girl` adding both `bunnygirl` and `bunny.girl` to the genre list, as their existence is checked later on anyway. But of course it's simpler to just hardcode it.
xoru commented 5 years ago
Poster

I’ve also now fixed the order of idol name/surnames and fixed the cover image part that causes the autofill to crash.

I've also now fixed the order of idol name/surnames and fixed the cover image part that causes the autofill to crash.
spaghetti reviewed 5 years ago
@@ -147,0 +205,4 @@
205
+        'Vibrator' => 'sex.toys',
206
+        'Voyeur' => 'voyeurism',
207
+        'Waitress' => 'waiter',
208
+      ];
spaghetti

I would definitely prefer if we just created aliases for these tags using gazelle’s built in tooling and let that system handle these transformations, but I don’t really want to do the work to add them so this is fine.

I would definitely prefer if we just created aliases for these tags using gazelle's built in tooling and let that system handle these transformations, but I don't really want to do the work to add them so this is fine.
sections/ajax/autofill/jav.php
@@ -147,0 +209,4 @@
209
+      foreach ($jdb->query("//a[@rel='tag' and starts-with(@href, 'https://www.javdatabase.com/genres/')]") as $tag) {
210
+        if (array_key_exists($tag->nodeValue, $jdb_genre_map)) {
211
+          if (is_array($jdb_genre_map[$tag->nodeValue])) {
212
+            $genres += $jdb_genre_map[$tag->nodeValue];
spaghetti

I don’t think + does concatenation on arrays in php. You probably need to use array_merge

I don't think `+` does concatenation on arrays in php. You probably need to use `array_merge`
xoru

+ does do concatenation, but yeah it’s wrong to use it here since it ignores duplicate keys. Switched to array_merge and now it works as expected

`+` does do concatenation, but yeah it's wrong to use it here since it ignores duplicate keys. Switched to `array_merge` and now it works as expected
spaghetti

+ does do concatenation, but yeah it’s wrong to use it here since it ignores duplicate keys

Yeah that makes it a union operation, not concatenation.

>`+` does do concatenation, but yeah it’s wrong to use it here since it ignores duplicate keys Yeah that makes it a union operation, not concatenation.
xoru

You’re right, I’m retarded

You're right, I'm retarded
The pull request has been merged.
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Due Date

No due date set.

Dependencies

This pull request currently doesn't have any dependencies.

Loading…
Cancel
Save
There is no content yet.