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

Fix watched_at date for history entries + support TV shows + foreign characters #8

Merged
merged 4 commits into from
Dec 2, 2020

Conversation

awendland
Copy link
Contributor

Howdy @yulrizka. Thank you very much for creating this script! It made migrating to Trakt.tv so much easier than I had anticipated.

I made a few modifications to the script when I did my import a few days ago, and I wanted to offer them back to upstream to help other people who will be doing similar imports in the future. I intended to keep all changes within the original intent of your script, so hopefully they will be easy to accept. Please let me know if there is anything you'd like redacted to better fit your original intent. The changes I made are:

  • Adding support for UTF-8 characters in the IMDB ratings CSV file. I was having issues with a director's name that had an accent in it, but by adopting a different Ruby CSV import approach that works with the File module it appears to handle UTF-8 correctly (my languages of familiarity are not Ruby, so apologies if this is not actually a preferred approach. I found it at https://stackoverflow.com/a/38029962).
  • Adding a watched_at property to requests made to the sync/history endpoint. Without this property all the items are logged as being watched today, which I assume is not the intent. This watched_at property is set to the same date and time as the rated_at property used for the sync/ratings endpoint.
  • Added support for TV Show Episodes for both sync/ratings and sync/history. I had several in my imdb-ratings.csv and was therefore able to test this functionality.
  • Removed recording TV Shows from being submitted to sync/history. Because this would log all episodes as being watched on the same day, which I assume is rarely if ever the case in reality, I thought it might be best to only rate the TV Shows and avoid recording a watch history event with them. I left a comment in the source code that could be uncommented if someone wants this feature.

Thanks again for creating this script! It was a huge time saver for me and got me excitedly using Trakt.tv!

@awendland
Copy link
Contributor Author

I forgot to mention that this also incorporates the changes discussed in #6, #5, and #4 to handle the new "Date Rated" header (replacing the old "Date Added" header name).

Copy link
Owner

@yulrizka yulrizka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Thanks for the fixes. Looks good. I just has some minor comments to make the README more concise.

README.md Outdated Show resolved Hide resolved
@yulrizka yulrizka merged commit b0de418 into yulrizka:master Dec 2, 2020
@yulrizka
Copy link
Owner

yulrizka commented Dec 2, 2020

Thanks @awendland for the contribution and keeping the project up. Also complements for the thorough description :)

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