Skip to content

Commit

Permalink
Merge pull request #90 from meisnate12/master
Browse files Browse the repository at this point in the history
2.4.2 Fixes for #87 and #89
  • Loading branch information
mza921 committed Nov 5, 2020
2 parents c2072de + d620d75 commit adffea9
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 10 deletions.
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]
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

0 comments on commit adffea9

Please sign in to comment.