mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 00:39:13 +00:00
fix(release): cleanup temporary torrent files (#839)
* fix(release): cleanup temporary files * the other file * backout revert
This commit is contained in:
parent
6e5385a490
commit
1b8f2fce3c
2 changed files with 10 additions and 0 deletions
|
@ -426,6 +426,15 @@ func (r *Release) downloadTorrentFile(ctx context.Context) error {
|
|||
return errFunc
|
||||
}
|
||||
|
||||
func (r *Release) CleanupTemporaryFiles() {
|
||||
if len(r.TorrentTmpFile) == 0 {
|
||||
return
|
||||
}
|
||||
|
||||
os.Remove(r.TorrentTmpFile)
|
||||
r.TorrentTmpFile = ""
|
||||
}
|
||||
|
||||
// HasMagnetUri check uf MagnetURI is set or empty
|
||||
func (r *Release) HasMagnetUri() bool {
|
||||
return r.MagnetURI != ""
|
||||
|
|
|
@ -86,6 +86,7 @@ func (s *service) Process(release *domain.Release) {
|
|||
return
|
||||
}
|
||||
|
||||
defer release.CleanupTemporaryFiles()
|
||||
ctx := context.Background()
|
||||
|
||||
// TODO check in config for "Save all releases"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue