Skip to content

Commit

Permalink
Add comment why i adding _PageRef class in format/pdf.py
Browse files Browse the repository at this point in the history
  • Loading branch information
mansuf committed May 20, 2023
1 parent 7ba6fea commit c1a3f2d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions mangadex_downloader/format/pdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,9 @@ def _save(self, im, fp, filename, save_all=False):

page_number = 0
for im_ref in ims:
# The reason i did this is to prevent error in Unix-based OS
# If the application is opening too much files,
# the OS will throw an error "OSError: Too many open files"
im = im_ref() if isinstance(im_ref, _PageRef) else im_ref

truncated = self.check_truncated(im)
Expand Down

0 comments on commit c1a3f2d

Please sign in to comment.