mirror of
https://github.com/hkalexling/Mango.git
synced 2025-08-03 03:15:31 -04:00
Rename Job#plugin_name
to plugin_id
This commit is contained in:
parent
2a910335af
commit
ebf6221876
@ -119,12 +119,12 @@ const load = () => {
|
|||||||
const dropdown = obj.status_message.length > 0 ? `<div uk-dropdown>${obj.status_message}</div>` : '';
|
const dropdown = obj.status_message.length > 0 ? `<div uk-dropdown>${obj.status_message}</div>` : '';
|
||||||
const retryBtn = obj.status_message.length > 0 ? `<a onclick="refresh('${obj.id}')" uk-icon="refresh"></a>` : '';
|
const retryBtn = obj.status_message.length > 0 ? `<a onclick="refresh('${obj.id}')" uk-icon="refresh"></a>` : '';
|
||||||
return `<tr id="chapter-${obj.id}">
|
return `<tr id="chapter-${obj.id}">
|
||||||
<td>${obj.plugin_name ? obj.title : `<a href="${baseURL}/chapter/${obj.id}">${obj.title}</a>`}</td>
|
<td>${obj.plugin_id ? obj.title : `<a href="${baseURL}/chapter/${obj.id}">${obj.title}</a>`}</td>
|
||||||
<td>${obj.plugin_name ? obj.manga_title : `<a href="${baseURL}/manga/${obj.manga_id}">${obj.manga_title}</a>`}</td>
|
<td>${obj.plugin_id ? obj.manga_title : `<a href="${baseURL}/manga/${obj.manga_id}">${obj.manga_title}</a>`}</td>
|
||||||
<td>${obj.success_count}/${obj.pages}</td>
|
<td>${obj.success_count}/${obj.pages}</td>
|
||||||
<td>${moment(obj.time).fromNow()}</td>
|
<td>${moment(obj.time).fromNow()}</td>
|
||||||
<td>${statusSpan} ${dropdown}</td>
|
<td>${statusSpan} ${dropdown}</td>
|
||||||
<td>${obj.plugin_name || ""}</td>
|
<td>${obj.plugin_id || ""}</td>
|
||||||
<td>
|
<td>
|
||||||
<a onclick="remove('${obj.id}')" uk-icon="trash"></a>
|
<a onclick="remove('${obj.id}')" uk-icon="trash"></a>
|
||||||
${retryBtn}
|
${retryBtn}
|
||||||
|
@ -31,11 +31,11 @@ class Plugin
|
|||||||
@queue.set_status Queue::JobStatus::Downloading, job
|
@queue.set_status Queue::JobStatus::Downloading, job
|
||||||
|
|
||||||
begin
|
begin
|
||||||
unless job.plugin_name
|
unless job.plugin_id
|
||||||
raise "Job does not have plugin name specificed"
|
raise "Job does not have a plugin ID specificed"
|
||||||
end
|
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!
|
info = plugin.select_chapter job.plugin_chapter_id.not_nil!
|
||||||
|
|
||||||
pages = info["pages"].as_i
|
pages = info["pages"].as_i
|
||||||
|
@ -50,7 +50,7 @@ class Queue
|
|||||||
property success_count : Int32 = 0
|
property success_count : Int32 = 0
|
||||||
property fail_count : Int32 = 0
|
property fail_count : Int32 = 0
|
||||||
property time : Time
|
property time : Time
|
||||||
property plugin_name : String?
|
property plugin_id : String?
|
||||||
property plugin_chapter_id : String?
|
property plugin_chapter_id : String?
|
||||||
|
|
||||||
def parse_query_result(res : DB::ResultSet)
|
def parse_query_result(res : DB::ResultSet)
|
||||||
@ -69,7 +69,7 @@ class Queue
|
|||||||
|
|
||||||
ary = @id.split("-")
|
ary = @id.split("-")
|
||||||
if ary.size == 2
|
if ary.size == 2
|
||||||
@plugin_name = ary[0]
|
@plugin_id = ary[0]
|
||||||
@plugin_chapter_id = ary[1]
|
@plugin_chapter_id = ary[1]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -82,7 +82,7 @@ class Queue
|
|||||||
end
|
end
|
||||||
|
|
||||||
def initialize(@id, @manga_id, @title, @manga_title, @status, @time,
|
def initialize(@id, @manga_id, @title, @manga_title, @status, @time,
|
||||||
@plugin_name = nil)
|
@plugin_id = nil)
|
||||||
end
|
end
|
||||||
|
|
||||||
def to_json(json)
|
def to_json(json)
|
||||||
@ -100,7 +100,7 @@ class Queue
|
|||||||
json.field "time" do
|
json.field "time" do
|
||||||
json.number @time.to_unix_ms
|
json.number @time.to_unix_ms
|
||||||
end
|
end
|
||||||
json.field "plugin_name", @plugin_name if @plugin_name
|
json.field "plugin_id", @plugin_id if @plugin_id
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user