- Update AWS S3 adapter configuration to set the
access control list (ACL) to private for both
production and development environments.
- This ensures that the sitemap files are not publicly
accessible and are only retrievable by authorized
users or applications, improving security.
- Switch to the new s3 endpoint for improved access
- Comment out the previous internal endpoint for clarity
This change updates the s3 endpoint to ensure proper
connection and compatibility with the service. The
internal endpoint is commented out to avoid confusion.
- Change bucket name from today-ai-weather-hk-dev to
today-ai-weather-dev-hk
- Update the configuration for easier understanding and
consistency
This update modifies the S3 bucket name used in development
settings, improving clarity and aligning with naming
conventions.
- Change the AWS S3 region from Hong Kong to Shanghai for
both production and development environments.
- Update bucket names to reflect the new region.
- Modify the endpoint URLs to align with the new settings.
These changes ensure that the application interacts with the
correct resources in AWS and maintains compatibility with
services hosted in Hong Kong.
- Comment out the previous development database URL
- Implement a new PostgreSQL URL for production use
This change updates the database connection settings to ensure
that the application connects to the appropriate database in
different environments. Commenting out the old URL helps
prevent accidental usage while retaining it for reference.
- Modify AWS credentials to use 's3' instead of 'minio' for both production and development environments.
- Update associated initializers, environment configurations, and sitemap generator settings.
- Simplify the configuration retrieval by aligning with new standards for S3.
These changes ensure consistent access to AWS S3 resources and improve maintainability by aligning with updated environment variable practices.
- Ensure created weather art is deleted if an error occurs
- Log detailed error messages for better debugging
This change improves the stability of the weather art
generation process by ensuring that failed operations
release resources properly, preventing potential
memory leaks or database clutter.
- Moved image processing to after the weather_art assignment.
- This change guarantees that the webp and preview images are processed before returning the weather_art object.
- Resolves potential issues where image processing wouldn't occur if the returned value wasn't properly assigned initially.
- Add processing for webp_image and preview_image
This fix ensures that both webp and preview images of the weather art
are processed correctly after generation, resolving issues related to
image availability in the system.
- Wrap image tag with begin-rescue to catch errors
- Display fallback message when image fails to load
- Log error messages to Rails logger for debugging
This change improves the robustness of the image loading
feature in the arts view by handling potential exceptions
when loading images. Users will see a placeholder message
if the image fails to load, enhancing user experience and
ensuring that the application does not crash due to unhandled
image load errors.
- Increase MAX_DURATION to allow longer processing time.
- Double SLEEP_DURATION to reduce server load between runs.
- Raise PER_RUN_GENERATION_LIMIT to improve throughput.
These changes enhance the performance of the weather arts generation
job by allowing longer intervals and reducing the frequency of
interruptions while also accommodating additional requests per run.
- Increase SLEEP_DURATION from 10 seconds to 60 seconds
This change modifies the sleep duration used in the
BatchGenerateWeatherArtsWorker class, allowing for longer
wait times between executions. This may help prevent
exceeding resource limits during high-demand periods.
- Update `format_as_tag` method to replace hyphens with
underscores in addition to spaces.
- Ensure the method handles blank inputs properly.
This change improves the consistency of tag formatting by
ensuring that both spaces and hyphens are converted into
underscores, enhancing the usability and reliability of
this helper method.
- Update formatting to replace spaces with underscores
- Add functionality to replace hyphens with underscores
- Clarify comments to reflect new formatting behavior
These changes improve the flexibility of the tag formatting method by
allowing both spaces and hyphens to be standardized as underscores,
ensuring consistent tag representations.
- Update region access to use country.region instead of city.region
- Update subregion access to use country.subregion instead of city.subregion
These changes ensure that the region and subregion are accurately retrieved based on the correct geographical hierarchy, improving the data integrity of the application.
- Include formattedDate in the RSS feed response
- Utilize art.formatted_time method for better date formatting
This change enhances the RSS feed by providing a more user-friendly
formatted date alongside the existing weather date. This allows
clients consuming the RSS feed to display dates in a more readable
format, improving overall usability.
- Change route for RSS feed to use defaults for format
- Add logging to RssController#feed to track request format
These changes improve the clarity of the routing for the RSS feed
and enhance debugging capabilities by logging the request format.
The new route definition ensures that the feed responds correctly
with the default format, while the logging provides insight into
how the feed is being accessed.
- Implement JSON feed generation in the RssController
- Add new API endpoint to serve JSON feed
- Update RSS feed view to include hidden machine-readable data
This commit introduces a new feature that allows the application to
serve weather art data in JSON format. The JSON feed includes
metadata such as the title, description, and additional custom
fields for better integration with other services. The changes
also enhance the existing RSS feed by embedding machine-readable
data within the HTML structure, improving accessibility and
usability for automated systems.
- Add custom XML namespace for weather data
- Include additional weather fields: country, city, state,
weather description, prompt, and formatted date
- Update enclosure type to 'image/webp' for better
compatibility
This update improves the RSS feed by providing more detailed
weather information for each art piece, enhancing the
user experience and ensuring better data representation.
The new fields allow for richer content in the feed, making
it more informative for users.
- Include image attachments and city associations in the
RSS feed query to improve performance.
- This change reduces the number of database queries
needed when rendering the feed, addressing potential
N+1 query problems.
- Add country name, city name, and state name to the RSS feed
- Include weather description and AI-generated description
- Add weather date to provide more context for each item
These changes improve the RSS feed by providing more detailed
information about the weather art, enhancing the user experience
and making the feed more informative for subscribers.
- Include data-hashtag attribute in the Facebook share button
- Comment out an alternative database URL in credentials
This update enhances the social sharing feature by allowing
users to include hashtags when sharing content on Facebook.
The commented-out database URL serves as a reference for
future configurations.
- Removed the language switcher component from the
navigation bar.
- This change simplifies the user interface, focusing
on primary navigation elements.
The decision was made to streamline navigation and reduce
clutter, as the language switcher was deemed not essential
for the current user experience.
- Include region, country, state, and query parameters
in the pagination helper for better filtering.
- This change enhances the user experience by allowing
users to navigate through weather arts based on
specific criteria, improving the relevance of the
displayed results.
- Update cities controller to include state in city data
- Modify results partial to pass pagination parameters
- Adjust index view to support turbo frame actions
These changes improve the pagination functionality by ensuring
that the correct parameters are passed for filtering cities
based on region, country, and state. This enhances the user
experience by providing more relevant data and better
navigation through the city listings.
- Update city initialization to safely access state ID
- Use safe navigation operator to prevent potential nil errors
This change ensures that if the state is nil, the code will not raise
an error when trying to access its ID. It improves the robustness of
the city data synchronization process.
- Use `find_or_initialize_by` to ensure uniqueness based on
multiple attributes.
- Replace multiple `update!` calls with `assign_attributes` for
better readability and maintainability.
- Add error handling for city saving process to log errors
if saving fails.
These changes streamline the city syncing process, making it
more efficient and easier to understand while ensuring that
cities are created or updated correctly based on unique
attributes.
- Define a new Rake task `sync_city` to synchronize city data
- Update the `find_or_create_by!` method to include additional
attributes such as `flag`, `wiki_data_id`, `active`, and
`priority`
This new task allows for better management of city data by
ensuring that all relevant attributes are set during the
synchronization process. It enhances the existing functionality
by providing more detailed information for each city.
- Change country_code to country_id for better clarity
- Add state_id to the city creation process
These changes ensure that the City model is created with the correct
associations to country and state, improving data integrity.
This refactor also enhances the readability of the code.
- Update city creation to include country and state codes
- Ensure that the country and state are fetched correctly
- Use safe navigation to avoid nil errors
This change enhances the city creation process by ensuring that
country and state codes are properly associated with the city,
improving data integrity and consistency.
- Add assignment for country_id in state update
This change ensures that the country_id is correctly set when
updating state information, improving the accuracy of the
data synchronization process.
- Update country lookup to use safe navigation operator
- Ensure state creation uses safe access for country attributes
These changes prevent potential errors when the country data is
not available, improving the reliability of the geo data sync
process.
- Change cities_path to include both region and country
- Update active class logic to reflect current state
This fix ensures that the dropdown links correctly point to the
appropriate cities based on the selected region and country,
improving navigation and user experience.
- Implement state filtering in the CitiesController
- Add new scope `by_state` in the City model
- Update cities index view to include state dropdown
- Add slug column to states for friendly URLs
- Update English locale to include 'All States'
This commit enhances the cities index page by allowing users to
filter cities based on the selected state. It introduces a new
scope in the City model for state filtering and updates the
view to present a dropdown for state selection. Additionally,
it adds a slug column to the states table to support friendly
URLs, improving the overall user experience.
- Change from using `get_object` to `head_object` to check if the
sitemap file exists before attempting to retrieve it.
- Implement a presigned URL for accessing the sitemap, which is valid
for 15 minutes.
- Set cache headers to allow for 1 hour of caching.
- Improved logging for better error tracking and debugging.
This change enhances the efficiency of sitemap retrieval by reducing
unnecessary data transfer and provides a more secure way to access
the sitemaps through presigned URLs. It also improves error handling
by logging specific errors related to missing sitemaps.
- Implement index action to list sitemaps
- Create view for displaying sitemaps with details
- Add helper method for generating sitemap URLs
- Enhance error handling for S3 service errors
This commit introduces a new feature for managing sitemaps in the application. It includes an index view that lists all available sitemaps with their last modified date and size, along with a link to view each sitemap. The error handling for S3 interactions has also been improved to log errors and return appropriate responses.
- Ensure consistent formatting in the long date string
- No functional changes were made, only a formatting adjustment
This commit addresses a minor formatting issue in the Arabic locale file, ensuring that the long date format is consistent with the expected output. No changes to functionality or behavior were introduced.
- Update available locales to include Bengali, Hindi, Urdu, and Arabic
- Add new locale files for each language with translations for UI elements
- Ensure the application can now support a wider audience by providing
localized content
This change enhances the application's accessibility and usability for
users who speak these languages, allowing for a more inclusive user
experience. The new translations cover key UI components and messages,
ensuring that users can interact with the application in their native
languages.
- Update dropdown to support dynamic locales from I18n
- Limit dropdown height with overflow handling for better UX
This change improves the language switcher by dynamically
loading available locales from the I18n configuration. It
also enhances the user experience by limiting the height
of the dropdown and enabling scrolling, making it easier
to navigate through multiple language options.
- Extend available locales in the application to include:
- Portuguese (Brazil)
- Croatian
- Persian
- German
- Spanish
- French
- Italian
- Turkish
- Russian
- Ukrainian
- Polish
- Create new locale files for each language with appropriate translations.
- Update existing locale files to include new languages.
This update enhances the application's accessibility by supporting a wider range of languages, allowing users from different regions to interact with the application in their native language.
- Introduce default, short, and long date formats
- Enhance date representation for better user experience
This update allows the application to display dates in multiple formats,
including a default format of 'YYYY-MM-DD', a short format of
'"MMM DD"', and a long format of '"Month DD, YYYY"'. This
improves localization support and user interface flexibility.
- Refactor keywords in cities_controller.rb
- Refactor keywords in weather_arts_controller.rb
- Refactor keywords in application.html.erb
This change improves the SEO of the application by updating
keywords to include 'ai' and 'ai web', which are more relevant
and likely to enhance search visibility. The previous keywords
were less optimized for current trends in AI-related searches.
- Modify keywords in cities_controller.rb to include 'ai weather'
- Update keywords in weather_arts_controller.rb to include 'ai weather'
- Change keywords in application.html.erb to include 'ai weather'
These changes enhance the search engine optimization (SEO) of the
application by ensuring that relevant keywords are included in
meta tags, improving visibility for users searching for AI
weather-related content.
- Modify keywords in CitiesController for better
categorization of AI art and weather art.
- Update keywords in WeatherArtsController to include
city country name and description.
- Add keywords in application layout for overall site
SEO improvement.
These changes aim to improve search engine visibility
and better describe the content related to AI-generated
weather art.