ye
This commit is contained in:
@@ -136,10 +136,11 @@ func run() error {
|
||||
|
||||
matcher := match.NewMatcher(qb)
|
||||
transferCfg := transfer.Config{
|
||||
DryRun: cfg.DryRun,
|
||||
PublicPlaylists: cfg.PublicPlaylists,
|
||||
Concurrency: cfg.Concurrency,
|
||||
LikedName: cfg.LikedPlaylist,
|
||||
DryRun: cfg.DryRun,
|
||||
PublicPlaylists: cfg.PublicPlaylists,
|
||||
Concurrency: cfg.Concurrency,
|
||||
LikedName: cfg.LikedPlaylist,
|
||||
TargetPlaylistID: cfg.TargetPlaylistID,
|
||||
Progress: func(msg string) {
|
||||
fmt.Printf("\r%-140s", msg)
|
||||
},
|
||||
@@ -644,12 +645,12 @@ func buildPlaylistPlans(cfg config.Config, fileEntries []jobconfig.PlaylistEntry
|
||||
}
|
||||
|
||||
if cfg.TargetPlaylistID > 0 {
|
||||
uniqueIDs := map[string]struct{}{}
|
||||
for id := range plans {
|
||||
uniqueIDs[id] = struct{}{}
|
||||
}
|
||||
if len(uniqueIDs) != 1 {
|
||||
return nil, nil, fmt.Errorf("--target-playlist-id can only be used with exactly one source playlist URL")
|
||||
// Apply the global target to all plans that don't already have a per-playlist target.
|
||||
for id, plan := range plans {
|
||||
if plan.TargetPlaylistID == 0 {
|
||||
plan.TargetPlaylistID = cfg.TargetPlaylistID
|
||||
plans[id] = plan
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user