Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
zaknesler committed Jan 2, 2024
1 parent 124e9e0 commit 266406b
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

Nothing yet.
### Changed

- Don't log transfers if no tracks were actually transferred

## [0.14.3] - 2023-12-29

Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "modulate"
version = "0.14.3"
version = "0.14.4"
edition = "2021"

[profile.dev]
Expand Down
9 changes: 9 additions & 0 deletions src/sync/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
use core::num;

use self::error::SyncResult;
use crate::{
api::client::{self, Client, WithToken},
Expand Down Expand Up @@ -104,6 +106,13 @@ pub async fn sync_watcher(
) -> SyncResult<u32> {
let res = sync_watcher_inner(ctx.clone(), client, &watcher_repo, watcher, &now).await;

let num_tracks = res.as_ref().unwrap_or(&0).clone();

// Only log if we've actually transferred tracks
if num_tracks == 0 {
return Ok(0);
}

// Save transfer result
TransferRepo::new(ctx.clone()).log_transfer(
watcher.id,
Expand Down

0 comments on commit 266406b

Please sign in to comment.