Hide keyboard shortcuts

Hot-keys 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 2019 Hermann Krumrey <hermann@krumreyh.com> 

3 

4This file is part of otaku-info-bot. 

5 

6otaku-info-bot 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. 

10 

11otaku-info-bot 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. 

15 

16You should have received a copy of the GNU General Public License 

17along with otaku-info-bot. If not, see <http://www.gnu.org/licenses/>. 

18LICENSE""" 

19 

20from kudubot.db import Base 

21from sqlalchemy import Column, Integer, String, Boolean 

22 

23 

24class AnilistEntry(Base): 

25 """ 

26 Models an anilist entry 

27 """ 

28 

29 __tablename__ = "anilist_entries" 

30 """ 

31 The name of the database table 

32 """ 

33 

34 id = Column(Integer, primary_key=True, autoincrement=True) 

35 """ 

36 The ID of the entry 

37 """ 

38 

39 anilist_id = Column(Integer, nullable=False) 

40 """ 

41 The anilist ID of the entry 

42 """ 

43 

44 name = Column(String(255), nullable=False) 

45 """ 

46 The name of the series 

47 """ 

48 

49 media_type = Column(String(5), nullable=False) 

50 """ 

51 The media type of the entry 

52 """ 

53 

54 latest = Column(Integer, default=0, nullable=False) 

55 """ 

56 The most recently released episode/chapter 

57 """ 

58 

59 releasing = Column(Boolean, default=True, nullable=False) 

60 """ 

61 Whether or not the series is currently being released 

62 """ 

63 

64 completed = Column(Boolean, default=False, nullable=False) 

65 """ 

66 Whether or not the series is already completed 

67 """ 

68 

69 @property 

70 def anilist_url(self) -> str: 

71 """ 

72 :return: The URL to the anilist page 

73 """ 

74 return "https://anilist.co/{}/{}".format( 

75 self.media_type, self.anilist_id 

76 )