mirror of
https://github.com/Benexl/FastAnime.git
synced 2026-01-10 04:05:13 -08:00
16 lines
815 B
Python
16 lines
815 B
Python
from kivy.properties import ObjectProperty
|
|
from View.base_screen import BaseScreenView
|
|
from kivy.uix.modalview import ModalView
|
|
from kivy.utils import format_bytes_to_human
|
|
class DownloadAnimePopup(ModalView):
|
|
pass
|
|
|
|
class DownloadsScreenView(BaseScreenView):
|
|
main_container = ObjectProperty()
|
|
progress_bar = ObjectProperty()
|
|
download_progress_label = ObjectProperty()
|
|
def on_episode_download_progress(self,current_bytes_downloaded,total_bytes,episode_info):
|
|
percentage_completion = (current_bytes_downloaded/total_bytes)*100
|
|
self.progress_bar.value= percentage_completion
|
|
self.download_progress_label.text = f"Downloading: {episode_info['anime_title']} - {episode_info['episode']} ({format_bytes_to_human(current_bytes_downloaded)}/{format_bytes_to_human(total_bytes)})"
|