Browse Source

Fix title and year.

xoru 6 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
   }
108
   }
109
   if ($jdb_page) {
109
   if ($jdb_page) {
110
     if (!$title) {
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
     if (!$studio) {
113
     if (!$studio) {
114
       $studio = $jdb->query("//b[contains(., 'Studio:')]")[0]->nextSibling->nodeValue;
114
       $studio = $jdb->query("//b[contains(., 'Studio:')]")[0]->nextSibling->nodeValue;
132
       }
132
       }
133
     }
133
     }
134
     if (!$year) {
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
     if (!$image) {
137
     if (!$image) {
139
       $image = $jdb->query("//img[contains(@alt, ' download or stream.')]")->item(0)->getAttribute('src');
138
       $image = $jdb->query("//img[contains(@alt, ' download or stream.')]")->item(0)->getAttribute('src');

Loading…
Cancel
Save