Files
Libation/Source/LibationCli/ContentLicenseDeniedCliSummary.cs
rmcrackan 0cc2ef773d * Default Scan library to on for new accounts from Upsert / Mkb79 import (matches GUI)
* CLI liberate: print short license-denial reasons to stderr
* GUI: message when stoplight can’t queue (e.g. absent from last scan)
2026-05-05 13:32:28 -04:00

27 lines
991 B
C#

using AudibleApi;
using System;
using System.Collections.Generic;
namespace LibationCli;
internal static class ContentLicenseDeniedCliSummary
{
/// <summary>Short lines for stderr when Audible denies a download license; mirrors log detail without dumping the full JSON.</summary>
public static IEnumerable<string> Lines(ContentLicenseDeniedException ex)
{
ArgumentNullException.ThrowIfNull(ex);
yield return "Audible denied a content license (download not allowed for this account/title).";
yield return ex.Message;
if (ex.Ownership?.Message is { } own && !string.IsNullOrWhiteSpace(own))
yield return $"Ownership: {own}";
if (ex.Client?.Message is { } cli && !string.IsNullOrWhiteSpace(cli))
yield return $"Client: {cli}";
if (ex.Membership?.Message is { } mem && !string.IsNullOrWhiteSpace(mem))
yield return $"Membership: {mem}";
if (ex.AYCL?.Message is { } aycl && !string.IsNullOrWhiteSpace(aycl))
yield return $"AYCL (aka: Plus catalog): {aycl}";
}
}