diff --git a/public/js/download-manager.js b/public/js/download-manager.js index 51869c0..4ff6e2e 100644 --- a/public/js/download-manager.js +++ b/public/js/download-manager.js @@ -119,12 +119,12 @@ const load = () => { const dropdown = obj.status_message.length > 0 ? `
${obj.status_message}
` : ''; const retryBtn = obj.status_message.length > 0 ? `` : ''; return ` - ${obj.plugin_name ? obj.title : `${obj.title}`} - ${obj.plugin_name ? obj.manga_title : `${obj.manga_title}`} + ${obj.plugin_id ? obj.title : `${obj.title}`} + ${obj.plugin_id ? obj.manga_title : `${obj.manga_title}`} ${obj.success_count}/${obj.pages} ${moment(obj.time).fromNow()} ${statusSpan} ${dropdown} - ${obj.plugin_name || ""} + ${obj.plugin_id || ""} ${retryBtn} diff --git a/src/plugin/downloader.cr b/src/plugin/downloader.cr index 7847526..d336a00 100644 --- a/src/plugin/downloader.cr +++ b/src/plugin/downloader.cr @@ -31,11 +31,11 @@ class Plugin @queue.set_status Queue::JobStatus::Downloading, job begin - unless job.plugin_name - raise "Job does not have plugin name specificed" + unless job.plugin_id + raise "Job does not have a plugin ID specificed" end - plugin = Plugin.new_from_id job.plugin_name.not_nil! + plugin = Plugin.new_from_id job.plugin_id.not_nil! info = plugin.select_chapter job.plugin_chapter_id.not_nil! pages = info["pages"].as_i diff --git a/src/queue.cr b/src/queue.cr index cec40f8..e69ac66 100644 --- a/src/queue.cr +++ b/src/queue.cr @@ -50,7 +50,7 @@ class Queue property success_count : Int32 = 0 property fail_count : Int32 = 0 property time : Time - property plugin_name : String? + property plugin_id : String? property plugin_chapter_id : String? def parse_query_result(res : DB::ResultSet) @@ -69,7 +69,7 @@ class Queue ary = @id.split("-") if ary.size == 2 - @plugin_name = ary[0] + @plugin_id = ary[0] @plugin_chapter_id = ary[1] end end @@ -82,7 +82,7 @@ class Queue end def initialize(@id, @manga_id, @title, @manga_title, @status, @time, - @plugin_name = nil) + @plugin_id = nil) end def to_json(json) @@ -100,7 +100,7 @@ class Queue json.field "time" do json.number @time.to_unix_ms end - json.field "plugin_name", @plugin_name if @plugin_name + json.field "plugin_id", @plugin_id if @plugin_id end end end