Coverage for otaku_info/mappings.py: 100%
Shortcuts on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
Shortcuts on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
1"""LICENSE
2Copyright 2020 Hermann Krumrey <hermann@krumreyh.com>
4This file is part of otaku-info.
6otaku-info is free software: you can redistribute it and/or modify
7it under the terms of the GNU General Public License as published by
8the Free Software Foundation, either version 3 of the License, or
9(at your option) any later version.
11otaku-info is distributed in the hope that it will be useful,
12but WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14GNU General Public License for more details.
16You should have received a copy of the GNU General Public License
17along with otaku-info. If not, see <http://www.gnu.org/licenses/>.
18LICENSE"""
20from typing import Dict, Type, List
21from otaku_info.enums import ListService
24mangadex_external_id_names: Dict[ListService, str] = {
25 ListService.ANILIST: "al",
26 ListService.ANIMEPLANET: "ap",
27 ListService.KITSU: "kt",
28 ListService.MANGAUPDATES: "mu",
29 ListService.MYANIMELIST: "mal",
30 ListService.MANGADEX: "NONE"
31}
32"""
33The names used by mangadex to identify IDs from other services
34"""
37list_service_url_formats: Dict[ListService, str] = {
38 ListService.ANILIST: "https://anilist.co/@{media_type}/@{id}",
39 ListService.ANIMEPLANET: "https://www.anime-planet.com/"
40 "@{media_type}/@{id}",
41 ListService.KITSU: "https://kitsu.io/anime/@{id}",
42 ListService.MANGAUPDATES: "https://www.mangaupdates.com/"
43 "series.html?id=@{id}",
44 ListService.MYANIMELIST: "https://myanimelist.net/@{media_type}/@{id}",
45 ListService.MANGADEX: "https://mangadex.org/title/@{id}"
46}
47"""
48Schemas for URLs for external services
49"""
52list_service_id_types: Dict[ListService, Type] = {
53 ListService.ANILIST: int,
54 ListService.ANIMEPLANET: str,
55 ListService.KITSU: int,
56 ListService.MANGAUPDATES: int,
57 ListService.MYANIMELIST: int,
58 ListService.MANGADEX: int
59}
60"""
61Which type a list service ID should have
62"""
64list_service_priorities: List[ListService] = [
65 ListService.ANILIST,
66 ListService.MYANIMELIST,
67 ListService.MANGADEX,
68 ListService.KITSU,
69 ListService.MANGAUPDATES,
70 ListService.ANIMEPLANET
71]
72"""
73Specifies the order in which list service data is prioritized
74"""