Stripping whitespace from posted channel names

This commit is contained in:
StruckCroissant 2022-02-07 12:04:38 -06:00
parent f76ff8703d
commit d26ddd2ee0

View file

@ -49,7 +49,10 @@ def channel_post(_: Request, body: schema.ChannelPostRequest):
if not body.directory.is_dir() and body.mkdir:
make_media_directory(body.directory)
channel = lib.create_channel(body.__dict__) # TODO don't use the dataclass as a dict.
bd_edit = body.__dict__
bd_edit['name'] = bd_edit['name'].strip()
channel = lib.create_channel(bd_edit) # TODO don't use the dataclass as a dict.
print(channel)
# Refresh the videos asynchronously
from ..api import refresh_videos