mirror of
https://github.com/Second-Hand-Friends/kleinanzeigen-bot.git
synced 2026-03-12 02:31:45 +01:00
fix: publishing contact fields and download stability (#771)
## ℹ️ Description - Link to the related issue(s): Issue #761 - Describe the motivation and context for this change. - This PR bundles several small fixes identified during recent testing, covering issue #761 and related publishing/download edge cases. ## 📋 Changes Summary - Avoid crashes in `download --ads=new` when existing local ads lack an ID; skip those files for the “already downloaded” set and log a clear reason. - Harden publishing contact fields: clear ZIP before typing; tolerate missing phone field; handle missing street/name/ZIP/location gracefully with warnings instead of aborting. - Improve location selection by matching full option text or the district suffix after ` - `. - Preserve `contact.location` in defaults (config model + regenerated schema with example). ### ⚙️ Type of Change Select the type(s) of change(s) included in this pull request: - [x] 🐞 Bug fix (non-breaking change which fixes an issue) - [ ] ✨ New feature (adds new functionality without breaking existing usage) - [ ] 💥 Breaking change (changes that might break existing user setups, scripts, or configurations) ## ✅ Checklist Before requesting a review, confirm the following: - [x] I have reviewed my changes to ensure they meet the project's standards. - [x] I have tested my changes and ensured that all tests pass (`pdm run test`). - [x] I have formatted the code (`pdm run format`). - [x] I have verified that linting passes (`pdm run lint`). - [x] I have updated documentation where necessary. By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit ## Release Notes * **New Features** * Added optional location field to contact configuration for specifying city/locality details in listings. * Enhanced contact field validation with improved error handling and fallback mechanisms. * **Bug Fixes** * Ad download process now gracefully handles unpublished or manually created ads instead of failing. * **Documentation** * Clarified shipping type requirements and cost configuration guidance in README. <sub>✏️ Tip: You can customize this high-level summary in your review settings.</sub> <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -304,6 +304,22 @@
|
||||
"default": null,
|
||||
"title": "Zipcode"
|
||||
},
|
||||
"location": {
|
||||
"anyOf": [
|
||||
{
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
],
|
||||
"default": null,
|
||||
"description": "city or locality of the listing (can include multiple districts)",
|
||||
"examples": [
|
||||
"Sample Town - District One"
|
||||
],
|
||||
"title": "Location"
|
||||
},
|
||||
"phone": {
|
||||
"anyOf": [
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user