UI improvements: collapsible schedule menu and fix double extensions
This commit is contained in:
parent
26f6e86293
commit
d0335db0a2
3 changed files with 38 additions and 14 deletions
10
app.py
10
app.py
|
|
@ -1816,9 +1816,13 @@ def view_media_view(request):
|
|||
if media.title:
|
||||
file_extension = os.path.splitext(media.filename)[1]
|
||||
raw_title = media.title
|
||||
download_filename = sanitize_filename_for_http_header(
|
||||
f"{raw_title}{file_extension}"
|
||||
)
|
||||
# Check if title already ends with the file extension to avoid doubling
|
||||
if file_extension and not raw_title.lower().endswith(file_extension.lower()):
|
||||
download_filename = sanitize_filename_for_http_header(
|
||||
f"{raw_title}{file_extension}"
|
||||
)
|
||||
else:
|
||||
download_filename = sanitize_filename_for_http_header(raw_title)
|
||||
else:
|
||||
download_filename = sanitize_filename_for_http_header(media.filename)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue