Skip to main content

sync_remote

Function sync_remote 

Source
pub fn sync_remote(
    db: &Database,
    client: &SubsonicClient,
    full: bool,
    url: &str,
    username: &str,
) -> Result<FullSync, SyncError>
Expand description

Pull the library, then reconcile favourites and playlists.

One function because there are four callers — the app, the CLI, the GraphQL job and koan’s own auto-sync — and they had each been told separately what a sync consists of. Two of them never heard about playlists, and the auto-sync had never heard about favourites either, so a star made on the server only arrived if you happened to press the button yourself.

The library comes first: favourites and playlists both name tracks by the server’s ids, and neither can find a track the library has not seen yet.