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