Open nsandlin opened 3 years ago
Would it simplify things to exclude non-Image multimedia records entirely?
e.g. For the Search Import, if the record resource type is NOT "Image", then do not add it to the search.
Well, that would be simpler than three separate ifs (and possibly more later). Apparently we don't need them, because it looks like Multimedia.php is getting the info from the main MM record (below). For type, are you looking at the DetResourceType field? That is all either Stillimage or URL now.
public function getCollectionRecordURL($record): string
{
$firstfour = "";
// If the attached Multimedia record is an external link, return that URL.
if (!empty($record['RelRelatedMediaRef_tab'][0])) {
$firstfour = substr($record['RelRelatedMediaRef_tab'][0]['MulIdentifier'], 0, 4);
if ($firstfour == "http") {
return $record['RelRelatedMediaRef_tab'][0]['MulIdentifier'];
}
} [...]
What if the criteria for the SearchImport was as simple as:
if != URL
Would that work for us?
Looks like that did work, and we just neglected to close the ticket.
Question: Should we maybe go back to if == Stillimage rather than if != url, since now I need to upload images to include in the new project narrative pages. The crops and dimensions are different from the ones in the gallery (reworked to have a clean, consistent look on the page with text), and we don't want them to show up in the gallery. Then I could make the DetResourceType just "Image" instead of Stillimage so the import would skip them. Or do you have a better idea?
Should I be making this change on the new dev site or on the "old", current site?
Just the new! I just highjacked this old issue to reuse the background.
Ok, no problem! So, quick question, which field stores the Stillimage info?
For this: if == Stillimage
DetResourceType
On Tue, Sep 10, 2024 at 3:52 PM Pete Herbst @.***> wrote:
Ok, no problem! So, quick question, which field stores the Stillimage info?
For this: if == Stillimage
— Reply to this email directly, view it on GitHub https://github.com/nsandlin/linepig/issues/56#issuecomment-2341988828, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABISACOVVFVMWJ7ISDEBWGTZV5LXFAVCNFSM6AAAAABNSWHSQWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNBRHE4DQOBSHA . You are receiving this because you modified the open/close state.Message ID: @.***>
Now that all non-url Mulitmedia records have a DetResourceType "Stillimage" value, can we use that to correct the count (which currently includes the urls)? This variable is $resultsCount in search-results.blade.php, which comes from a count (by Keywords, Genus, or Species) in SearchController.php.
Include the field in emuconfig.search_fields, eg as imgtype
Add it to DB::insert in SearchImport.php
In SearchController.php, modify public function getDBQuery($genus, $species, $keywords) to include an if image == Stillimage, something like
From: $query->where('genus', '=', trim($genus)); To: $query->where('imgtype', '=' && 'genus', '=', trim($genus));