Skip to content

Commit

Permalink
Restore some old mystery code just in case
Browse files Browse the repository at this point in the history
  • Loading branch information
b123400 committed Dec 31, 2023
1 parent 8701d11 commit f3813d7
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/plugin/text_info.rb
Original file line number Diff line number Diff line change
Expand Up @@ -293,10 +293,7 @@ def store_patinfo_change_diff(patinfo, lang, new_patinfo_lang)
if old_text.eql?(new_patinfo_lang.to_s)
LogFile.debug "store_patinfo_change_diff: #{lang} skip #{patinfo.odba_id} eql? #{old_text.eql?(new_patinfo_lang)} size #{old_size}"
else
new_patinfo_lang.change_log = patinfo.description(lang).change_log
new_patinfo_lang.add_change_log_item(old_text, new_patinfo_lang)
new_patinfo_lang.odba_store
patinfo.descriptions[lang] = new_patinfo_lang
diff_item = patinfo.description(lang).add_change_log_item(old_text, new_patinfo_lang)
patinfo.odba_store
LogFile.debug "store_patinfo_change_diff: #{lang} #{patinfo.odba_id} eql? #{old_text.eql?(new_patinfo_lang)} size #{old_size} -> #{patinfo.description(lang).change_log.size}"
end
Expand All @@ -317,6 +314,10 @@ def store_package_patinfo(package, lang, patinfo_lang)
package.patinfo.odba_store
end if package.patinfo && package.patinfo.is_a?(ODDB::Patinfo)
if package.patinfo && package.patinfo.is_a?(ODDB::Patinfo) && package.patinfo.descriptions[lang]
old_ti = package.patinfo; Languages.each do |old_lang|
next if old_lang.eql?(lang)
eval("package.patinfo.descriptions['#{old_lang}']= old_ti.descriptions['#{old_lang}']")
end
msg += ' change_diff'
store_patinfo_change_diff(package.patinfo, lang, patinfo_lang)
elsif package.patinfo && package.patinfo.is_a?(ODDB::Patinfo) && package.patinfo.descriptions.is_a?(Hash)
Expand Down

0 comments on commit f3813d7

Please sign in to comment.