Fix watched_at date for history entries + support TV shows + foreign characters #8
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
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).watched_at
property to requests made to thesync/history
endpoint. Without this property all the items are logged as being watched today, which I assume is not the intent. Thiswatched_at
property is set to the same date and time as therated_at
property used for thesync/ratings
endpoint.sync/ratings
andsync/history
. I had several in my imdb-ratings.csv and was therefore able to test this functionality.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!