Skip to content

Commit

Permalink
sorting seasons now numerically
Browse files Browse the repository at this point in the history
  • Loading branch information
fracpete committed Aug 11, 2024
1 parent 9fd3099 commit 6e15967
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/kodi/imdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,11 +202,15 @@ def generate_imdb(id, language="en", fanart="none", fanart_file="folder.jpg", pa
# determine seasons
seasons_episodes = determine_episodes(path, episode_pattern=episode_pattern,
season_group=season_group, episode_group=episode_group)
logger.info("Located seasons: %s" % ", ".join(sorted(seasons_episodes.keys())))
try:
seasons_sorted = sorted(seasons_episodes.keys(), key=int)
except:
seasons_sorted = sorted(seasons_episodes.keys())
logger.info("Located seasons: %s" % ", ".join(seasons_sorted))

# extract episodes for seasons on disk
season_data = {}
for season in seasons_episodes.keys():
for season in seasons_sorted:
season_data[season] = {}
url = create_episodes_url(id, season=season)
logger.info("Season %s URL: %s" % (season, url))
Expand Down

0 comments on commit 6e15967

Please sign in to comment.