Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't delete downloads directory at startup if generated not set #1098

Merged
merged 3 commits into from
Feb 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions pkg/manager/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,11 @@ func Initialize() *singleton {
instance.RefreshConfig()

// clear the downloads and tmp directories
utils.EmptyDir(instance.Paths.Generated.Downloads)
utils.EmptyDir(instance.Paths.Generated.Tmp)
// #1021 - only clear these directories if the generated folder is non-empty
if config.GetGeneratedPath() != "" {
utils.EmptyDir(instance.Paths.Generated.Downloads)
utils.EmptyDir(instance.Paths.Generated.Tmp)
}

initFFMPEG()
})
Expand Down
2 changes: 1 addition & 1 deletion pkg/manager/paths/paths_generated.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func newGeneratedPaths() *generatedPaths {
gp.Vtt = filepath.Join(config.GetGeneratedPath(), "vtt")
gp.Markers = filepath.Join(config.GetGeneratedPath(), "markers")
gp.Transcodes = filepath.Join(config.GetGeneratedPath(), "transcodes")
gp.Downloads = filepath.Join(config.GetGeneratedPath(), "downloads")
gp.Downloads = filepath.Join(config.GetGeneratedPath(), "download_stage")
gp.Tmp = filepath.Join(config.GetGeneratedPath(), "tmp")
return &gp
}
Expand Down
1 change: 1 addition & 0 deletions ui/v2.5/src/components/Changelog/versions/v050.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
* Support configurable number of threads for scanning and generation.

### 🐛 Bug fixes
* Fixed stash potentially deleting `downloads` directory when first run.
* Fix sprite generation when generated path has special characters.
* Prevent studio from being set as its own parent
* Fixed performer scraper select overlapping search results
Expand Down