[6] fixed awards dynamic collections range

pull/1826/head
meisnate12 12 months ago
parent 971c9ba2f8
commit 5501764f16

@ -10,5 +10,6 @@ Updated lxml requirement to 5.1.0
# Bug Fixes
Fixed the Rate Limit on MDbList calls
Fixed collection fields being locked during batch edits when they shouldn't be
Fixed awards dynamic collections where `latest` wasn't pulling the correct values
Various other Minor Fixes

@ -46,7 +46,7 @@ Here are some examples of the things you can achieve using Plex Meta Manager!
![Movie Collection Preview](https://metamanager.wiki/en/latest/images/movie-collection-preview.png)
**Example Show Overlays using the [Plex Meta Manager Defaults](https://metamanager.wiki/en/latest/defaults/overalys)** (click to enlarge):
**Example Show Overlays using the [Plex Meta Manager Defaults](https://metamanager.wiki/en/latest/defaults/overlays)** (click to enlarge):
![Show Library Preview](https://metamanager.wiki/en/latest/images/show-library-preview.png)

@ -1 +1 @@
1.20.0-develop5
1.20.0-develop6

@ -34,7 +34,7 @@ dynamic_collections:
sync: true
data:
event_id: ev0000123
starting: latest-5
starting: latest-4
ending: latest
title_format: BAFTA <<key_name>>
template:

@ -34,7 +34,7 @@ dynamic_collections:
sync: true
data:
event_id: ev0000091
starting: latest-5
starting: latest-4
ending: latest
title_format: Berlinale <<key_name>>
template:

@ -34,7 +34,7 @@ dynamic_collections:
sync: true
data:
event_id: ev0000147
starting: latest-5
starting: latest-4
ending: latest
title_format: Cannes <<key_name>>
template:

@ -35,7 +35,7 @@ dynamic_collections:
sync: true
data:
event_id: ev0000157
starting: latest-5
starting: latest-4
ending: latest
title_format: Cesar <<key_name>>
template:

@ -34,7 +34,7 @@ dynamic_collections:
sync: true
data:
event_id: ev0000133
starting: latest-5
starting: latest-4
ending: latest
title_format: Critics Choice Awards <<key_name>>
template:

@ -58,7 +58,7 @@ dynamic_collections:
sync: true
data:
event_id: ev0000223
starting: latest-5
starting: latest-4
ending: latest
title_format: Emmys <<key_name>>
template:

@ -68,7 +68,7 @@ dynamic_collections:
sync: true
data:
event_id: ev0000292
starting: latest-5
starting: latest-4
ending: latest
title_format: Golden Globe <<key_name>>
template:

@ -33,7 +33,7 @@ dynamic_collections:
sync: true
data:
event_id: ev0000468
starting: latest-5
starting: latest-4
ending: latest
title_format: National Film Registry <<key_name>>
template:

@ -59,7 +59,7 @@ dynamic_collections:
sync: true
data:
event_id: ev0000003
starting: latest-5
starting: latest-4
ending: latest
title_format: Oscars Winners <<key_name>>
template:

@ -42,7 +42,7 @@ dynamic_collections:
sync: true
data:
event_id: ev0000530
starting: latest-5
starting: latest-4
ending: latest
title_format: People's Choice Awards <<key_name>>
template:

@ -34,7 +34,7 @@ dynamic_collections:
sync: true
data:
event_id: ev0000558
starting: latest-5
starting: latest-4
ending: latest
title_format: Razzie <<key_name>>
template:

@ -39,7 +39,7 @@ dynamic_collections:
sync: true
data:
event_id: ev0000598
starting: latest-5
starting: latest-4
ending: latest
title_format: Screen Actors Guild <<key_name>>
template:

@ -34,7 +34,7 @@ dynamic_collections:
sync: true
data:
event_id: ev0000349
starting: latest-5
starting: latest-4
ending: latest
title_format: Independent Spirit Awards <<key_name>>
template:

@ -34,7 +34,7 @@ dynamic_collections:
sync: true
data:
event_id: ev0000631
starting: latest-5
starting: latest-4
ending: latest
title_format: Sundance Film Festival <<key_name>>
template:

@ -41,7 +41,7 @@ dynamic_collections:
sync: true
data:
event_id: ev0000659
starting: latest-5
starting: latest-4
ending: latest
title_format: Toronto International Film Festival <<key_name>>
template:

@ -42,7 +42,7 @@ dynamic_collections:
sync: true
data:
event_id: ev0000681
starting: latest-5
starting: latest-4
ending: latest
title_format: Venice <<key_name>>
template:

@ -84,7 +84,7 @@ dynamic_collections:
# check1
trakt_url:
mcu: https://trakt.tv/users/donxy/lists/marvel-cinematic-universe
trek: https://trakt.tv/users/wdvhucb/lists/star-trek
trek: https://trakt.tv/users/dgw/lists/star-trek-canon
middle: https://trakt.tv/users/oya-kesh/lists/middle-earth
# check2
mdblist_url:

@ -1000,27 +1000,28 @@ class MetadataFile(DataFile):
_, event_years = self.config.IMDb.get_event_years(event_id)
year_options = [event_years[len(event_years) - i] for i in range(1, len(event_years) + 1)]
def get_position(attr, pos_add=0):
def get_position(attr):
if attr not in award_methods:
return 0 if attr == "starting" else len(year_options)
position_value = str(dynamic_data[award_methods[attr]])
if not position_value:
raise Failed(f"Config Error: {map_name} data {attr} attribute is blank")
if position_value.startswith(("first", "latest", "current_year")):
int_values = position_value.split("+" if position_value.startswith("first") else "-")
is_first = position_value.startswith("first")
int_values = position_value.split("+" if is_first else "-")
try:
if len(int_values) == 1:
return 0 if position_value.startswith("first") else len(year_options)
return 1 if is_first else len(year_options)
else:
return int(int_values[1].strip()) * (1 if position_value.startswith("first") else -1)
return (int(int_values[1].strip()) + (1 if is_first else 0)) * (1 if is_first else -1)
except ValueError:
raise Failed(f"Config Error: {map_name} data {attr} attribute modifier invalid '{int_values[1]}'")
elif position_value in year_options:
return year_options.index(position_value) + pos_add
return year_options.index(position_value) + 1
else:
raise Failed(f"Config Error: {map_name} data {attr} attribute invalid: {position_value}")
found_options = year_options[get_position("starting"):get_position("ending")]
found_options = year_options[get_position("starting") - 1:get_position("ending")]
if not found_options:
raise Failed(f"Config Error: {map_name} data starting/ending range found no valid events")

@ -55,7 +55,7 @@ class TVDbObj:
try:
data = self._tvdb.get_request(item_url)
except Failed:
raise Failed(f"TVDb Error: {'Movie' if is_movie else 'Series'} not found at {item_url}")
raise Failed(f"TVDb Error: No {'Movie' if is_movie else 'Series'} found for TVDb ID: {tvdb_id} at {item_url}")
def parse_page(xpath, is_list=False):
parse_results = data.xpath(xpath)

@ -394,7 +394,7 @@ def run_config(config, stats):
playlist_status = {}
playlist_stats = {}
if (config.playlist_files or config.general["playlist_report"]) and not run_args["overlays-only"] and not run_args["operations-only"] and not run_args["collections-only"] and not config.requested_files:
if (config.playlist_files or config.general["playlist_report"]) and not run_args["overlays-only"] and not run_args["metadata-only"] and not run_args["operations-only"] and not run_args["collections-only"] and not config.requested_files:
#logger.add_playlists_handler()
if config.playlist_files:
playlist_status, playlist_stats = run_playlists(config)

Loading…
Cancel
Save