Import a rating: Trakt JSON format: undefined local variable

Sorry for asking a similar question today. I am importing using the Trakt format JSON importer.

Input file 1: FAIL: first record has a rating

[
    {
        "imdb_id": "tt1234567",
        "watched_at": "2009-01-01T00:00:00Z",
        "rating": 6,
        "rated_at": "2009-01-01T00:00:00Z"
    },
    {
        "imdb_id": "tt2234567",
        "rating": 6,
        "rated_at": "2012-01-01T00:00:00Z"
    }
]

Error:
error (undefined local variable or method `row' for an instance of Importers::Parsers::Json)

Input file 2: SUCCESS: I removed the rating in the first record. (The second record still has a rating.)

[
    {
        "imdb_id": "tt1234567",
        "watched_at": "2009-01-01T00:00:00Z"
    },
    {
        "imdb_id": "tt2234567",
        "rating": 6,
        "rated_at": "2012-01-01T00:00:00Z"
    }
]

It did a lot of various tests. It seems like when the first record has a rating the error happens.

By the way, when an import succeeds I still don’t see the rating for tt2234567.

In the beginning importing ratings wasnt supported.

Only importing to watchlist and watch history.

I suggest sending a mail to support@trakt.tv.

Also. Where are you trying to import data from? There might be an easier way :slight_smile:

I’ll email support. Thanks.

I am sure you’re right about an easier way. I am importing data from an app I wrote years ago so I can only blame myself. I want to support Trakt, TMDb, and Letterboxd.

Yes, I am updating my app now. It is doing well exporting json and csv files in various formats. Now I just need to be sure I know the details of the format expected on the other end (Trakt JSON). I am excited about using Trakt! Expecially the Apple TV app.

I agree I should use the Trakt API instead of export/import. I’m just looking for a quicker solution to implement.