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