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

Add separate classes for local and remote file access #37

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

mbirth
Copy link

@mbirth mbirth commented May 26, 2024

I'm using Mp3Info to query the duration of podcasts hosted on a remote HTTP server. These are usually 1 hour or longer and thus between 100 and 250 MB in size. The current version of Mp3Info always downloads these files completely before returning a result which takes a long time.

I've now fanned out the file reading into two classes - one for local files, that works basically the same as the current version. And another class for remote files that only downloads the parts Mp3Info needs to work on. It does that using HTTP Range requests and currently is configured to download 4 kB blocks. So in the best case, this only has to download 8 kB per file (one block at the beginning of the file, one block at the end) for Mp3Info to be able to read the metadata - which takes far less time than downloading the whole file.

mbirth added 3 commits May 26, 2024 14:15
Improves parsing of remote files by using HTTP Range requests so it doesn't have to download the whole file.

Signed-off-by: Markus Birth <[email protected]>
Signed-off-by: Markus Birth <[email protected]>
Signed-off-by: Markus Birth <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant