mirror of
https://github.com/hkalexling/Mango.git
synced 2026-04-25 00:00:52 -04:00
Store manga ID with subscriptions
This commit is contained in:
@@ -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
|
||||
|
||||
+2
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user