feat: add licensing and access controls

This commit is contained in:
ShukeBta
2026-05-29 12:47:54 +08:00
parent 2f7ec3ab17
commit 27df93fa3d
61 changed files with 2032 additions and 237 deletions
+6
View File
@@ -31,6 +31,7 @@ type subscriptionReq struct {
ExcludeWords string `json:"exclude_words"`
WashEnabled bool `json:"wash_enabled"`
WashPriority string `json:"wash_priority"`
TotalEpisodes int `json:"total_episodes"`
Priority int `json:"priority"`
Enabled *bool `json:"enabled"`
}
@@ -68,6 +69,7 @@ func createSubscriptionHandler(svc *service.Container) gin.HandlerFunc {
ExcludeWords: req.ExcludeWords,
WashEnabled: req.WashEnabled,
WashPriority: req.WashPriority,
TotalEpisodes: req.TotalEpisodes,
Priority: req.Priority,
Enabled: enabled,
}
@@ -76,6 +78,9 @@ func createSubscriptionHandler(svc *service.Container) gin.HandlerFunc {
c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()})
return
}
enriched := []model.Subscription{*s}
service.EnrichSubscriptionProgress(c.Request.Context(), svc.Repo, enriched)
*s = enriched[0]
c.JSON(http.StatusOK, s)
}
}
@@ -88,6 +93,7 @@ func listSubscriptionsHandler(svc *service.Container) gin.HandlerFunc {
return
}
enrichAndPersistSubscriptions(c.Request.Context(), svc, items)
service.EnrichSubscriptionProgress(c.Request.Context(), svc.Repo, items)
c.JSON(http.StatusOK, gin.H{"items": items})
}
}