Add changing preview type when searching track

This commit is contained in:
BarsTiger
2023-11-07 18:45:41 +02:00
parent 06c327933f
commit e99ba9daa3
12 changed files with 54 additions and 23 deletions

View File

@@ -4,18 +4,20 @@ from aiogram.types import (
from bot.modules.spotify import spotify
from bot.modules.database import db
from bot.modules.settings import UserSettings
from ..common.search import get_common_search_result
async def get_spotify_search_results(query: str) -> list[
async def get_spotify_search_results(query: str, settings: UserSettings) -> list[
InlineQueryResultDocument | InlineQueryResultCachedAudio
]:
return [
await get_common_search_result(
audio=audio,
db_table=db.spotify,
service_id='spot'
service_id='spot',
settings=settings
)
for audio in spotify.songs.search(query, limit=50)
]