Skip to content

Update bookmark#812

Closed
tenkus47 wants to merge 274 commits into
mainfrom
update_bookmark
Closed

Update bookmark#812
tenkus47 wants to merge 274 commits into
mainfrom
update_bookmark

Conversation

@tenkus47

Copy link
Copy Markdown
Member

No description provided.

Lungsangg and others added 30 commits June 12, 2026 16:30
- Introduced a new endpoint for uploading audio files associated with subtasks, returning relevant details upon success.
- Added a corresponding endpoint for deleting subtask audio files.
- Updated response models to include SubTaskAudioUploadResponse.
- Enhanced tests to cover new audio upload and deletion functionalities.
- Introduced tests to validate error handling when GEMINI_API_KEY is missing in TTS audio generation.
- Added new tests for successful day audio upload scenarios, including validation for missing parameters.
- Enhanced caching tests for segment translations and commentaries to ensure proper cache hits and misses.
- Updated text detail retrieval tests to incorporate caching logic for improved performance.
- Implemented tests to verify that the `generate_tts_audio` function raises appropriate errors when the API key is missing or when no inline audio data is provided.
- Added a test to ensure the preview endpoint returns a 502 status code for runtime errors related to audio generation.
- Enhanced existing tests for segment mapping and text detail retrieval to improve coverage and reliability.
- Added helper functions to streamline the creation of mock responses for TTS audio generation tests.
- Refactored existing tests to utilize these new utilities, improving readability and maintainability.
- Updated tests to ensure proper handling of audio generation scenarios, including missing inline data and candidates.
Implement caching for text and segment retrieval functions
Add subtask audio upload and deletion endpoints
- Added caching mechanisms for retrieving table of contents and translations by segment ID, improving performance by reducing redundant database calls.
- Updated service methods to check for cached data before querying the database, enhancing efficiency.
- Refactored related tests to validate caching behavior and ensure proper handling of cache hits and misses.
tenkus47 and others added 25 commits June 23, 2026 17:54
Add video details to user plan day response model
- Introduced `clone_series_plans_for_language` to deep-copy active plans from a source language to a target language within the same series.
- Updated the `CloneSeriesPlansRequest` model to validate that source and target languages are different.
- Enhanced the `_clone_plan` function to support language-specific cloning.
- Added new endpoint in `series_view.py` for cloning plans via API.
- Implemented tests to verify cloning behavior and edge cases.
- Added `reference_start_date_for_series_plans` function to determine the canonical start date from the first active plan in a series, excluding specified plans.
- Updated `_apply_create_plan_series_fields` to set the plan's start date based on the reference start date if available.
- Enhanced `update_series_with_plans` to update the start date of newly attached plans when applicable.
- Introduced `_REFERENCE_START_DATE_UNSET` constant to handle unset reference dates.
- Added `group_id` as an optional field in the `SeriesDTO` model to support grouping of series.
- Updated the `_series_to_dto` function to include `group_id` when converting series data to DTO format.
Add functionality to clone series plans between languages
- Integrated SlowAPI for rate limiting in the FastAPI application.
- Updated configuration to enable rate limiting with customizable parameters for authenticated and unauthenticated requests.
- Registered rate limiting middleware in the application to enforce limits on API usage.
- Added SlowAPI as a dependency in the project.
- Removed the filter for `deleted_at` in the `_user_mantra_counts_query` function to ensure soft-deleted accumulators are included in the results.
- Added a test case to verify that the query correctly excludes the `deleted_at` filter, ensuring the integrity of user mantra counts.
…acking

- Updated `get_highest_streak` to use SQL queries for better performance and accuracy.
- Introduced `get_user_activity_totals` to aggregate timer duration, accumulated counts, and completed plan days in a single query.
- Modified `record_daily_log_if_needed` to accept a database session as an argument for improved session management.
- Adjusted user stats service to utilize the new activity totals function, streamlining data retrieval for user statistics.
- Updated tests to reflect changes in the repository and service methods, ensuring accurate coverage of new functionality.
- Introduced caching for user statistics with a new timeout configuration.
- Implemented functions to set, get, and invalidate user stats cache in the daily log cache service.
- Updated daily log service to utilize the new caching mechanism for user stats.
- Modified accumulator service to invalidate user stats cache upon updates.
- Enhanced tests to cover new caching behavior and ensure proper functionality of user stats retrieval and invalidation.
- Deleted the rate limiting middleware and its associated configuration from the application.
- Removed references to rate limiting in the configuration file and application code.
- Eliminated related tests and fixtures to ensure a clean removal of rate limiting features.
- Updated dependencies by removing the `slowapi` package from the project.
Add user stats caching and invalidation functionality
- Introduced BookmarkFilterType enum to categorize bookmarks by TEXT, PLAN, SERIES, ACCUMULATOR, and TIMER.
- Updated get_bookmarks_by_user_id function to filter bookmarks based on the new BookmarkFilterType.
- Enhanced get_bookmarks_service to enrich bookmarks with additional data when filtered by TEXT.
- Modified BookmarkDTO to include new fields for text and segment information.
- Added tests to validate the new filtering functionality and ensure proper enrichment of text bookmarks.
- Introduced a new pytest plugin configuration in pyproject.toml to integrate the bookmark coverage plugin.
- This addition enhances testing capabilities for the bookmark-related functionalities in the application.
- Updated the test for creating a new plan with a series ID to verify that the series lookup is called twice with the correct database session and series ID.
- Improved assertions to ensure the integrity of the series retrieval logic in the test case.
- Removed the check for unsupported languages in the TTS audio generation function, allowing for non-Tibetan languages to be processed.
- Updated tests to validate the handling of non-Tibetan languages and ensure correct audio generation.
- Enhanced test coverage for TTS audio generation routes, confirming proper responses for various language inputs.
@tenkus47 tenkus47 requested a review from Tech-lo June 25, 2026 13:47
@greptile-apps

greptile-apps Bot commented Jun 25, 2026

Copy link
Copy Markdown

Too many files changed for review. (326 files found, 100 file limit)

@tenkus47 tenkus47 closed this Jun 25, 2026
@tenkus47 tenkus47 deleted the update_bookmark branch June 25, 2026 13:50
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants