mirror of
https://github.com/Benexl/FastAnime.git
synced 2026-01-07 02:03:49 -08:00
successfully completed search page
This commit is contained in:
26
app/Model/anime_screen.py
Normal file
26
app/Model/anime_screen.py
Normal file
@@ -0,0 +1,26 @@
|
||||
import json
|
||||
import os
|
||||
from Model.base_model import BaseScreenModel
|
||||
from Utility import show_notification
|
||||
from libs.anilist import AniList
|
||||
from Utility.media_card_loader import MediaCardLoader
|
||||
from kivy.storage.jsonstore import JsonStore
|
||||
|
||||
user_data= JsonStore("user_data.json")
|
||||
class AnimeScreenModel(BaseScreenModel):
|
||||
data = {}
|
||||
id = 0
|
||||
|
||||
def media_card_generator(self):
|
||||
for anime_item in self.data["data"]["Page"]["media"]:
|
||||
yield MediaCardLoader.media_card(anime_item)
|
||||
self.pagination_info = self.extract_pagination_info()
|
||||
|
||||
def get_anime_data(self,id:int):
|
||||
return AniList.get_anime(id)
|
||||
|
||||
def get_anime_data_(self):
|
||||
with open("anime.json","r") as file:
|
||||
|
||||
return json.load(file)
|
||||
|
||||
Reference in New Issue
Block a user