Add flow backend
This pull request introduces a new feature called "Flow," which provides a way to query, display, and interact with albums in a dynamic and configurable manner. The changes include the creation of new classes, enums, and resources, as well as modifications to existing models and configurations to support the Flow feature.
New Feature: Flow
Core Functionality
-
Added the
Flowclass inapp/Actions/Albums/Flow.phpto handle querying albums based on various configurations, such as NSFW filtering, sub-album inclusion, and ordering by publication or creation date. This class also defines the logic for building album queries. -
Introduced the
FlowControllerinapp/Http/Controllers/Gallery/FlowController.phpto handle HTTP requests related to Flow, including initialization and paginated album results. -
Created the
FlowRequestclass inapp/Http/Requests/Flow/FlowRequest.phpto handle request authorization based on Flow settings and user authentication.
Supporting Resources
-
Added
FlowItemResource,FlowResource, andInitResourceinapp/Http/Resources/Flow/to structure the data returned by Flow-related endpoints, including album details, pagination, and initialization settings. [1] [2] [3] -
Updated
ModulesRightsResourceto include a flag indicating if the Flow module is enabled. [1] [2]
Enum and Exception Additions
-
Introduced
FlowStrategyandCoverFitTypeenums to define Flow-specific strategies (e.g.,AUTO,OPT_IN) and cover image fitting options (COVER,FIT). [1] [2] -
Added
InvalidAlbumExceptionto handle cases where an invalid album type is provided in Flow operations.
Model Updates
- Updated the
AlbumandBaseAlbumImplmodels to include new attributes (is_recursive_nsfw,published_at) and support Flow-related queries. [1] [2] [3] [4]
Configuration and Middleware
-
Extended
ConfigIntegrityto include new Flow-specific configuration keys, such asflow_strategy,flow_include_sub_albums, andflow_min_max_enabled. -
Updated
RouteCacheManagerto exclude Flow-related routes from caching or apply specific caching configurations.
These changes collectively provide a robust framework for implementing the Flow feature, enabling dynamic and configurable album browsing and interaction.
Codecov Report
Attention: Patch coverage is 95.69892% with 8 lines in your changes missing coverage. Please review.
Project coverage is 90.11%. Comparing base (
9084815) to head (d38bf01). Report is 7 commits behind head on master.
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
- :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.