Skip to content

Commit

Permalink
Merge branch 'skadogg/issue112'
Browse files Browse the repository at this point in the history
  • Loading branch information
skadogg committed Mar 7, 2024
2 parents bee12d2 + 53a4347 commit 6c13985
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion modules/runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def time_left_in_tv_series_report(show_list):
minutes_total = time_left_in_tv_series(season_data, runtime)
pct_done = percent_complete(minutes_left, minutes_total)

time_info.append([show_title, minutes_left, minutes_total, pct_done])
time_info.append([show_title, minutes_left, minutes_total, pct_done, runtime, show_list[i].next_episode])

time_info_sorted = sorted(time_info, key=lambda x: (x[1], x[0]))
return time_info_sorted
18 changes: 13 additions & 5 deletions run.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,14 +134,22 @@
# Write table for time left in TV series
logging.info('Writing time left in TV series table')
time_info = modules.runtime.time_left_in_tv_series_report(data_list_everything)
html_handle.write('<p>\n<table>\n<th>Title</th><th>Minutes Left</th>\n')
html_handle.write('<p>\n<table>\n<th>Title</th><th>Minutes Left</th><th>Minutes Per Episode</th><th>Next Episode</th>\n')

for i in range(len(time_info)):
# html_handle.write('<tr><td>' + time_info[i][0] + '</td><td>' + str(round(time_info[i][3] * 100,
# 0)) + '%</td></tr>') #percent done
html_handle.write('<tr><td>' + time_info[i][0] + '</td><td>' + str(time_info[i][1]) + '</td></tr>') # minutes left
time_info_title = time_info[i][0]
time_info_min_left = str(time_info[i][1])
time_info_ep_runtime = str(time_info[i][4])

time_info_next_ep = time_info[i][5]
if time_info_next_ep != 'S1 E1':
time_info_next_ep += ' ▶️'

html_handle.write('<tr><td>' + time_info_title + '</td><td>' + time_info_min_left + '</td><td>' + time_info_ep_runtime + '</td><td>' + time_info_next_ep + '</td></tr>') # minutes left

html_handle.write('</table>\n</p>\n')

# # # Movies sorted by runtime
# Movies sorted by runtime
logging.info('Writing Movies sorted by runtime table')
html_handle.write(modules.justwatch.generate_movies_by_runtime_table(data_list_everything))

Expand Down

0 comments on commit 6c13985

Please sign in to comment.