Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[python-pytrakt] Value 'type' added to Userlist #206

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion tests/mock_data/users.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"name":"Star Wars in NEW machete order",
"description":"Some descriptive text",
"privacy":"private",
"type":"personal",
"display_numbers":true,
"allow_comments":false,
"updated_at":"2014-10-11T17:00:54.000Z",
Expand Down Expand Up @@ -188,7 +189,7 @@
{"type":"show","show":{"title":"Breaking Bad","year":2008,"ids":{"trakt":1,"slug":"breaking-bad","tvdb":81189,"imdb":"tt0903747","tmdb":1396,"tvrage":18164}},"comment":{"id":199,"comment":"Skyler, I AM THE DANGER.","spoiler":false,"review":false,"parent_id":0,"created_at":"2015-02-18T06:02:30.000Z","replies":0,"likes":0,"user_rating":10,"user":{"username":"justin","private":false,"name":"Justin N.","vip":true,"vip_ep":false}}},
{"type":"season","season":{"number":1,"ids":{"trakt":3958,"tvdb":274431,"tmdb":60394,"tvrage":38049}},"show":{"title":"Gotham","year":2014,"ids":{"trakt":869,"slug":"gotham","tvdb":274431,"imdb":"tt3749900","tmdb":60708,"tvrage":38049}},"comment":{"id":220,"comment":"Kicking off season 1 for a new Batman show.","spoiler":false,"review":false,"parent_id":0,"created_at":"2015-04-21T06:53:25.000Z","replies":0,"likes":0,"user_rating":8,"user":{"username":"justin","private":false,"name":"Justin N.","vip":true,"vip_ep":false}}},
{"type":"episode","episode":{"season":1,"number":1,"title":"Jim Gordon","ids":{"trakt":63958,"tvdb":4768720,"imdb":"tt3216414","tmdb":975968,"tvrage":1065564827}},"show":{"title":"Gotham","year":2014,"ids":{"trakt":869,"slug":"gotham","tvdb":274431,"imdb":"tt3749900","tmdb":60708,"tvrage":38049}},"comment":{"id":229,"comment":"Is this the OC?","spoiler":false,"review":false,"parent_id":0,"created_at":"2015-04-21T15:42:31.000Z","replies":1,"likes":0,"user_rating":7,"user":{"username":"justin","private":false,"name":"Justin N.","vip":true,"vip_ep":false}}},
{"type":"list","list":{"name":"Star Wars","description":"The complete Star Wars saga!","privacy":"public","display_numbers":false,"allow_comments":true,"updated_at":"2015-04-22T22:01:39.000Z","item_count":8,"comment_count":0,"likes":0,"ids":{"trakt":51,"slug":"star-wars"}},"comment":{"id":268,"comment":"May the 4th be with you!","spoiler":false,"review":false,"parent_id":0,"created_at":"2014-12-08T17:34:51.000Z","replies":0,"likes":0,"user_rating":null,"user":{"username":"justin","private":false,"name":"Justin N.","vip":true,"vip_ep":false}}}
{"type":"list","list":{"name":"Star Wars","description":"The complete Star Wars saga!","privacy":"public","type":"personal","display_numbers":false,"allow_comments":true,"updated_at":"2015-04-22T22:01:39.000Z","item_count":8,"comment_count":0,"likes":0,"ids":{"trakt":51,"slug":"star-wars"}},"comment":{"id":268,"comment":"May the 4th be with you!","spoiler":false,"review":false,"parent_id":0,"created_at":"2014-12-08T17:34:51.000Z","replies":0,"likes":0,"user_rating":null,"user":{"username":"justin","private":false,"name":"Justin N.","vip":true,"vip_ep":false}}}
]
},
"users/sean/lists": {
Expand All @@ -197,6 +198,7 @@
"name":"Star Wars in machete order",
"description":"Some descriptive text",
"privacy":"public",
"type":"personal",
"display_numbers":true,
"allow_comments":true,
"sort_by": "rank",
Expand All @@ -220,6 +222,7 @@
"name":"Vampires FTW",
"description":"These suck, but in a good way!",
"privacy":"public",
"type":"personal",
"display_numbers":false,
"allow_comments":true,
"sort_by": "rank",
Expand All @@ -244,6 +247,7 @@
"name":"Star Wars in machete order",
"description":"Some descriptive text",
"privacy":"public",
"type":"personal",
"display_numbers":true,
"allow_comments":true,
"sort_by": "rank",
Expand All @@ -261,6 +265,7 @@
"name":"Star Wars in machete order",
"description":"Some descriptive text",
"privacy":"public",
"type":"personal",
"display_numbers":true,
"allow_comments":true,
"sort_by": "rank",
Expand All @@ -277,6 +282,7 @@
"name":"Star Wars in NEW machete order",
"description":"Some descriptive text",
"privacy":"private",
"type":"personal",
"display_numbers":true,
"allow_comments":false,
"sort_by": "rank",
Expand Down
5 changes: 3 additions & 2 deletions trakt/users.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,9 @@ def unfollow(user_name):


class UserList(namedtuple('UserList', ['name', 'description', 'privacy',
'display_numbers', 'allow_comments',
'sort_by', 'sort_how', 'created_at',
'type', 'display_numbers',
'allow_comments', 'sort_by',
'sort_how', 'created_at',
'updated_at', 'item_count',
'comment_count', 'likes', 'trakt',
'slug', 'user', 'creator'])):
Expand Down