book creation is now only creates if a edition or folder mentioned, not blindly all the volumes !
script deletes the old books
some models updated with new values
- Removed `light_color_code` from the Hadis and Transmitter serializers to streamline the API response.
- Updated the `ColorPaletteMixin` to simplify color management by eliminating the light color property, focusing on the main color code.
- Adjusted the serializers to reflect these changes, enhancing clarity and reducing redundancy in color representation.
- Introduced `ColorPaletteMixin` to centralize color choice fields and hex code properties across `HadisStatus`, `TransmitterReliability`, and `OpinionStatus` models.
- Updated the `color` field in these models to use the mixin, enhancing code reusability and maintainability.
- Modified serializers to include `main_color_code` and `light_color_code` properties for better color representation in API responses.
- Added a new migration to adjust the database schema for the updated models.
- Introduced the `EmbeddingSession` model to track the status and progress of embedding tasks, including fields for status, progress, processed items, and error messages.
- Created `EmbeddingSessionAdmin` to manage embedding sessions in the admin interface, featuring custom display methods for status badges and progress bars.
- Implemented background processing to trigger a FastAPI agent upon creating a new embedding session, enhancing the system's responsiveness and user experience.
- Added migrations to establish the new model in the database.
- Introduced a `share_link` property in the `Article`, `Hadis`, `Book`, `Podcast`, `Video`, and `Transmitter` models to generate shareable links based on their slugs.
- Updated corresponding serializers to include the `share_link` field as read-only.
- Added a management command to refresh share links for existing Hadis models, ensuring all instances have updated slugs and share links.
- Adjusted the `settings` to define `DOVODI_DOMAIN` for consistent link generation across models.
- Updated `get_children_count` method to calculate the total number of Hadiths in a category and its descendants instead of counting active children categories.
- Enhanced code clarity by removing commented-out code and providing detailed docstrings for the new logic.
- Introduced `add_english_context_category.py` to populate missing English titles and descriptions for HadisCategory.
- Added `english_context.py` to fill in missing English context for Hadith fields including title, narrator, translation, and description.
- Created `arabic_text.py` to replace Hadith text with authentic Arabic texts.
- Updated `CategorySerializer` to calculate the total number of Hadiths in a category and its descendants.
- Introduced a new command to evenly distribute source types across existing HadisCategory instances.
- Added a command to seed categories and collections in the library, relating existing books to them.
- Enhanced HadisCategory model to allow Unicode in slugs through a migration.
- Updated Nginx configuration to include a new location for proxying requests to a FastAPI agent.
- Added a COLOR_PALETTE dictionary to the HadisStatus model for color management.
- Introduced properties to retrieve main and light color codes based on the selected color.
- Updated HadisStatusSerializer to include read-only fields for main and light color codes.
- Enabled the population of books in the entrypoint script by uncommenting the relevant command.
- Updated the queryset filtering in TransmitterView to correctly filter by reliability slug instead of the reliability field directly.
- This change ensures that the API correctly interprets the status filter provided in the query parameters.
- Implemented HadisCategoryXMindView to retrieve a mind-map JSON structure for specific hadis categories.
- Added Swagger documentation detailing the endpoint's features, usage, and response structure.
- Updated URL routing to include the new endpoint for XMind format retrieval.
- Enhanced the HadisCategoryXMindView to support multi-language content and bookmark status for authenticated users.
- Enhanced the save methods in Hadis, HadisCategory, BookReference, Transmitter, and related models to ensure unique slug generation.
- Implemented robust error handling and fallback mechanisms for slug creation based on title fields, with timestamp-based fallbacks for empty or invalid titles.
- Removed unnecessary thumbnail handling from TransmittersAdmin and simplified the display_header method.
- Improved overall data integrity and consistency in slug management across the application.
- Introduced a new management command to seed OpinionStatus, TransmitterOpinion, and TransmitterOriginalText with multilingual data.
- Implemented logic to create opinion statuses with corresponding colors and titles in English, Farsi, and Russian.
- Added functionality to generate random opinions and original texts for transmitters, ensuring unique titles for each transmitter.
- Enhanced data handling for better integration with existing models and improved seeding process.
- Updated HadisCollectionAdmin and TransmittersAdmin to include a custom display header with thumbnail images.
- Modified list_display to show the new display_header method for better visual representation.
- Added thumbnail field to HadisCollection and Transmitters models, replacing FilerImageField with ImageField for improved image handling.
- Created a migration to alter the thumbnail fields in the database schema.
- Introduced custom forms for Hadis, HadisCollection, HadisTag, HadisStatus, HadisReference, and Transmitters models to utilize JSON editor widgets for better data management.
- Implemented schemas for various JSON fields including titles, descriptions, and addresses to enhance the admin interface.
- Updated list displays in admin classes to show the first text from JSON fields for improved readability.
- Added a management command to seed HadisStatus descriptions with multilingual definitions based on keywords.
- Introduced BookSubjectArea and BookType models with JSONField for titles.
- Added 'description' field to HadisStatus model.
- Updated BookReference model to include ManyToMany relationship with BookSubjectArea and a ForeignKey to BookType.
- Enhanced admin interfaces for HadisStatus, BookReference, and BookAuthor to accommodate new fields and improve usability.
- Introduced a new API endpoint to retrieve narrator layers associated with a specific hadis.
- Enhanced the HadisLayersView to fetch and return unique narrator layers, including their names, slugs, and descriptions.
- Updated serializers to include the slug in the TransmitterShortSerializer and added a new NarratorLayerSerializer for layer details.
- Improved response structure and Swagger documentation for better clarity on usage and expected outputs.
- Implemented inner atomic blocks to ensure that failures during the creation of NarratorLayer, TransmitterReliability, OpinionStatus, Transmitters, and related models do not affect the overall transaction.
- Improved logging to provide warnings for skipped records due to errors, enhancing feedback during the seeding process.
- Streamlined the creation process for authors and books, ensuring that existing records are utilized effectively while maintaining data integrity.
- Improved the process for identifying and fixing empty slugs in NarratorLayer by utilizing raw SQL for more reliable detection.
- Enhanced logging to provide clear feedback on the number of records found and fixed, including error handling for any issues encountered during the slug update.
- Streamlined the slug fixing logic to directly address problematic entries, improving overall data integrity in the seeding process.
- Enhanced the process for fixing empty slugs in NarratorLayer by checking all layers and providing detailed logging for problematic entries.
- Improved slug generation to ensure uniqueness and fallback options when names are not available.
- Streamlined the creation of narrator layers with better error handling and defensive programming practices to avoid skipping layers.
- Added warnings for insufficient narrator layers, prompting retrieval of existing records if necessary.
- Introduced a new phase to the seeding process to address existing data integrity issues before creating new records.
- Added functionality to fix empty and duplicate slugs for NarratorLayer, TransmitterReliability, and OpinionStatus models, ensuring unique identifiers.
- Enhanced logging to provide detailed feedback on the fixes applied during the seeding process, improving overall data quality.
- Refactored the slug generation process for NarratorLayer, TransmitterReliability, and OpinionStatus models to handle empty or invalid slugs more effectively.
- Implemented checks for existing records to prevent duplicates during the seeding process, improving data integrity.
- Enhanced error handling during the creation of authors and books, ensuring existing records are utilized when available.
- Updated logging to provide clearer feedback on the seeding process, including details on existing records and errors encountered.
- Enhanced the slug generation process in the TransmitterReliability and OpinionStatus models to include robust error handling, ensuring unique slugs are created even when the title is invalid or empty.
- Implemented a mechanism to fix duplicate slugs during the seeding process, ensuring data integrity and preventing conflicts.
- Updated the seeding command to handle existing records more efficiently, improving overall reliability and opinion status creation.
- Enhanced the narrator layer creation process to include error handling, ensuring that existing layers are retrieved if creation fails.
- Introduced a new migration to fix NarratorLayer records with empty or invalid slugs, generating slugs based on the name field or defaulting to a structured format.
- Improved slug conflict resolution to prevent duplicates during the migration process.