def _fetch_size(self): """ Output the file size in formatted output. :return: file size in formatted output. """ length = self._file_info.get(LENGTH) if not length: return None return FileService.calculate_formatted_size(length)
def _fetch_size(self): """ Output the size of the torrent size. :return: the formatted size of torrent :rtype string """ info = self._metainfo.get(INFO) if not info: return None piece_length = info.get(PIECE_LENGTH) if not piece_length: return None return FileService.calculate_formatted_size(piece_length)