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:
Ludvig Lundgren 2021-11-24 23:18:12 +01:00 committed by GitHub
parent d22dd2fe84
commit 7177e48c02
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
40 changed files with 5859 additions and 3328 deletions

View file

@ -10,8 +10,8 @@ import (
"github.com/rs/zerolog/log"
)
func (s *service) execCmd(announce domain.Announce, action domain.Action, torrentFile string) {
log.Debug().Msgf("action exec: %v release: %v", action.Name, announce.TorrentName)
func (s *service) execCmd(release domain.Release, action domain.Action, torrentFile string) {
log.Debug().Msgf("action exec: %v release: %v", action.Name, release.TorrentName)
// check if program exists
cmd, err := exec.LookPath(action.ExecCmd)
@ -22,9 +22,9 @@ func (s *service) execCmd(announce domain.Announce, action domain.Action, torren
// handle args and replace vars
m := Macro{
TorrentName: announce.TorrentName,
TorrentName: release.TorrentName,
TorrentPathName: torrentFile,
TorrentUrl: announce.TorrentUrl,
TorrentUrl: release.TorrentURL,
}
// parse and replace values in argument string before continuing
@ -53,5 +53,5 @@ func (s *service) execCmd(announce domain.Announce, action domain.Action, torren
duration := time.Since(start)
log.Info().Msgf("executed command: '%v', args: '%v' %v,%v, total time %v", cmd, parsedArgs, announce.TorrentName, announce.Site, duration)
log.Info().Msgf("executed command: '%v', args: '%v' %v,%v, total time %v", cmd, parsedArgs, release.TorrentName, release.Indexer, duration)
}