lib/downloader.rb in narou-1.5.7.1 vs lib/downloader.rb in narou-1.5.8
- old
+ new
@@ -374,11 +374,11 @@
when "1"
return false
when "2"
return true
when "3"
- Command::Freeze.execute_and_rescue_exit([old_toc["title"]])
+ Command::Freeze.execute!([old_toc["title"]])
return true
when "4"
STDOUT.puts "あらすじ"
STDOUT.puts latest_toc["story"]
when "5"
@@ -514,14 +514,17 @@
toc_source = Helper.pretreatment_source(toc_fp.read, @setting["encoding"])
end
rescue OpenURI::HTTPError => e
if e.message =~ /^404/
error "<red>[404]</red> 小説が削除されている可能性があります"
- return false
+ $stdout.silence do
+ Command::Flag.execute!(["delete", "--on", @id])
+ end
else
- raise
+ error "何らかの理由により目次が取得できませんでした(#{e.message})"
end
+ return false
end
@setting.multi_match(toc_source, "title", "author", "story", "tcode")
@setting["title"] = get_title
if series_novel?
# 連載小説
@@ -869,9 +872,10 @@
#
# 小説データの格納ディレクトリを初期設定する
#
def init_novel_dir
novel_dir_path = get_novel_data_dir
+ file_title = File.basename(novel_dir_path)
FileUtils.mkdir_p(novel_dir_path) unless File.exists?(novel_dir_path)
default_settings = NovelSetting::DEFAULT_SETTINGS
special_preset_dir = File.join(Narou.get_preset_dir, @setting["domain"], @setting["ncode"])
exists_special_preset_dir = File.exists?(special_preset_dir)
[NovelSetting::INI_NAME, "converter.rb", NovelSetting::REPLACE_NAME].each do |filename|