Skip to content

Commit

Permalink
Added attributes to some objects
Browse files Browse the repository at this point in the history
  • Loading branch information
Proxymiity committed Sep 8, 2021
1 parent 8728952 commit 4f2ead6
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 6 deletions.
5 changes: 3 additions & 2 deletions MangaDexPy/chapter.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
class Chapter:
"""Represents a MangaDex Chapter."""
__slots__ = ("id", "volume", "chapter", "title", "language", "hash", "pages", "pages_redux", "published_at",
"created_at", "updated_at", "parent_manga", "group", "uploader", "client")
__slots__ = ("id", "volume", "chapter", "title", "language", "hash", "pages", "pages_redux", "pages_external",
"published_at", "created_at", "updated_at", "parent_manga", "group", "uploader", "client")

def __init__(self, data, client):
self.id = data.get("id")
Expand All @@ -14,6 +14,7 @@ def __init__(self, data, client):
self.hash = _attrs.get("hash")
self.pages = _attrs.get("data")
self.pages_redux = _attrs.get("dataSaver")
self.pages_external = _attrs.get("externalUrl")
self.published_at = _attrs.get("publishAt")
self.created_at = _attrs.get("createdAt")
self.updated_at = _attrs.get("updatedAt")
Expand Down
12 changes: 11 additions & 1 deletion MangaDexPy/group.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,22 @@
class Group:
"""Represents a MangaDex Group."""
__slots__ = ("id", "name", "leader", "members", "created_at", "updated_at", "client")
__slots__ = ("id", "name", "desc", "website", "irc_server", "irc_channel", "discord", "email", "locked",
"official", "verified", "leader", "members", "created_at", "updated_at", "client")

def __init__(self, data, client):
self.id = data.get("id")
_attrs = data.get("attributes")
_rel = data.get("relationships", [])
self.name = _attrs.get("name")
self.desc = None
self.website = None
self.irc_server = None
self.irc_channel = None
self.discord = None
self.email = None
self.locked = None
self.official = None
self.verified = None
self.created_at = _attrs.get("createdAt")
self.updated_at = _attrs.get("updatedAt")
try:
Expand Down
2 changes: 1 addition & 1 deletion MangaDexPy/manga.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class Manga:
"""Represents a MangaDex Manga."""
__slots__ = ("id", "title", "titles", "desc", "locked", "links", "language", "last_volume", "last_chapter",
__slots__ = ("id", "title", "titles", "desc", "links", "language", "last_volume", "last_chapter",
"type", "status", "year", "content", "tags", "created_at", "updated_at", "author", "artist", "cover",
"client")

Expand Down
3 changes: 2 additions & 1 deletion MangaDexPy/user.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
class User:
"""Represents a MangaDex User."""
__slots__ = ("id", "username", "client")
__slots__ = ("id", "username", "roles", "client")

def __init__(self, data, client):
self.id = data.get("id")
_attrs = data.get("attributes")
self.username = _attrs.get("username")
self.roles = _attrs.get("roles", [])
self.client = client
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
packages=[
"MangaDexPy"
],
version='2.0.7',
version='2.0.8',
description='An API wrapper for the MangaDexAPIv5.',
long_description=long_description,
long_description_content_type='text/markdown',
Expand Down

0 comments on commit 4f2ead6

Please sign in to comment.