[19] update trakt_userlist options

pull/1854/head^2
meisnate12 11 months ago
parent e1b019de87
commit d67cb67b19

@ -1,6 +1,8 @@
# Requirements Update (requirements will need to be reinstalled)
Updated lxml requirement to 5.1.0
Updated gitpython requirement to 3.1.41
Updated lxml requirement to 5.1.0
Updated psutil requirement to 5.9.8
Updated python-dotenv requirement to 1.0.1
# New Features
Added `monitor_existing` to sonarr and radarr. To update the monitored status of items existing in plex to match the `monitor` declared.
@ -10,6 +12,7 @@ Added `monitor_existing` to sonarr and radarr. To update the monitored status of
Added new [BoxOfficeMojo Builder](https://metamanager.wiki/en/latest/files/builders/mojo/) - credit to @nwithan8 for the suggestion and initial code submission
Added new [`trakt_chart` attributes](https://metamanager.wiki/en/latest/files/builders/trakt/#trakt-chart) `network_ids`, `studio_ids`, `votes`, `tmdb_ratings`, `tmdb_votes`, `imdb_ratings`, `imdb_votes`, `rt_meters`, `rt_user_meters`, `metascores` and removed the deprecated `network` attribute
Added [Trakt and MyAnimeList Authentication Page](https://metamanager.wiki/en/latest/config/auth/) allowing users to authenticate against those services directly from the wiki. credit to @chazlarson for developing the script
Trakt Builder `trakt_userlist` value `recommendations` removed and `favorites` added.
# Defaults

@ -1 +1 @@
1.20.0-develop17
1.20.0-develop19

@ -128,11 +128,11 @@ Finds every movie/show in the Trakt Userlist.
The `sync_mode: sync` and `collection_order: custom` Setting are recommended since the lists are continuously updated and in a specific order.
| Attribute | Description & Values |
|:-----------|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `userlist` | **Description:** Which Trakt userlist to query<br>**Values:**<table class="clearTable"><tr><td>`watchlist`</td><td>Trakt User's Watchlist</td></tr><tr><td>`recommendations`</td><td>Trakt User's Personal Recommendations list</td></tr><tr><td>`watched`</td><td>Trakt User's Personal Watched list</td></tr><tr><td>`collected`</td><td>Trakt User's Personal Collected list</td></tr></table> |
| `user` | **Description:** The User who's user lists you want to query.<br>**Default:** `me`<br>**Values:** Username of User or `me` for the authenticated user. |
| `sort_by` | **Description:** How to sort the results<br>**Default:** `rank`<br>**Values:** `rank`, `added`, `released`, `title` |
| Attribute | Description & Values |
|:-----------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `userlist` | **Description:** Which Trakt userlist to query<br>**Values:**<table class="clearTable"><tr><td>`watchlist`</td><td>Trakt User's Watchlist</td></tr><tr><td>`favorites`</td><td>Trakt User's Personal Favorite list</td></tr><tr><td>`watched`</td><td>Trakt User's Personal Watched list</td></tr><tr><td>`collection`</td><td>Trakt User's Personal Collection list</td></tr></table> |
| `user` | **Description:** The User who's user lists you want to query.<br>**Default:** `me`<br>**Values:** Username of User or `me` for the authenticated user. |
| `sort_by` | **Description:** How to sort the results<br>**Default:** `rank`<br>**Values:** `rank`, `added`, `released`, `title` |
```yaml
collections:
@ -153,7 +153,7 @@ collections:
trakt_userlist:
- userlist: watched
user: me
- userlist: collected
- userlist: collection
user: me
collection_order: custom
sync_mode: sync

@ -2109,7 +2109,7 @@ class CollectionBuilder:
elif method_name in ["trakt_watchlist", "trakt_collection"]:
trakt_dicts = []
for trakt_user in util.get_list(method_data, split=False):
trakt_dicts.append({"userlist": "watchlist" if "trakt_watchlist" else "collected", "user": trakt_user})
trakt_dicts.append({"userlist": method_name[6:], "user": trakt_user})
final_method = "trakt_userlist"
else:
terms = method_name.split("_")

@ -23,6 +23,7 @@ status_translation = {
"returning": "returning series", "production": "in production",
"planned": "planned", "canceled": "canceled", "ended": "ended"
}
userlist_options = ["favorites", "watched", "collection", "watchlist"]
periods = ["daily", "weekly", "monthly", "yearly", "all"]
id_translation = {"movie": "movie", "show": "show", "season": "show", "episode": "show", "person": "person", "list": "list"}
id_types = {
@ -493,17 +494,28 @@ class Trakt:
final_dict["status"] = util.parse(err_type, "status", trakt_dict, methods=dict_methods, parent=method_name, datatype="commalist", options=status)
valid_dicts.append(final_dict)
else:
userlist = util.parse(err_type, "userlist", trakt_dict, methods=dict_methods, parent=method_name, options=["recommendations", "watched", "collected", "watchlist"])
if "userlist" not in dict_methods:
raise Failed(f"{err_type} Error: {method_name} userlist attribute not found")
og_list = trakt_dict[dict_methods["year"]]
if not og_list:
raise Failed(f"{err_type} Error: {method_name} userlist attribute is blank")
if og_list == "collected":
logger.warning(f"{err_type} Warning: userlist value collected has been deprecated using collection")
userlist = "collection"
elif og_list == "recommendations":
raise Failed(f"{err_type} Error: {method_name} userlist value recommendations has been deprecated")
else:
userlist = util.parse(err_type, "userlist", trakt_dict, methods=dict_methods, parent=method_name, options=userlist_options)
user = util.parse(err_type, "user", trakt_dict, methods=dict_methods, parent=method_name, default="me")
sort_by = None
if userlist in ["recommendations", "watchlist"] and "sort_by" in dict_methods:
if userlist in ["favorites", "watchlist"] and "sort_by" in dict_methods:
sort_by = util.parse(err_type, "sort_by", trakt_dict, methods=dict_methods, parent=method_name, default="rank", options=["rank", "added", "released", "title"])
self._userlist("collection" if userlist == "collected" else userlist, user, is_movie, sort_by=sort_by)
self._userlist(userlist, user, is_movie, sort_by=sort_by)
valid_dicts.append({"userlist": userlist, "user": user, "sort_by": sort_by})
except Failed as e:
logger.error(e)
if len(valid_dicts) == 0:
raise Failed(f"Trakt Error: No valid Trakt {method_name[6:].capitalize()}")
raise Failed(f"{err_type} Error: No valid Trakt {method_name[6:].capitalize()}")
return valid_dicts
def get_trakt_ids(self, method, data, is_movie):

@ -5,8 +5,8 @@ num2words==0.5.13
pathvalidate==3.2.0
pillow==10.2.0
PlexAPI==4.15.7
psutil==5.9.7
python-dotenv==1.0.0
psutil==5.9.8
python-dotenv==1.0.1
python-dateutil==2.8.2
requests==2.31.0
retrying==1.3.4

Loading…
Cancel
Save