learningequality / ka-lite

KA Lite: lightweight web server for serving core Khan Academy content (videos and exercises) without needing internet connectivity
https://learningequality.org/ka-lite/
Other
456 stars 304 forks source link

Do not load video into memory to check its size, just use disk stats #5436

Closed benjaoming closed 7 years ago

benjaoming commented 7 years ago

os.path.getsize returns bytes, should be safe since file object is closed after returning from download_file

Summary

This is a potential problem for small devices downloading huge videos.

TODO

If not all TODOs are marked, this PR is considered WIP (work in progress)

Reviewer guidance

I've checked this by fetching a video.

Issues addressed

2909

codecov-io commented 7 years ago

Codecov Report

Merging #5436 into 0.17.x will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           0.17.x    #5436   +/-   ##
=======================================
  Coverage   51.72%   51.72%           
=======================================
  Files         143      143           
  Lines        7494     7494           
=======================================
  Hits         3876     3876           
  Misses       3618     3618

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 9f7175c...7533c59. Read the comment docs.