Skip to content

Commit

Permalink
remove mindstar
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan Brugger committed May 12, 2024
1 parent 7e3b1ff commit d911edb
Show file tree
Hide file tree
Showing 9 changed files with 4 additions and 35 deletions.
5 changes: 4 additions & 1 deletion .run/feed.run.xml → .run/run_feed_parser.run.xml
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="run_feed_parser" type="PythonConfigurationType" factoryName="Python" nameIsGenerated="true">
<module name="mydealz_bot" />
<option name="ENV_FILES" value="" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
<envs>
<env name="PYTHONUNBUFFERED" value="1" />
</envs>
<option name="SDK_HOME" value="$PROJECT_DIR$/venv/bin/python" />
<option name="SDK_NAME" value="Python 3.12 (mydealz_bot)" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<option name="IS_MODULE_SDK" value="false" />
<option name="IS_MODULE_SDK" value="true" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/run_feed_parser.py" />
<option name="PARAMETERS" value="" />
<option name="SHOW_COMMAND_LINE" value="false" />
Expand Down
1 change: 0 additions & 1 deletion src/db/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
UColumns.FIRST_NAME: 'TEXT',
UColumns.LAST_NAME: 'TEXT',
UColumns.SEARCH_MYDEALZ: 'BOOL DEFAULT 1',
UColumns.SEARCH_MINDSTAR: 'BOOL DEFAULT 1',
UColumns.SEARCH_PREISJAEGER: 'BOOL DEFAULT 1',
UColumns.SEND_IMAGES: 'BOOL DEFAULT 1',
UColumns.ACTIVE: 'BOOL DEFAULT 1',
Expand Down
1 change: 0 additions & 1 deletion src/db/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ class UColumns(Columns):
FIRST_NAME = 'first_name'
LAST_NAME = 'last_name'
SEARCH_MYDEALZ = 'search_md'
SEARCH_MINDSTAR = 'search_ms'
SEARCH_PREISJAEGER = 'search_pj'
ACTIVE = 'active'
SEND_IMAGES = 'send_images'
Expand Down
3 changes: 0 additions & 3 deletions src/db/tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ def _parse_row(self, row: RowType) -> UserModel:
user.first_name = str(row[UColumns.FIRST_NAME])
user.last_name = str(row[UColumns.LAST_NAME])
user.search_mydealz = bool(row[UColumns.SEARCH_MYDEALZ])
user.search_mindstar = bool(row[UColumns.SEARCH_MINDSTAR])
user.search_preisjaeger = bool(row[UColumns.SEARCH_PREISJAEGER])
user.send_images = bool(row[UColumns.SEND_IMAGES])
user.active = bool(row[UColumns.ACTIVE])
Expand All @@ -118,7 +117,6 @@ async def upsert_model(self, user: UserModel) -> None:
UColumns.FIRST_NAME: user.first_name,
UColumns.LAST_NAME: user.last_name,
UColumns.SEARCH_MYDEALZ: user.search_mydealz,
UColumns.SEARCH_MINDSTAR: user.search_mindstar,
UColumns.SEARCH_PREISJAEGER: user.search_preisjaeger,
UColumns.SEND_IMAGES: user.send_images,
UColumns.ACTIVE: user.active,
Expand Down Expand Up @@ -164,7 +162,6 @@ def _parse_row(self, row: dict[NColumns | UColumns, Any]) -> NotificationModel:
notification.search_only_hot = bool(row[NColumns.ONLY_HOT])
notification.search_description = bool(row[NColumns.SEARCH_DESCRIPTION])
notification.search_mydealz = bool(row[UColumns.SEARCH_MYDEALZ])
notification.search_mindstar = bool(row[UColumns.SEARCH_MINDSTAR])
notification.search_preisjaeger = bool(row[UColumns.SEARCH_PREISJAEGER])
notification.send_image = bool(row[UColumns.SEND_IMAGES])

Expand Down
18 changes: 0 additions & 18 deletions src/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ def __init__(self) -> None:
self.__first_name: str = ''
self.__last_name: str = ''
self.__search_mydealz: bool = True
self.__search_mindstar: bool = True
self.__search_preisjaeger: bool = False
self.__send_images: bool = True
self.__active: bool = True
Expand Down Expand Up @@ -69,14 +68,6 @@ def search_mydealz(self) -> bool:
def search_mydealz(self, value: bool) -> None:
self.__search_mydealz = value

@property
def search_mindstar(self) -> bool:
return self.__search_mindstar

@search_mindstar.setter
def search_mindstar(self, value: bool) -> None:
self.__search_mindstar = value

@property
def search_preisjaeger(self) -> bool:
return self.__search_preisjaeger
Expand Down Expand Up @@ -122,7 +113,6 @@ def __init__(self) -> None:
self.__search_only_hot: bool = False
self.__search_description: bool = False
self.__search_mydealz: bool = True
self.__search_mindstar: bool = True
self.__search_preisjaeger: bool = True
self.__send_image: bool = True

Expand Down Expand Up @@ -219,14 +209,6 @@ def search_mydealz(self) -> bool:
def search_mydealz(self, value: bool) -> None:
self.__search_mydealz = value

@property
def search_mindstar(self) -> bool:
return self.__search_mindstar

@search_mindstar.setter
def search_mindstar(self, value: bool) -> None:
self.__search_mindstar = value

@property
def search_preisjaeger(self) -> bool:
return self.__search_preisjaeger
Expand Down
5 changes: 0 additions & 5 deletions src/telegram/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,11 +305,6 @@ async def toggle_mydealz(query: CallbackQuery) -> None:
await SQLiteUser().toggle_field(get_chat_id(query), UColumns.SEARCH_MYDEALZ)
await settings(query)

@dispatcher.callback_query_handler(SettingsCB.filter(action=SettingsActions.TOGGLE_MINDSTAR))
async def toggle_mindstar(query: CallbackQuery) -> None:
await SQLiteUser().toggle_field(get_chat_id(query), UColumns.SEARCH_MINDSTAR)
await settings(query)

@dispatcher.callback_query_handler(SettingsCB.filter(action=SettingsActions.TOGGLE_PREISJAEGER))
async def toggle_preisjaeger(query: CallbackQuery) -> None:
await SQLiteUser().toggle_field(get_chat_id(query), UColumns.SEARCH_PREISJAEGER)
Expand Down
1 change: 0 additions & 1 deletion src/telegram/callbacks.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ class Actions(StrEnum):

class SettingsActions(StrEnum):
TOGGLE_MYDEALZ = auto()
TOGGLE_MINDSTAR = auto()
TOGGLE_PREISJAEGER = auto()
TOGGLE_IMAGES = auto()

Expand Down
1 change: 0 additions & 1 deletion src/telegram/keyboards.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ def settings(user: UserModel) -> InlineKeyboardMarkup:

toggles = [
(SettingsCB.new(action=SettingsActions.TOGGLE_MYDEALZ), user.search_mydealz, 'mydealz.de'),
(SettingsCB.new(action=SettingsActions.TOGGLE_MINDSTAR), user.search_mindstar, 'MindStar'),
(SettingsCB.new(action=SettingsActions.TOGGLE_PREISJAEGER), user.search_preisjaeger, 'preisjaeger.at'),
(SettingsCB.new(action=SettingsActions.TOGGLE_IMAGES), user.send_images, 'Deal-Bilder'),
]
Expand Down
4 changes: 0 additions & 4 deletions src/telegram/messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ def start(user: UserModel) -> str:
pages = ''
if user.search_mydealz:
pages += '\nmydealz.de'
if user.search_mindstar:
pages += '\nMindStar (mindfactory.de/Highlights/MindStar)'
if user.search_preisjaeger:
pages += '\npreisjaeger.at'

Expand Down Expand Up @@ -56,7 +54,6 @@ def help_msg() -> str:
<b><u>Unterstützte Websites:</u></b>
- mydealz.de
- preisjaeger.at
- MindStar (mindfactory.de/Highlights/MindStar)
mit /settings kann angepasst werden, welche Websites durchsucht werden sollen.
'''
)
Expand Down Expand Up @@ -84,7 +81,6 @@ def notification_overview(notification: NotificationModel) -> str:
f'Minimaler Preis: {str(notification.min_price) + " €" if notification.min_price else "-"}\n'
f'Maximaler Preis: {str(notification.max_price) + " €" if notification.max_price else "-"}\n'
f'Reichweite: {search_range}\n'
f'Mindstar durchsuchen: {"Ja" if notification.search_mindstar else "Nein"}\n'
f'Auch im Deal-Text suchen: {"Ja" if notification.search_description else "Nein"}'
)

Expand Down

0 comments on commit d911edb

Please sign in to comment.