mirror of
https://github.com/hkalexling/Mango.git
synced 2026-03-20 00:00:48 -04:00
Rename Job#plugin_name to plugin_id
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user