Skip to main content

max / audiofiles

sync_panel: follow synckit billing API (BillingInterval enum, Cents newtype) Adapts the sync settings panel to synckit-client's finalized billing types: interval is now BillingInterval (use as_str() for the label) and quote_cents returns Cents (extract .0 for the existing format_cents). Restores the audiofiles-browser build after the synckit refactor. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Author: Max Johnson <me@maxj.phd> · 2026-06-22 23:16 UTC
Commit: 9c017f2ea6146d5e20a61e6caa171210ecc8d8a2
Parent: df8fb3b
1 file changed, +4 insertions, -4 deletions
@@ -191,7 +191,7 @@ fn draw_subscription_section(
191 191 Some(sub) if sub.active => {
192 192 let limit = sub.storage_limit_bytes.unwrap_or(0);
193 193 let used = sub.storage_used_bytes.unwrap_or(0);
194 - let interval = sub.interval.as_deref().unwrap_or("monthly");
194 + let interval = sub.interval.map(|i| i.as_str()).unwrap_or("monthly");
195 195
196 196 ui.label(format!(
197 197 "Subscribed: {} ({})",
@@ -257,8 +257,8 @@ fn draw_subscription_section(
257 257 ui.label(egui::RichText::new("Opening browser...").weak());
258 258 });
259 259 } else {
260 - let annual = format_cents(pricing.quote_cents(cap_bytes, BillingInterval::Annual));
261 - let monthly = format_cents(pricing.quote_cents(cap_bytes, BillingInterval::Monthly));
260 + let annual = format_cents(pricing.quote_cents(cap_bytes, BillingInterval::Annual).0);
261 + let monthly = format_cents(pricing.quote_cents(cap_bytes, BillingInterval::Monthly).0);
262 262 ui.horizontal(|ui| {
263 263 if widgets::primary_button(ui, &format!("Subscribe annual \u{2014} {annual}/yr")).clicked() {
264 264 state.sync.checkout_loading = true;
@@ -707,7 +707,7 @@ fn draw_cap_picker(
707 707 );
708 708
709 709 let cap_bytes = state.sync.cap_picker_gib * GIB;
710 - let price_cents = pricing.quote_cents(cap_bytes, interval);
710 + let price_cents = pricing.quote_cents(cap_bytes, interval).0;
711 711 let interval_word = match interval {
712 712 BillingInterval::Monthly => "month",
713 713 BillingInterval::Annual => "year",