diff --git a/src/kleinanzeigen_bot/__init__.py b/src/kleinanzeigen_bot/__init__.py index b3c302d..3c25047 100644 --- a/src/kleinanzeigen_bot/__init__.py +++ b/src/kleinanzeigen_bot/__init__.py @@ -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("############################################") @@ -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: @@ -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",