-
Notifications
You must be signed in to change notification settings - Fork 7
/
aggregator.py
72 lines (63 loc) · 1.63 KB
/
aggregator.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
from app.database import sessionmanager
from app.utils import get_settings
import asyncio
from app.sync import (
aggregator_franchises,
update_schedule_build,
aggregator_characters,
aggregator_anime_info,
aggregator_manga_info,
aggregator_novel_info,
aggregator_companies,
aggregator_magazines,
aggregator_genres,
aggregator_people,
aggregator_anime,
aggregator_manga,
aggregator_novel,
aggregator_roles,
update_weights,
update_content,
update_search,
)
async def import_aggregator():
settings = get_settings()
sessionmanager.init(settings.database.endpoint)
print("Genres")
await aggregator_genres()
print("Roles")
await aggregator_roles()
print("Characters")
await aggregator_characters()
print("Companies")
await aggregator_companies()
print("Magazines")
await aggregator_magazines()
print("People")
await aggregator_people()
print("Anime")
await aggregator_anime()
print("Manga")
await aggregator_manga()
print("Novel")
await aggregator_novel()
print("Anime info")
await aggregator_anime_info()
print("Manga info")
await aggregator_manga_info()
print("Novel info")
await aggregator_novel_info()
print("Franchises")
await aggregator_franchises()
print("Schedule")
await update_schedule_build()
print("Search")
await update_search()
print("Content")
await update_content()
# TODO: improve performance
print("Weights")
await update_weights()
await sessionmanager.close()
if __name__ == "__main__":
asyncio.run(import_aggregator())