mirror of
https://github.com/hkalexling/Mango.git
synced 2025-08-05 04:15:35 -04:00
Store manga ID with subscriptions
This commit is contained in:
parent
5442d124af
commit
fe6f884d94
@ -5,6 +5,7 @@ const component = () => {
|
||||
pid: undefined,
|
||||
chapters: undefined, // undefined: not searched yet, []: empty
|
||||
manga: undefined, // undefined: not searched yet, []: empty
|
||||
mid: undefined, // id of the selected manga
|
||||
allChapters: [],
|
||||
query: "",
|
||||
mangaTitle: "",
|
||||
@ -374,6 +375,7 @@ const component = () => {
|
||||
},
|
||||
mangaSelected(event) {
|
||||
const mid = event.currentTarget.getAttribute("data-id");
|
||||
this.mid = mid;
|
||||
this.searchChapters(mid);
|
||||
},
|
||||
subscribe(modal) {
|
||||
@ -384,6 +386,7 @@ const component = () => {
|
||||
filters: this.filterSettings,
|
||||
plugin: this.pid,
|
||||
name: this.subscriptionName.trim(),
|
||||
manga: this.mid,
|
||||
}),
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
|
@ -54,12 +54,13 @@ struct Subscription
|
||||
|
||||
property id : String
|
||||
property plugin_id : String
|
||||
property manga_id : String
|
||||
property name : String
|
||||
property created_at : Int64
|
||||
property last_checked : Int64
|
||||
property filters = [] of Filter
|
||||
|
||||
def initialize(@plugin_id, @name)
|
||||
def initialize(@plugin_id, @manga_id, @name)
|
||||
@id = UUID.random.to_s
|
||||
@created_at = Time.utc.to_unix
|
||||
@last_checked = Time.utc.to_unix
|
||||
|
@ -629,12 +629,13 @@ struct APIRouter
|
||||
post "/api/admin/plugin/subscriptions" do |env|
|
||||
begin
|
||||
plugin_id = env.params.json["plugin"].as String
|
||||
manga_id = env.params.json["manga"].as String
|
||||
filters = env.params.json["filters"].as(Array(JSON::Any)).map do |f|
|
||||
Filter.from_json f.to_json
|
||||
end
|
||||
name = env.params.json["name"].as String
|
||||
|
||||
sub = Subscription.new plugin_id, name
|
||||
sub = Subscription.new plugin_id, manga_id, name
|
||||
sub.filters = filters
|
||||
|
||||
plugin = Plugin.new plugin_id
|
||||
|
Loading…
x
Reference in New Issue
Block a user