-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #111 from bralbral/develop
New Platforms
- Loading branch information
Showing
88 changed files
with
1,401 additions
and
1,663 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
eralchemy -i sqlite:///youtube-notifier-bot.db -o db-schema.png --exclude-tables alembic_version --exclude-columns created_at updated_at |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,20 @@ | ||
aiogram==3.10.0 | ||
aiogram==3.13.1 | ||
aiogram-dialog==2.2.0 | ||
pydantic==2.8.2 | ||
APScheduler==3.10.4 | ||
yt-dlp==2024.8.6 | ||
twitchapi==4.3.1 | ||
sulguk==0.8.0 | ||
jinja2==3.1.4 | ||
pyyaml==6.0.2 | ||
pydantic_settings==2.4.0 | ||
structlog==24.4.0 | ||
orjson==3.10.5 | ||
orjson==3.10.7 | ||
uvloop==0.20.0 | ||
SQLAlchemy==2.0.31 | ||
SQLAlchemy==2.0.35 | ||
alembic==1.13.2 | ||
aiosqlite==0.20.0 | ||
asyncclick==8.1.7.2 | ||
anyio==4.4.0 | ||
aiocache==0.12.2 | ||
sqlalchemy-data-model-visualizer==0.1.3 | ||
sqlmodel==0.0.22 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
from aiogram import Dispatcher | ||
|
||
from .channel import channel_dialog | ||
from .user import register_user_dialogs | ||
|
||
|
||
def register_dialogs(dp: Dispatcher) -> None: | ||
dp.include_router(channel_dialog) | ||
register_user_dialogs(dp=dp) | ||
|
||
|
||
__all__ = ["register_dialogs"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
from aiogram import Dispatcher | ||
|
||
from .channel import channel_create_dialog | ||
from .channel import channels_list_dialog | ||
|
||
|
||
def register_user_dialogs(dp: Dispatcher) -> None: | ||
dp.include_router(channel_create_dialog) | ||
dp.include_router(channels_list_dialog) | ||
|
||
|
||
__all__ = ["register_user_dialogs"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
from .add import channel_create_dialog | ||
from .list import channels_list_dialog | ||
|
||
|
||
__all__ = ["channel_create_dialog", "channels_list_dialog"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
from aiogram_dialog import Dialog | ||
from aiogram_dialog import LaunchMode | ||
|
||
from .windows import label_handler_window | ||
from .windows import select_channel_type_window | ||
from .windows import url_handler_window | ||
|
||
channel_create_dialog = Dialog( | ||
select_channel_type_window(), | ||
url_handler_window(), | ||
label_handler_window(), | ||
launch_mode=LaunchMode.STANDARD, | ||
) | ||
|
||
|
||
__all__ = ["channel_create_dialog"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
from src.db.models.channel_type import ChannelType | ||
from src.utils import kick_channel_url_validator | ||
from src.utils import twitch_channel_url_validator | ||
from src.utils import youtube_channel_url_validator | ||
|
||
url_validators: dict = { | ||
ChannelType.YOUTUBE: youtube_channel_url_validator, | ||
ChannelType.TWITCH: twitch_channel_url_validator, | ||
ChannelType.KICK: kick_channel_url_validator, | ||
} | ||
|
||
url_examples: dict = { | ||
ChannelType.YOUTUBE: "https://www.youtube.com/@username", | ||
ChannelType.TWITCH: "https://www.twitch.tv/username", | ||
ChannelType.KICK: "empty", | ||
} | ||
|
||
__all__ = ["url_examples", "url_validators"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
from aiogram_dialog import DialogManager | ||
|
||
from .constants import url_examples | ||
from .constants import url_validators | ||
from src.db import DataAccessLayer | ||
from src.db.models.channel_type import ChannelType | ||
|
||
|
||
async def select_channel_type_window_getter(dialog_manager: DialogManager, **kwargs): | ||
|
||
dal: DataAccessLayer = dialog_manager.start_data["dal"] | ||
|
||
channels = await dal.get_channels() | ||
|
||
dialog_manager.dialog_data["dal"] = dal | ||
dialog_manager.dialog_data["channels"] = channels | ||
dialog_manager.dialog_data["channel_types"] = ChannelType.list() | ||
|
||
return { | ||
"channel_types": dialog_manager.dialog_data["channel_types"], | ||
} | ||
|
||
|
||
async def url_handler_window_getter(dialog_manager: DialogManager, **kwargs): | ||
|
||
selected_channel_type = dialog_manager.dialog_data["selected_channel_type"] | ||
url_validator = url_validators[selected_channel_type] | ||
url_example = url_examples[selected_channel_type] | ||
|
||
dialog_manager.dialog_data["url_validator"] = url_validator | ||
dialog_manager.dialog_data["url_example"] = url_example | ||
|
||
return {"url_example": url_example} | ||
|
||
|
||
async def label_handler_window_getter(dialog_manager: DialogManager, **kwargs): | ||
|
||
return {"url": dialog_manager.dialog_data["url"]} | ||
|
||
|
||
__all__ = [ | ||
"label_handler_window_getter", | ||
"select_channel_type_window_getter", | ||
"url_handler_window_getter", | ||
] |
Oops, something went wrong.