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

Feature/episode groups #20

Merged
merged 12 commits into from
Dec 1, 2024
Merged

Conversation

Tyr3al
Copy link
Contributor

@Tyr3al Tyr3al commented Jun 30, 2023

I recently came across the issue, that the standard TMDB episode order for a particular show was not matching the DVD/Bluray release one. Fortunately in many cases, there are additional "Episode Groups" available, that contain custom orders and can be accessed by via TMDBs API.

To resolve my issue, I added a new flag called "--episode-group" or short "-g". When this flag is enabled, the app first behaves like if the "--manual" flag was set - the user is asked for the right tv show. After that, a second dialog is started where the user can select the wanted episode group.

Next a mapping dictionary is created, to be able to fetch the right episode information with the groups numbers, e.g. 1x47 in an episode group is equivalent to 2x03 in TMDB's standard order. For this to work, the groups within the episode group have to have a parsable name like "Season 1" , "Volume 1" or Special (which is handles as Season 0).

I tried to work with the existing code and only modify the management of the episode numbers for the API lookups.

Changelog:

Updated

  • System.Text.Json 7.0.3 -> 9.0.0
  • Microsoft.Extensions.Caching.Memory 7.0.0 -> 9.0.0
  • TMDbLib 2.0.0 -> 2.2.0

Added

  • Episode Group Support (--episode-group / -g)

Changed

  • Changed target Framework from .NET 7.0 to .NET 8.0 (LTS)
  • Updated codebase with new .NET Features
  • Updated codebase according to sonarqube recommendations

jamerst
jamerst previously approved these changes Jul 8, 2023
@jamerst jamerst dismissed their stale review July 8, 2023 13:32

Clicking wrong thing accidentally

@jamerst
Copy link
Owner

jamerst commented Jul 8, 2023

Thanks for the pull request, apologies for the delay in reviewing it. This is a bit of a complicated feature that I had considered in the past, but just couldn't be bothered to implement 😆. Props for doing it for me!

Just fixed a few minor bugs found during testing, I think I'm happy for it to be merged if you're happy with the episode group parsing caveats mentioned in a previous comment? It would probably be a good idea to handle errors with duplicate seasons more gracefully if possible, currently it throws an exception due to the duplicate dictionary key.

@Tyr3al
Copy link
Contributor Author

Tyr3al commented Jul 13, 2023

Thanks for looking into it!

Yes you are right, the error handling could be better. I’ll get to it, as soon as i have time ;)

@Tyr3al Tyr3al force-pushed the feature/episode-groups branch from 1c56794 to 37c620b Compare November 18, 2024 19:37
@Tyr3al Tyr3al requested a review from jamerst November 18, 2024 21:02
@Tyr3al
Copy link
Contributor Author

Tyr3al commented Nov 18, 2024

@jamerst I finally found some time to work on this PR again. I reworked the code to better handle collection groups with atypical season namings and duplicates.
While on it, I updated the dependencies and the target framework to the latest LTS.

@Tyr3al Tyr3al force-pushed the feature/episode-groups branch from b7e745b to 9617475 Compare November 18, 2024 22:01
@jamerst jamerst merged commit cf3eb12 into jamerst:master Dec 1, 2024
@jamerst
Copy link
Owner

jamerst commented Jan 29, 2025

This has finally been released in v4.0.0. Sorry it took so long!

Ended up doing some major refactoring to facilitate unit testing. Just a few minor changes to this feature, namely that it doesn't enable manual mode any more - it can be used without it now and just allows selecting the episode group from any of the search results.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants