harden deezer auth errors and mixed playlist preflight

This commit is contained in:
2026-04-21 12:19:23 +02:00
parent 1246a24749
commit 654bed17e2
4 changed files with 142 additions and 22 deletions

View File

@@ -728,6 +728,20 @@ func (m *Main) ripPlaylist(ctx context.Context, p provider.Client, source, playl
}
func (m *Main) ripPlaylistMixed(ctx context.Context, playlistID, name string, refs []PlaylistTrackRef) error {
requiredSources := map[string]struct{}{}
for _, ref := range refs {
s := strings.TrimSpace(ref.Source)
if s == "" {
continue
}
requiredSources[s] = struct{}{}
}
for source := range requiredSources {
if err := m.requireSourceDownloadAuth(source); err != nil {
return err
}
}
folder := filepath.Join(m.Config.Session.Downloads.Folder, naming.CleanName(name, naming.Config{
RestrictCharacters: m.Config.Session.Filepaths.RestrictCharacters,
TruncateTo: m.Config.Session.Filepaths.TruncateTo,