mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 00:39:13 +00:00
Feature: Save releases (#36)
* chore: tidy deps * refactor: database migration * refactor: store release * refactor: save release * chore: add packages * feat(web): show stats and recent releases * refactor: simply filter struct * feat: add eventbus * chore: cleanup logging * chore: update packages
This commit is contained in:
parent
d22dd2fe84
commit
7177e48c02
40 changed files with 5859 additions and 3328 deletions
|
@ -25,9 +25,10 @@ type Server struct {
|
|||
filterService filterService
|
||||
indexerService indexerService
|
||||
ircService ircService
|
||||
releaseService releaseService
|
||||
}
|
||||
|
||||
func NewServer(sse *sse.Server, address string, baseUrl string, actionService actionService, authService authService, downloadClientSvc downloadClientService, filterSvc filterService, indexerSvc indexerService, ircSvc ircService) Server {
|
||||
func NewServer(sse *sse.Server, address string, baseUrl string, actionService actionService, authService authService, downloadClientSvc downloadClientService, filterSvc filterService, indexerSvc indexerService, ircSvc ircService, releaseSvc releaseService) Server {
|
||||
return Server{
|
||||
sse: sse,
|
||||
address: address,
|
||||
|
@ -39,6 +40,7 @@ func NewServer(sse *sse.Server, address string, baseUrl string, actionService ac
|
|||
filterService: filterSvc,
|
||||
indexerService: indexerSvc,
|
||||
ircService: ircSvc,
|
||||
releaseService: releaseSvc,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -94,6 +96,7 @@ func (s Server) Handler() http.Handler {
|
|||
r.Route("/filters", newFilterHandler(encoder, s.filterService).Routes)
|
||||
r.Route("/irc", newIrcHandler(encoder, s.ircService).Routes)
|
||||
r.Route("/indexer", newIndexerHandler(encoder, s.indexerService, s.ircService).Routes)
|
||||
r.Route("/release", newReleaseHandler(encoder, s.releaseService).Routes)
|
||||
|
||||
r.HandleFunc("/events", func(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
|
@ -105,7 +108,7 @@ func (s Server) Handler() http.Handler {
|
|||
"X-Accel-Buffering": "no",
|
||||
}
|
||||
|
||||
s.sse.HTTPHandler(w, r)
|
||||
s.sse.ServeHTTP(w, r)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue