Small improvement in truncate_titles

Strip truncated text before adding ellipsis.
This commit is contained in:
Maks Snegov 2024-02-02 14:29:10 -08:00
parent b71bfb0674
commit 32c372bb9b

View File

@ -20,7 +20,7 @@ def _truncate_title(title: str, length: int = 30) -> str:
return title[:length] return title[:length]
if len(title) <= length: if len(title) <= length:
return title return title
return title[:length-3] + (title[length:] and '...') return title[:length-3].strip() + (title[length:] and '...')
def get_yt_creds(): def get_yt_creds():