mirror of
https://github.com/Benexl/FastAnime.git
synced 2025-12-25 12:24:52 -08:00
feat(anime screen):add auto play and auto select server
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
from requests.models import StreamConsumedError
|
||||
from ..libs.anilist import AniList
|
||||
from .base_model import BaseScreenModel
|
||||
from ..libs.anime_provider.allanime_api import anime_provider
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
<AnimeScreenView>:
|
||||
md_bg_color: self.theme_cls.backgroundColor
|
||||
episodes_container:episodes_container
|
||||
video_player:video_player
|
||||
MDBoxLayout:
|
||||
padding:"10dp"
|
||||
orientation: 'vertical'
|
||||
@@ -29,6 +30,7 @@
|
||||
|
||||
MDBoxLayout:
|
||||
VideoPlayer:
|
||||
id:video_player
|
||||
source:root.current_link
|
||||
AnimeBoxLayout:
|
||||
padding: "20dp"
|
||||
|
||||
@@ -25,6 +25,7 @@ class AnimeScreenView(BaseScreenView):
|
||||
episodes_container = ObjectProperty()
|
||||
total_episodes = 0
|
||||
current_episode = 1
|
||||
video_player = ObjectProperty()
|
||||
|
||||
def __init__(self, **kwargs):
|
||||
super().__init__(**kwargs)
|
||||
@@ -58,11 +59,16 @@ class AnimeScreenView(BaseScreenView):
|
||||
|
||||
def on_current_anime_data(self, instance, value):
|
||||
self.current_episode = int("1")
|
||||
self.update_current_video_stream("dropbox")
|
||||
self.video_player.state = "play"
|
||||
|
||||
data = value["show"]
|
||||
self.update_episodes(data["availableEpisodesDetail"]["sub"][::-1])
|
||||
|
||||
def update_current_episode(self, episode):
|
||||
self.controller.fetch_streams(self.current_title, episode)
|
||||
self.update_current_video_stream("dropbox")
|
||||
self.video_player.state = "play"
|
||||
|
||||
def update_current_video_stream(self, server, is_dub=False):
|
||||
for link in self.current_links:
|
||||
|
||||
Reference in New Issue
Block a user