Skip to content
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

feat: download all and single Surah #1355

Merged
merged 17 commits into from
Oct 7, 2024

Conversation

YassinNouh21
Copy link
Contributor

📝 Summary


This PR addresses the enhancements and bug fixes for the Surah Player functionality.

Description

This update introduces several key features and improvements to the Surah Player, including:

  • Single Surah Download: Users can now download individual Surahs directly from the Surah selection screen.
  • Download All Functionality: Added an option to download all Surahs at once.
  • Focus Node Enhancements: Improved focus handling in the selection screen for better accessibility.
  • Bug Fixes: Resolved issues related to back navigation in the Quran player and late initialization of the playlist.
  • Refactoring: Cleaned up code for better readability and maintainability, including the removal of unnecessary components and enhancements to state management.

Tests

🧪 Use case 1

download


💬 Description:

  1. Navigate to the Surah Selection Screen.
  2. Test the download functionality for individual Surahs and the "Download All" button.
  3. Ensure that focus handling works correctly when navigating through Surah cards.

📷 Screenshots or GIFs (if applicable):

  • [Attach relevant screenshots or GIFs here]

Checklist:

  • Coding Standards: I have reviewed my code to ensure it follows the project's coding standards.
  • Testing: I have tested the changes and they work as expected.
  • Merge Conflicts: I have resolved any merge conflicts with the latest main/development branch.
  • Branch Status: The branch is up-to-date with the target branch (main/development).

# Conflicts:
#	lib/l10n/intl_en.arb
#	lib/src/data/data_source/quran/reciter_local_data_source.dart
#	lib/src/data/repository/quran/recite_impl.dart
#	lib/src/domain/error/recite_exception.dart
#	lib/src/pages/quran/page/reciter_selection_screen.dart
#	lib/src/pages/quran/page/surah_selection_screen.dart
- **Removed**: The `RiwayatModel` class, which has been deemed unnecessary in the current architecture.
- **Updated**: Various files across the codebase to replace occurrences of `riwayahId` with `moshafId`, reflecting the new terminology.
- **Changes in Data Handling**: Adjusted methods in `reciter_local_data_source.dart`, `quran_audio_player_notifier.dart`, and related classes to ensure all functionality correctly references `moshafId` instead of `riwayahId`.
- **UI Updates**: Updated UI code in `reciter_selection_screen.dart`, `surah_selection_screen.dart`, and `surah_card.dart` to use `moshaf` instead of `riwayah`, ensuring consistency throughout the user interface.
- **Improved Readability**: Enhanced code clarity by renaming variables and methods where needed, making future maintenance easier.

This refactor aims to streamline the codebase and align with the new vocabulary for Quranic text recitation, improving overall code quality and maintainability.
…nd Refactor State Management

- **Added**: `SurahDownloadInfo` class to encapsulate download progress for individual Surahs, improving clarity and maintainability.
- **Refactored**: `DownloadAudioQuranState` to include `reciterId`, `moshafId`, and a list of `downloadingSuwar`, simplifying the state management for downloads.
- **Updated**: Methods in `DownloadStateNotifier` to utilize the new `SurahDownloadInfo` structure for tracking download progress.
- **Modified**: The `surah_selection_screen` to integrate the refactored state management, ensuring the UI reflects download progress accurately for each Surah.
- **Improved**: Download logic in `quran_audio_player_notifier` and related files to utilize the new `DownloadStateProviderParameter`, enhancing the modularity of the download process.
Copy link
Contributor

@ghassenbenzahra123 ghassenbenzahra123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@ghassenbenzahra123 ghassenbenzahra123 merged commit 95947fd into main Oct 7, 2024
1 check passed
@ghassenbenzahra123 ghassenbenzahra123 deleted the feat/rebased-download-quran branch October 7, 2024 12:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants