Skip to main content

suno_core/
lib.rs

1//! Core engine for rs-suno: library selection, sync reconciliation, and tagging.
2//!
3//! Runtime-agnostic and free of direct IO. Network access happens through the
4//! [`Http`] port, which a CLI adapter implements, so the engine stays testable
5//! in isolation.
6
7mod album_art;
8mod area;
9mod auth;
10mod backoff;
11mod client;
12mod clock;
13pub mod config;
14mod consts;
15pub mod desired;
16mod downloadable;
17mod error;
18mod executor;
19mod extras;
20mod ffmpeg;
21mod fs;
22mod graph;
23mod hash;
24mod http;
25mod identity;
26mod limiter;
27mod lineage;
28mod lyrics;
29mod manifest;
30mod model;
31mod naming;
32mod orphans;
33mod pathkey;
34pub mod reconcile;
35mod roots;
36pub mod select;
37mod synced;
38mod tag;
39mod tag_alac;
40mod tracks;
41mod vocab;
42mod wire;
43
44#[cfg(test)]
45mod testutil;
46
47#[cfg(test)]
48mod sync_chaos;
49
50pub use album_art::{AlbumArt, PlaylistState};
51pub use area::{
52    AreaKind, AreaListing, adoption_enumerated, area_enumerated, area_mode, build_modes_by_id,
53    build_scoped_playlist_desired, library_authoritative, playlists_enumerated, source_statuses,
54    union_clips,
55};
56pub use auth::{ClerkAuth, TOKEN_EXPIRY_WARN_DAYS, TokenExpiry, classify_token_expiry};
57pub use client::SunoClient;
58pub use clock::Clock;
59pub use config::{
60    AccountConfig, AreaMode, AreasConfig, Config, Defaults, EffectiveSettings, FlagOverrides,
61    Settings, SourceConfig,
62};
63pub use desired::{
64    ArtifactToggles, LIKED_PLAYLIST_ID, PlaylistInput, build_desired, build_playlist_desired,
65    clip_stems,
66};
67pub use downloadable::is_downloadable;
68pub use error::{Error, Result};
69pub use executor::{ExecOptions, ExecOutcome, Failure, Ports, RunStatus, execute};
70pub use extras::{
71    INDEX_SCHEMA_VERSION, M3u8Entry, render_clip_details, render_clip_lrc, render_clip_lyrics,
72    render_library_index, render_m3u8, render_synced_lrc,
73};
74pub use ffmpeg::{Ffmpeg, FfmpegError, FfmpegErrorKind};
75pub use fs::{FileStat, Filesystem, FsError, FsErrorKind};
76pub use graph::{CacheEntry, LineageStore, Node, StoredEdge};
77pub use hash::{
78    SYNCED_LRC_VERSION, art_hash, art_url_hash, content_hash, meta_hash, synced_lrc_source_hash,
79};
80pub use http::{Http, HttpRequest, HttpResponse, Method, TransportError};
81pub use identity::{AdoptDecision, Owner, OwnerGate, adopt_decision, owner_gate};
82pub use lineage::{
83    AttributionEdge, Edge, EdgeRole, EdgeType, LineageContext, Resolution, ResolveStatus, RootInfo,
84    attribution_edges, edge_type, immediate_parent, lineage_edges,
85};
86pub use lyrics::{AlignedLine, AlignedLineWord, AlignedLyrics, AlignedWord};
87pub use manifest::{ArtifactState, Manifest, ManifestEntry, SyncedLyricsCheck};
88pub use model::{BillingInfo, Clip, ClipRoot, HistoryEntry, MediaUrl, Playlist, Stem};
89pub use naming::{
90    CharacterSet, DEFAULT_TEMPLATE, NamingConfig, NamingRequest, RenderedName, render_clip_name,
91    render_clip_names, sanitise_name, stem_file_path, stems_folder,
92};
93pub use orphans::untracked_audio;
94pub use reconcile::{
95    Action, AlbumDesired, Desired, DesiredArtifact, DesiredStem, LocalFile, Plan, PlaylistDesired,
96    SourceStatus, album_desired, area_authoritative, area_fully_enumerated, deletion_allowed,
97    narrows_downloads, plan_album_artifacts, plan_playlist_artifacts, reconcile,
98};
99pub use roots::{ResolveOpts, resolve_roots};
100pub use synced::{
101    PendingCheck, SYNCED_LRC_RECHECK_SECS, apply_synced_lrc, preview_synced_lrc,
102    synced_lyrics_targets,
103};
104pub use tag::{Cover, TrackMetadata, flac_picture_data_budget, tag_flac, tag_mp3};
105pub use tag_alac::tag_alac;
106pub use tracks::{LeadResolution, TrackAssignment, assign_track_numbers, resolve_lead_ids};
107pub use vocab::{
108    ArtifactKind, AudioFormat, SourceMode, StemFormat, VideoCoverRetention, WebpEncodeSettings,
109};