Browse Source

e-hentai API fixes

spaghetti 9 years ago
parent
commit
a8ee4858cf
2 changed files with 6 additions and 5 deletions
  1. 5
    5
      sections/ajax/doujin.php
  2. 1
    0
      static/functions/upload.js

+ 5
- 5
sections/ajax/doujin.php View File

@@ -7,7 +7,7 @@ if (empty($_GET['url'])) {
7 7
 $url = $_GET['url'];
8 8
 
9 9
 $matches = array();
10
-preg_match('/^https?:\/\/g\.e.hentai\.org\/g\/(\d+)\/([\w\d]+)\/?$/', $url, $matches);
10
+preg_match('/^https?:\/\/g?\.?e.hentai\.org\/g\/(\d+)\/([\w\d]+)\/?$/', $url, $matches);
11 11
 
12 12
 $gid = $matches[1] ?? '';
13 13
 $token = $matches[2] ?? '';
@@ -46,10 +46,10 @@ if ($Cache->get_value('doujin_json_'.$gid) && false) {
46 46
 
47 47
     if ($namespace == "artist") {
48 48
       array_push($artists, ucwords($tag));
49
-    } else if ($namespace == "language" && empty($lang)) {
50
-      $lang = ucfirst($tag);
51
-    } else if ($namespace == "group" && empty($circle)) {
52
-      $circle = ucfirst($tag);
49
+    } else if ($namespace == "language") {
50
+      $lang = empty($lang) ? ucfirst($tag) : $lang;
51
+    } else if ($namespace == "group") {
52
+      $circle = empty($circle) ? ucfirst($tag) : $circle;
53 53
     } else {
54 54
       if ($namespace) { $tag = $tag.':'.$namespace; }
55 55
       array_push($tags, str_replace(' ', '.', $tag));

+ 1
- 0
static/functions/upload.js View File

@@ -423,6 +423,7 @@ function DoujAutofill() {
423 423
               tags: 'tags',
424 424
               lang: 'lang',
425 425
               cover: 'image',
426
+              circle: 'series',
426 427
               pages: 'pages',
427 428
               description: 'release_desc' }
428 429
   var nh = $('#catalogue').raw().value

Loading…
Cancel
Save