mirror of
https://github.com/truewhile/MeBox.git
synced 2026-10-07 13:56:37 +08:00
fix media organize and subscription workflows
This commit is contained in:
@@ -76,6 +76,7 @@ func (s *ScannerService) maybeGenerateSTRMAfterScan(libraryID string) {
|
||||
Enabled: true,
|
||||
IncludeLocal: true,
|
||||
Overwrite: true,
|
||||
PreserveTree: s.autoSTRMPreserveTree(ctx),
|
||||
SkipSettingsSave: true,
|
||||
}
|
||||
if outDir, scope := s.autoSTRMOutputDir(ctx); outDir != "" {
|
||||
@@ -103,3 +104,11 @@ func (s *ScannerService) autoSTRMOutputDir(ctx context.Context) (string, string)
|
||||
scope, _ := s.repo.Setting.Get(ctx, "strm.output_scope")
|
||||
return resolveMappedDestinationPath(strings.TrimSpace(outDir)), strings.ToLower(strings.TrimSpace(scope))
|
||||
}
|
||||
|
||||
func (s *ScannerService) autoSTRMPreserveTree(ctx context.Context) bool {
|
||||
if s == nil || s.repo == nil || s.repo.Setting == nil {
|
||||
return false
|
||||
}
|
||||
value, err := s.repo.Setting.Get(ctx, "strm.preserve_tree")
|
||||
return err == nil && parseBoolSetting(value, false)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user