def PopulateAnime(self, database: Database, anime_hash: str): oldAnimeData = AnimeStruct.Anime.from_db(anime_hash, database) if oldAnimeData.id.getID("Animeshon"): AnimeshonID = oldAnimeData.id.getID("Animeshon") query = queries.getAnime.format(AnimeshonID=AnimeshonID) print(f"Animeshon: Obtaining Anime Metadata: {AnimeshonID}") queryReply, raw = self.query(query, 'get') anime_metadata = queryReply.get("data").get('getAnime') properAnime = AnimeshonFormatter.AnimeMetadata(anime_metadata, oldAnimeData) # remove edges to stop the anime from keeping some old info like type database.remove_successor_edges(oldAnimeData.hash) properAnime.to_db(database)
def PopulateAnime(self, database: Database, anime_hash: str): oldAnimeData = AnimeStruct.Anime.from_db(anime_hash, database) if oldAnimeData.id.getID("MAL"): malID = oldAnimeData.id.getID("MAL") print(f"MAL: Obtaining Anime Metadata: {malID}") url = URL_MAIN + URL_DETAILS.format( id=str(malID)) + ANIME_ALL_FIELDS anime_metadata = self.load(url) properAnime = MALFormatter.AnimeMetadata(anime_metadata, oldAnimeData) # remove edges to stop the anime from keeping some old info like type database.remove_successor_edges(oldAnimeData.hash) properAnime.to_db(database)