mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 08:49: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
|
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
|
// HasMagnetUri check uf MagnetURI is set or empty
|
||||||
func (r *Release) HasMagnetUri() bool {
|
func (r *Release) HasMagnetUri() bool {
|
||||||
return r.MagnetURI != ""
|
return r.MagnetURI != ""
|
||||||
|
|
|
@ -86,6 +86,7 @@ func (s *service) Process(release *domain.Release) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
defer release.CleanupTemporaryFiles()
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
|
|
||||||
// TODO check in config for "Save all releases"
|
// TODO check in config for "Save all releases"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue