viewgit/inc/functions.php:22 Function utf8_encode() is deprecated [8192]

Tweaks to DescriptionUpdateJob

Chris Pollett [2024-04-21 00:Apr:st]
Tweaks to DescriptionUpdateJob
Filename
src/configs/Createdb.php
src/data/public_default.db
src/library/media_jobs/DescriptionUpdateJob.php
diff --git a/src/configs/Createdb.php b/src/configs/Createdb.php
index 5deeeccc9..799279349 100755
--- a/src/configs/Createdb.php
+++ b/src/configs/Createdb.php
@@ -1003,7 +1003,8 @@ $media_sources = [
         "Movie/Inception.mp4\n" .
         "Movie/Wrong Turn.mp4\n" .
         "TV Shows/Gilligan's Island", 'en-US'],
-    ['100000007', 'AllMusic Artist', 'description_source', '/Music[^\/]*\//',
+    ['100000007', 'AllMusic Artist', 'description_source',
+        '/Music[^\/]*\/[^\/]*$/',
         'https://www.allmusic.com/search/artists/',
         'Bio | //*[contains(@id,"bioHeadline")]' . "\n".
         'Active Dates | //div[contains(@id,"basicInfoMeta")]' .
@@ -1020,7 +1021,8 @@ $media_sources = [
         "//div[contains(@class,'name')]/a###" .
         "//div[contains(@class,'name')]/a/@href" .
         "############" .
-        "/Music/Buzzcocks\n/Music/Madonna\n", 'en-US'],
+        "/Music/Buzzcocks\n/Music/Madonna\n/Music/Madonna/Like a Virgin\n",
+        'en-US'],
     ['100000008', 'AllMusic Album', 'description_source',
         'Music[^\/]*\/([^\/]+)\/',
         'https://www.allmusic.com/search/albums/',
@@ -1037,7 +1039,8 @@ $media_sources = [
         "//div[contains(@class,'title')]/a###" .
         "//div[contains(@class,'title')]/a/@href" .
         "############" .
-        "/Music/Buzzcocks/Time's up\n/Music/Madonna/Like a virgin\n", 'en-US']
+        "/Music/Buzzcocks\n" .
+        "/Music/Buzzcocks/Time's up\n/Music/Madonna/Like a Virgin\n", 'en-US']
 ];
 $sql = "INSERT INTO MEDIA_SOURCE(TIMESTAMP, NAME, TYPE, CATEGORY,
     SOURCE_URL, AUX_INFO, LANGUAGE) VALUES  (?, ?, ?, ?, ?, ?, ?)";
diff --git a/src/data/public_default.db b/src/data/public_default.db
index 43cf20b76..6b2cd9280 100644
Binary files a/src/data/public_default.db and b/src/data/public_default.db differ
diff --git a/src/library/media_jobs/DescriptionUpdateJob.php b/src/library/media_jobs/DescriptionUpdateJob.php
index 84395565e..3cf00bc91 100644
--- a/src/library/media_jobs/DescriptionUpdateJob.php
+++ b/src/library/media_jobs/DescriptionUpdateJob.php
@@ -236,8 +236,11 @@ class DescriptionUpdateJob extends MediaJob
             $max_score = 0;
             $details_page_url = "";
             $found_details = false;
+            $details = "";
             foreach ($sources as $source) {
                 $source_name = $source['NAME'];
+                $log_function("***Seeing if search source <b>$source_name</b>".
+                    " applies or not***", "pre");
                 if ($additional_search_items =
                     $this->matchResourceSourcePathTerms(
                     $page_name . "/". $thumb_folder_path . "/" .
@@ -281,19 +284,20 @@ class DescriptionUpdateJob extends MediaJob
                         list($details, $test_info) = $this->getDetails(
                             $details_page, $source, $test_mode);
                         $test_results .= $test_info;
-                        if (!empty($details)) {
-                            $found_details = true;
-                            if ($test_mode) {
-                                $log_function("*** Found below details ***",
-                                    "p");
-                                $log_function("$details", "pre");
-                            } else {
-                                file_put_contents($thumb_folder_path .
-                                    "/$resource_detail.txt", $details);
-                            }
-                            break;
-                        }
                     }
+                } else {
+                    $log_function("*** ...does not***", "pre");
+                }
+            }
+            if (!empty($details)) {
+                $found_details = true;
+                if ($test_mode) {
+                    $log_function("*** Found below details ***",
+                        "p");
+                    $log_function("$details", "pre");
+                } else {
+                    file_put_contents($thumb_folder_path .
+                        "/$resource_detail.txt", $details);
                 }
             }
             if (!$found_details && !$test_mode) {
ViewGit