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 auth;
8mod backoff;
9mod client;
10mod clock;
11pub mod config;
12mod consts;
13pub mod desired;
14mod downloadable;
15mod error;
16mod executor;
17mod extras;
18mod ffmpeg;
19mod fs;
20mod graph;
21mod hash;
22mod http;
23mod limiter;
24mod lineage;
25mod lyrics;
26mod manifest;
27mod model;
28mod naming;
29mod orphans;
30pub mod reconcile;
31pub mod select;
32mod synced;
33mod tag;
34mod tag_alac;
35
36#[cfg(test)]
37mod testutil;
38
39#[cfg(test)]
40mod sync_chaos;
41
42pub use auth::{ClerkAuth, TOKEN_EXPIRY_WARN_DAYS, TokenExpiry, classify_token_expiry};
43pub use client::{BillingInfo, Playlist, Stem, SunoClient};
44pub use clock::Clock;
45pub use config::{
46    AccountConfig, AreaMode, AreasConfig, AudioFormat, Config, Defaults, EffectiveSettings,
47    FlagOverrides, SourceConfig, StemFormat, VideoCoverRetention,
48};
49pub use desired::{
50    ArtifactToggles, LIKED_PLAYLIST_ID, PlaylistInput, build_desired, build_playlist_desired,
51    clip_stems,
52};
53pub use downloadable::is_downloadable;
54pub use error::{Error, Result};
55pub use executor::{ExecOptions, ExecOutcome, Failure, Ports, RunStatus, execute};
56pub use extras::{
57    INDEX_SCHEMA_VERSION, M3u8Entry, render_clip_details, render_clip_lrc, render_clip_lyrics,
58    render_library_index, render_m3u8, render_synced_lrc,
59};
60pub use ffmpeg::{Ffmpeg, FfmpegError, FfmpegErrorKind, WebpEncodeSettings};
61pub use fs::{FileStat, Filesystem, FsError, FsErrorKind};
62pub use graph::{
63    AdoptDecision, AlbumArt, CacheEntry, LineageStore, Node, Owner, OwnerGate, PlaylistState,
64    StoredEdge, adopt_decision, owner_gate,
65};
66pub use hash::{
67    SYNCED_LRC_VERSION, art_hash, art_url_hash, content_hash, meta_hash, synced_lrc_source_hash,
68};
69pub use http::{Http, HttpRequest, HttpResponse, Method, TransportError};
70pub use lineage::{
71    AttributionEdge, Edge, EdgeRole, EdgeType, LineageContext, Resolution, ResolveOpts,
72    ResolveStatus, RootInfo, attribution_edges, edge_type, immediate_parent, lineage_edges,
73    resolve_roots,
74};
75pub use lyrics::{AlignedLine, AlignedLineWord, AlignedLyrics, AlignedWord};
76pub use manifest::{ArtifactState, Manifest, ManifestEntry, SyncedLyricsCheck};
77pub use model::{Clip, ClipRoot, HistoryEntry, MediaUrl};
78pub use naming::{
79    CharacterSet, DEFAULT_TEMPLATE, NamingConfig, NamingRequest, RenderedName, render_clip_name,
80    render_clip_names, sanitise_name, stem_file_path, stems_folder,
81};
82pub use orphans::untracked_audio;
83pub use reconcile::{
84    Action, AlbumDesired, ArtifactKind, Desired, DesiredArtifact, DesiredStem, LocalFile, Plan,
85    PlaylistDesired, SourceMode, SourceStatus, album_desired, area_fully_enumerated,
86    deletion_allowed, narrows_downloads, plan_album_artifacts, plan_playlist_artifacts,
87    playlist_authoritative, reconcile,
88};
89pub use synced::{
90    PendingCheck, SYNCED_LRC_RECHECK_SECS, apply_synced_lrc, preview_synced_lrc,
91    synced_lyrics_targets,
92};
93pub use tag::{TrackMetadata, tag_flac, tag_mp3};
94pub use tag_alac::tag_alac;