lib/list_imports/hummingbird.rb
# Enumerate all the rows in the list
Enumerate all the rows in the list
Enumerate all the rows in the list
def each
    @list.each do |row|
      exact_keys = %w{episodes_watched rewatch_count rewatching notes private rating
                      chapters_read volumes_read reread_count rereading}
      hash = row.slice(*exact_keys).symbolize_keys
      hash[:last_watched] = Time.parse(row['last_watched']) if hash[:last_watched]
      hash[:last_read] = Time.parse(row['last_read']) if hash[:last_read]
      hash[:status] = STATUS_MAP[row['status']]
      hash[:media] = @db.find(row[@media_type.to_s]['id'])
      yield hash
    end
  end
def each @list . each do | row | exact_keys = %w{ episodes_watched rewatch_count rewatching notes private rating chapters_read volumes_read reread_count rereading } hash = row . slice ( * exact_keys ) . symbolize_keys hash [ :last_watched ] = Time . parse ( row [ 'last_watched' ] ) if hash [ :last_watched ] hash [ :last_read ] = Time . parse ( row [ 'last_read' ] ) if hash [ :last_read ] hash [ :status ] = STATUS_MAP [ row [ 'status' ] ] hash [ :media ] = @db . find ( row [ @media_type . to_s ] [ 'id' ] ) yield hash end end
Enumerate all the rows in the list
Enumerate all the rows in the list
# If this weren't our own backup, we'd want to use a fuzzy match instead