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

Redundant checks for ITraktMovie properties in TraktScrobbleModule #94

Closed
sapierens opened this issue Mar 12, 2019 · 1 comment
Closed

Comments

@sapierens
Copy link

sapierens commented Mar 12, 2019

Currently the method that validates ITraktMovie object is performing two redundant checks that end up in throwing exceptions. Only movie ids field is required to start scrobbling.
I did some tests and it looks like Trakt is completely ignoring the title and year parameters (I tried it with complete nonsense values) and it starts scrobbling correctly, as long as ids field is present.

So the below checks aren't needed and cause problems, since it's an inconsistency with the ITraktEpisode validator, where having only ids field is allowed.

if (string.IsNullOrEmpty(movie.Title))
throw new ArgumentException("movie title not valid", nameof(movie.Title));
if (movie.Year <= 0 || movie.Year.ToString().Length != 4)
throw new ArgumentOutOfRangeException(nameof(movie), "movie year not valid");

Trakt.NET version: v1.1.0-developer-preview-278

@henrikfroehling
Copy link
Owner

Trakt.NET Version: v1.0.0-preview.212

@henrikfroehling henrikfroehling added this to the Version 1.0.0 Beta 1 milestone Mar 13, 2019
@henrikfroehling henrikfroehling changed the title Redundant checks that throw exception in TraktScrobbleModule Redundant checks for ITraktMovie properties in TraktScrobbleModule Mar 13, 2019
@henrikfroehling henrikfroehling self-assigned this Mar 13, 2019
henrikfroehling added a commit that referenced this issue Mar 13, 2019
…ie title and year

Resolves GH-95
(cherry picked from commit 9ad604f)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

No branches or pull requests

2 participants