Refactoring LiveMetrics to avoid photo.album_id requirement.#3356
Merged
Refactoring LiveMetrics to avoid photo.album_id requirement.#3356
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
🚀 New features to boost your workflow:
|
e5811d5 to
a745953
Compare
3703cc3 to
e813c38
Compare
a745953 to
9e97597
Compare
e813c38 to
273a3f3
Compare
9e97597 to
659305c
Compare
659305c to
877f658
Compare
a921deb to
ecc738c
Compare
JasonMillward
approved these changes
Jun 7, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces significant changes to the metrics and event handling system, alongside updates to request handling for improved flexibility and consistency. Key changes include the creation of base classes for metrics events, the addition of a
from_idattribute for better tracking, and refactoring of query logic in metrics retrieval.Event System Refactoring:
BaseAlbumMetricsEventandBasePhotoMetricsEventclasses to centralize shared logic for album and photo-related metrics events, such as thekey()method andtoArray()method. [1] [2]AlbumDownload,AlbumShared,AlbumVisit,PhotoDownload,PhotoFavourite,PhotoShared,PhotoVisit) to extend the new base classes, removing redundantkey()method implementations. [1] [2] [3] [4] [5] [6] [7]Request Handling Enhancements:
HasFromIdinterface andHasFromIdTraitto standardize the handling of afrom_idattribute in requests. [1] [2]ZipRequestandPhotoMetricsRequestto implementHasFromId, enabling the use offrom_idfor additional context in metrics-related operations. [1] [2]Metrics Query Optimization:
GetMetrics.phpby adding a safeguard to exclude nullalbum_idvalues and simplifying conditions forvisitactions.selectclause for cleaner and more maintainable queries.Controller Updates:
from_idin event dispatch calls, ensuring that this additional context is passed to metrics events. [1] [2] [3] [4]Miscellaneous:
LiveMetricsResourceby removing fallback logic foralbum_idand photo URLs, assuming data consistency.