Closed (fixed)
Project:
Lite Youtube
Version:
1.0.2
Component:
Code
Priority:
Minor
Category:
Task
Assigned:
Reporter:
Created:
9 Jun 2025 at 20:50 UTC
Updated:
17 Jun 2025 at 17:30 UTC
Jump to comment: Most recent
The `isApplicable()` method in the `LiteYoutubeFormatter` class loads the entire `MediaType` entity solely to check the source. This approach may be inefficient and could be optimized to improve performance.
None expected, as this change pertains to backend performance optimization.
None expected.
None.
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
ruby232 commentedComment #4
jleon1110 commentedAfter reviewing this issue and analyzing the implementation of the isApplicable() method, I noticed that there is a redundant block of code that performs an entity query to check if the media type exists:
I think this part of the code is unnecessary, as the media type is already validated later using \Drupal::config('media.type.' . $media_type_id). Additionally, the result of this query is not used anywhere else in the method.
Comment #5
jleon1110 commentedWhen this block is remove:
I think the solution works fine and can be merged.
Comment #6
jleon1110 commentedThe block was removed I think this solution can by merged.
Comment #9
ruby232 commentedComment #10
ruby232 commented