Skip to content

Commit

Permalink
Merge pull request #1008 from avalonmediasystem/feature/#946-bookmark…
Browse files Browse the repository at this point in the history
…-import

Remove bad UTF8 encoding work around
  • Loading branch information
carrickr committed Jul 28, 2016
2 parents 8e37fab + 4325db2 commit 4263716
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/tasks/avalon.rake
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,8 @@ namespace :avalon do

user['playlist_item'].each do |playlist_item|
container = playlist_item['container_string']
comment = HTMLEntities.new.decode(playlist_item['comment'].encode('UTF-8', 'binary', invalid: :replace, undef: :replace, replace: ''))
title = HTMLEntities.new.decode(playlist_item['name'].encode('UTF-8', 'binary', invalid: :replace, undef: :replace, replace: ''))
comment = HTMLEntities.new.decode(playlist_item['comment'])
title = HTMLEntities.new.decode(playlist_item['name'])
mf_obj = MasterFile.where("dc_identifier_tesim:#{container}").first
unless mf_obj.present?
item_errors += [{username: user['username'], playlist_id: playlist_obj.id, container: container, title: title, errors: ['Masterfile not found']}]
Expand All @@ -258,7 +258,7 @@ namespace :avalon do
end
playlist_item['bookmark'].each do |bookmark|
bookmark_count += 1
bookmark_name = HTMLEntities.new.decode(bookmark['name'].encode('UTF-8', 'binary', invalid: :replace, undef: :replace, replace: ''))
bookmark_name = HTMLEntities.new.decode(bookmark['name'])
sql = ActiveRecord::Base.send(:sanitize_sql_array, ["SELECT id FROM temp_marker WHERE playlist_item_id=? and title=? and start_time=?", pi_obj.id, bookmark_name, bookmark['start_time']])
bookmark_id = conn.exec_query(sql)
bookmark_obj = !bookmark_id.empty? ? AvalonMarker.find(bookmark_id.first['id']) : []
Expand Down

0 comments on commit 4263716

Please sign in to comment.