• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Aucun tag

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Never give up


Commit MetaInfo

Révision68192ca299ad30c99dbbcef55376f11f521fe0b5 (tree)
l'heure2013-11-06 02:02:07
AuteurHMML <hmml3939@gmai...>
CommiterHMML

Message de Log

Strict check on preview target files, and translate error.

Change Summary

Modification

--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -51,6 +51,7 @@ en:
5151
5252 voice_preview:
5353 err: "Failed to generate preview voice"
54+ err_missing: Audio file is missing. Check the file name in zip.
5455 err_concat: Failed to concat
5556 err_not_ogg: File is not OGG/Vorbis format
5657 err_normalize: Failed on rate/channel normalization
--- a/config/locales/ja.yml
+++ b/config/locales/ja.yml
@@ -71,6 +71,7 @@ ja:
7171
7272 voice_preview:
7373 err: プレビューの生成に失敗しました
74+ err_missing: 音声ファイルが見つかりません。OGGのファイル名を確認してください。
7475 err_not_ogg: ファイル形式がOGG/Vorbisではありません
7576 err_concat: 連結に失敗しました
7677 err_normalize: サンプルレート/チャネル数の変更に失敗しました
--- a/lib/paperclip_processors/voice_preview.rb
+++ b/lib/paperclip_processors/voice_preview.rb
@@ -38,7 +38,10 @@ class VoicePreview < Paperclip::Processor
3838 end
3939 end
4040 end
41- tfiles.empty? and raise "File missing."
41+ if tfiles.size < 3
42+ Rails.logger.error "Preview target is missing. zip entry count=#{Zip::ZipFile.foreach(src.path).count}"
43+ raise I18n.t("voice_preview.err_missing")
44+ end
4245 tfiles.each do |tf|
4346 `soxi -t "#{tf}"`.chomp.downcase == 'vorbis' &&
4447 `soxi -e "#{tf}"`.chomp.downcase == 'vorbis' or