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

2.4.2 Fixes for #87 and #89 #90

Merged
merged 4 commits into from
Nov 5, 2020
Merged
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
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [2.4.2] - 2020-11-04 - [#90](https://github.com/mza921/Plex-Auto-Collections/pull/90)
### Fixed
- [#87](https://github.com/mza921/Plex-Auto-Collections/issues/87) - 1000+ IMDB Error Fixed
- [#89](https://github.com/mza921/Plex-Auto-Collections/issues/89) - Shouldn't crash when trakt cant find a show

## [2.4.1] - 2020-11-04 - [#85](https://github.com/mza921/Plex-Auto-Collections/pull/85)
### Fixed
- [#84](https://github.com/mza921/Plex-Auto-Collections/pull/84) - IndentationError
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Plex Auto Collections
##### Version 2.4.1
##### Version 2.4.2
Plex Auto Collections is a Python 3 script that works off a configuration file to create/update Plex collections. Collection management with this tool can be automated in a varying degree of customizability. Supports IMDB, TMDb, and Trakt lists as well as built in Plex Searches using actors, genres, year, studio and more.

![https://i.imgur.com/iHAYFIZ.png](https://i.imgur.com/iHAYFIZ.png)
Expand Down
19 changes: 11 additions & 8 deletions app/imdb_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ def imdb_get_movies(config_path, plex, data):
"//a/img//@data-tconst")
if "/search/" in imdb_url:
results = re.search('<span>\\d+-\\d+ of \\d+ titles.</span>', str(r.content))
total = 100 if results is None else re.findall('(\\d+)', results.group(0))[2]
total = 100 if results is None else re.findall('(\\d+)', results.group(0).replace(',', ''))[2]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the future, should we just set the size as a parameter and add it to the URL on the user's behalf?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i mean this solution should work and then if the list changes its total the user would have to constantly update the total

else:
results = re.search('(?<=<div class="desc lister-total-num-results">).*?(?=</div>)', str(r.content))
total = 100 if results is None else re.search('.*?(\\d+)', results.group(0)).group(1)
total = 100 if results is None else re.search('(\\d+)', results.group(0).replace(',', '')).group(1)

for i in range(1, math.ceil(int(total) / 100)):
try:
Expand Down Expand Up @@ -272,11 +272,14 @@ def tmdb_get_shows(config_path, plex, data, is_list=False):
for mid in t_tvs:
match = False
tvdb_id = get_tvdb_id_from_tmdb_id(mid)
for t in p_tv_map:
if p_tv_map[t] and "tt" not in p_tv_map[t] != "None":
if int(p_tv_map[t]) == int(tvdb_id):
match = True
break
if tvdb_id is None:
print("| Trakt Error: tmbd_id: {} could not converted to tvdb_id try just using tvdb_id instead".format(mid))
else:
for t in p_tv_map:
if p_tv_map[t] and "tt" not in p_tv_map[t] != "None":
if p_tv_map[t] is not None and int(p_tv_map[t]) == int(tvdb_id):
match = True
break
if match:
matched.append(t)
else:
Expand Down Expand Up @@ -306,7 +309,7 @@ def tvdb_get_shows(config_path, plex, data, is_list=False):
match = False
for t in p_tv_map:
if p_tv_map[t] and "tt" not in p_tv_map[t] != "None":
if int(p_tv_map[t]) == int(id):
if p_tv_map[t] is not None and int(p_tv_map[t]) == int(id):
match = True
break
if match:
Expand Down
2 changes: 1 addition & 1 deletion app/plex_auto_collections.py
Original file line number Diff line number Diff line change
Expand Up @@ -794,7 +794,7 @@ def append_collection(config_path, config_update=None):
print("| |_| |_|\___|/_\_\ /_/ \_\\\\_,_| \__|\___/ \___|\___/|_||_|\___|\__| \__||_|\___/|_||_|/__/ |")
print("| |")
print("|===================================================================================================|")
print("| Version 2.4.1")
print("| Version 2.4.2")
print("| Locating config...")
config_path = None
app_dir = os.path.dirname(os.path.abspath(__file__))
Expand Down