Skip to content

Add flow backend #3446

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 1, 2025
Merged

Add flow backend #3446

merged 2 commits into from
Jul 1, 2025

Conversation

ildyria
Copy link
Member

@ildyria ildyria commented Jun 13, 2025

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 Flow class in app/Actions/Albums/Flow.php to 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 FlowController in app/Http/Controllers/Gallery/FlowController.php to handle HTTP requests related to Flow, including initialization and paginated album results.

  • Created the FlowRequest class in app/Http/Requests/Flow/FlowRequest.php to handle request authorization based on Flow settings and user authentication.

Supporting Resources

  • Added FlowItemResource, FlowResource, and InitResource in app/Http/Resources/Flow/ to structure the data returned by Flow-related endpoints, including album details, pagination, and initialization settings. [1] [2] [3]

  • Updated ModulesRightsResource to include a flag indicating if the Flow module is enabled. [1] [2]

Enum and Exception Additions

  • Introduced FlowStrategy and CoverFitType enums to define Flow-specific strategies (e.g., AUTO, OPT_IN) and cover image fitting options (COVER, FIT). [1] [2]

  • Added InvalidAlbumException to handle cases where an invalid album type is provided in Flow operations.

Model Updates

  • Updated the Album and BaseAlbumImpl models to include new attributes (is_recursive_nsfw, published_at) and support Flow-related queries. [1] [2] [3] [4]

Configuration and Middleware

  • Extended ConfigIntegrity to include new Flow-specific configuration keys, such as flow_strategy, flow_include_sub_albums, and flow_min_max_enabled.

  • Updated RouteCacheManager to 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.

@ildyria ildyria requested a review from a team as a code owner June 13, 2025 11:15
@ildyria ildyria added the Review: easy Easy review expected: probably just need a quick to go through. label Jun 13, 2025
Copy link

codecov bot commented Jun 13, 2025

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.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ildyria ildyria marked this pull request as draft June 14, 2025 09:54
Base automatically changed from home-redirect to master June 14, 2025 10:18
@ildyria ildyria added Review: medium Medium review expected: not many files, some attention to details required. and removed Review: easy Easy review expected: probably just need a quick to go through. labels Jun 14, 2025
@ildyria ildyria marked this pull request as ready for review June 15, 2025 18:45
@ildyria ildyria force-pushed the flow/backend branch 3 times, most recently from fad1720 to 6e4ef4d Compare June 23, 2025 18:35
@ildyria ildyria added the alpha-ready Branch is available in alpha label Jun 23, 2025
@ildyria ildyria merged commit 58caba6 into master Jul 1, 2025
35 checks passed
@ildyria ildyria deleted the flow/backend branch July 1, 2025 10:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
alpha-ready Branch is available in alpha Review: medium Medium review expected: not many files, some attention to details required.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants