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

Fix for error #353 and #351 #354

Merged
merged 2 commits into from
Dec 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/kleinanzeigen_bot/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,9 @@ async def publish_ads(self, ad_cfgs:list[tuple[str, dict[str, Any], dict[str, An
await self.publish_ad(ad_file, ad_cfg, ad_cfg_orig)
await self.web_await(lambda: self.web_check(By.ID, "checking-done", Is.DISPLAYED), timeout = 5 * 60)

if self.config["publishing"]["delete_old_ads"] == "AFTER_PUBLISH" and not self.keep_old_ads:
await self.delete_ad(ad_cfg, False)

LOG.info("############################################")
LOG.info("DONE: (Re-)published %s", pluralize("ad", count))
LOG.info("############################################")
Expand Down Expand Up @@ -564,7 +567,7 @@ async def publish_ad(self, ad_file:str, ad_cfg: dict[str, Any], ad_cfg_orig: dic
except TimeoutError as ex:
LOG.debug(ex, exc_info = True)
elif ad_cfg["shipping_options"]:
await self.web_click(By.CSS_SELECTOR, '[class*="jsx-2623555103"]')
await self.web_click(By.CSS_SELECTOR, '[class*="jsx-963945432"]')
await self.web_click(By.CSS_SELECTOR, '[class*="CarrierSelectionModal--Button"]')
await self.__set_shipping_options(ad_cfg)
else:
Expand Down Expand Up @@ -692,9 +695,6 @@ async def publish_ad(self, ad_file:str, ad_cfg: dict[str, Any], ad_cfg_orig: dic

utils.save_dict(ad_file, ad_cfg_orig)

if self.config["publishing"]["delete_old_ads"] == "AFTER_PUBLISH" and not self.keep_old_ads:
await self.delete_ad(ad_cfg, False)

async def __set_condition(self, condition_value: str) -> None:
condition_mapping = {
"new_with_tag": "Neu mit Etikett",
Expand Down