番組登録を追加(登録時の過去回の選択、一時停止・再開・解除、既知の回の記録)

This commit is contained in:
2026-10-03 19:44:57 +09:00
parent 2e82a690b1
commit 787eda79ae
21 changed files with 1257 additions and 24 deletions
+17 -5
View File
@@ -17,9 +17,10 @@ import (
var assets embed.FS
type page struct {
Title string
Newer *newerView
Queue *queueView
Title string
Newer *newerView
Queue *queueView
Subscriptions *subscriptionsView
}
type JobStore interface {
@@ -30,6 +31,11 @@ type JobStore interface {
Retry(context.Context, int64) error
RetryEpisode(context.Context, string) error
CancelQueued(context.Context, int64) error
SubscribedSeries(context.Context, []string) (map[string]bool, error)
RegisterSubscription(context.Context, string, string, []store.Episode, bool) (bool, error)
ListSubscriptions(context.Context) ([]store.Subscription, error)
SetSubscriptionEnabled(context.Context, string, bool) error
DeleteSubscription(context.Context, string) (bool, error)
}
type server struct {
@@ -68,9 +74,15 @@ func NewHandler(fetcher NewerFetcher, jobs JobStore, now func() time.Time, logge
mux.HandleFunc("GET /queue/list", s.queueFragment)
mux.HandleFunc("POST /jobs/{id}/retry", s.retryJob)
mux.HandleFunc("POST /jobs/{id}/cancel", s.cancelJob)
mux.HandleFunc("GET /subscriptions", s.subscriptionsPage)
mux.HandleFunc("GET /subscriptions/list", s.subscriptionsFragment)
mux.HandleFunc("GET /subscriptions/choice", s.subscriptionChoice)
mux.HandleFunc("POST /subscriptions/register", s.registerSubscription)
mux.HandleFunc("POST /subscriptions/{id}/pause", s.pauseSubscription)
mux.HandleFunc("POST /subscriptions/{id}/resume", s.resumeSubscription)
mux.HandleFunc("POST /subscriptions/{id}/delete", s.deleteSubscription)
for path, title := range map[string]string{
"GET /subscriptions": "登録番組",
"GET /library": "ライブラリ",
"GET /library": "ライブラリ",
} {
mux.HandleFunc(path, func(w http.ResponseWriter, _ *http.Request) {
w.Header().Set("Content-Type", "text/html; charset=utf-8")