Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix serving media files from subdirectories #1076

Merged
merged 1 commit into from
Jun 25, 2023
Merged

Fix serving media files from subdirectories #1076

merged 1 commit into from
Jun 25, 2023

Conversation

falkoschindler
Copy link
Contributor

After writing

app.add_media_files('/media', Path('/Users/falko/music'))

I couldn't access files like "/media/house/track.mp3" because "house/music.mp3" isn't matched with the filename parameter. This PR fixes it by allowing filename to be a path.

Note that this allows accessing the whole directory tree underneath "/Users/falko/music". But I guess this is expected behavior and nicely in line with add_static_files.

@falkoschindler falkoschindler self-assigned this Jun 25, 2023
@falkoschindler falkoschindler added the bug Something isn't working label Jun 25, 2023
@falkoschindler falkoschindler added this to the 1.2.23 milestone Jun 25, 2023
@rodja rodja merged commit 484d957 into main Jun 25, 2023
7 checks passed
@rodja rodja deleted the media-files branch June 25, 2023 17:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants