Browse Source

Fix title and year.

xoru 2 years ago
parent
commit
5ae1c5586e
1 changed files with 2 additions and 3 deletions
  1. 2
    3
      sections/ajax/autofill/jav.php

+ 2
- 3
sections/ajax/autofill/jav.php View File

@@ -108,7 +108,7 @@ if (!$debug && $Cache->get_value('jav_fill_json_'.$cn)) {
108 108
   }
109 109
   if ($jdb_page) {
110 110
     if (!$title) {
111
-      $title = substr($jdb->query('//h3')[0]->nodeValue, strlen($cn)+1);
111
+      $title = trim(substr($jdb->query("//h1[contains(@class, 'entry-title')]")[0]->nodeValue, strlen($cn) + 3));
112 112
     }
113 113
     if (!$studio) {
114 114
       $studio = $jdb->query("//b[contains(., 'Studio:')]")[0]->nextSibling->nodeValue;
@@ -132,8 +132,7 @@ if (!$debug && $Cache->get_value('jav_fill_json_'.$cn)) {
132 132
       }
133 133
     }
134 134
     if (!$year) {
135
-      // Assume year 2000+. JDB's oldest entry is from 2002.
136
-      $year = "20" . substr($jdb->query("//b[contains(., 'Release Date:')]")[0]->nextSibling->nodeValue, -2);
135
+      $year = substr($jdb->query("//b[contains(., 'Release Date:')]")[0]->nextSibling->nodeValue, 1, 4);
137 136
     }
138 137
     if (!$image) {
139 138
       $image = $jdb->query("//img[contains(@alt, ' download or stream.')]")->item(0)->getAttribute('src');

Loading…
Cancel
Save