<commit_before>module Services
  class SyncWatchedMoviesWithTrakt
    def initialize
      @api = Broad::ServiceRegistry.trakt_user
    end

    def perform
      Movie.where(watched: false, imdb_id: trakt_movie_imdb_ids).update_all watched: true
    end

    private

    def trakt_movie_imdb_ids
      @api.history_movies.map{|history_movie| history_movie.movie.ids.imdb}
    end
  end
end<commit_msg>We need updated_at for the cache busting to work properly<commit_after>module Services
  class SyncWatchedMoviesWithTrakt
    def initialize
      @api = Broad::ServiceRegistry.trakt_user
    end

    def perform
      Movie.where(watched: false, imdb_id: trakt_movie_imdb_ids).update_all watched: true, updated_at: Time.now
    end

    private

    def trakt_movie_imdb_ids
      @api.history_movies.map{|history_movie| history_movie.movie.ids.imdb}
    end
  end
end
{'fraction_non_alphanumeric': 0.06307339449541284, 'fraction_numerical': 0.0, 'mean_word_length': 3.6684491978609626, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6718864', 'n_tokens_mistral': 305, 'n_tokens_neox': 284, 'n_words': 62}