Shows can be expanded to list their seasons, each with its size and its own Dry run / Move buttons. A season joins the same show on the other server, so finished seasons can go to the big server while the current one stays on the fast one. - Source exports a season from the show folder, with a manifest of just that season's folder plus the show's loose non-video files. Refuses seasons with no folder of their own, or whose folder holds otherseasons' episodes. - Destination finds the show by provider ID, then name. If it already has the show, the show's own files are skipped (Job.skip_files) and never overwritten; otherwise they come with the season. Refuses if the season folder already exists. - Only episode watch state is carried for a season. - Source trashes just the season folder; after the last season, the leftover show folder joins it in the same trash entry if no videos remain. The chosen trash entry is saved so a re-run after a crash finishes in the same place. - New GET /seasons (UI and peer). Fake Jellyfin gains season items. - e2e tests: season into a new show, into an existing show, last season leaving, destination already has the season, misfiled episodes.
This commit is contained in:
1 parent
25a743b350
commit
484ac50508
21 files changed
+959
-111
No files matched your search
@@ -119,7 +119,7 @@ async fn pull_all(fx: &Fixture, p: &Puller) -> PathBuf {
|
||||
.unwrap();
|
||||
}
|
||||
let target = lib_root.join("Alien (1979)");
|
||||
promote(&partial, &target, &manifest).await.unwrap();
|
||||
promote(&partial, &target, &manifest, &[]).await.unwrap();
|
||||
target
|
||||
}
|
||||
|
||||
@@ -200,7 +200,7 @@ async fn refuses_to_overwrite_existing_files() {
|
||||
.await
|
||||
.unwrap();
|
||||
}
|
||||
let err = promote(&partial, &target, &manifest).await.unwrap_err();
|
||||
let err = promote(&partial, &target, &manifest, &[]).await.unwrap_err();
|
||||
assert!(matches!(err, jm_transfer::TransferError::Exists(_)));
|
||||
// Nothing was moved: the stranger's file is untouched and no video landed.
|
||||
assert_eq!(
|
||||
@@ -216,11 +216,43 @@ async fn promote_is_idempotent() {
|
||||
let target = pull_all(&fx, &puller()).await;
|
||||
let manifest = build_manifest(&fx.src.root).await.unwrap();
|
||||
// A second promote after a "crash" finds everything already in place.
|
||||
promote(&partial_dir(fx.dst_dir.path(), "job1"), &target, &manifest)
|
||||
promote(&partial_dir(fx.dst_dir.path(), "job1"), &target, &manifest, &[])
|
||||
.await
|
||||
.unwrap();
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn promote_leaves_skipped_files_alone() {
|
||||
let fx = fixture().await;
|
||||
let manifest = build_manifest(&fx.src.root).await.unwrap();
|
||||
let nfo = manifest
|
||||
.files
|
||||
.iter()
|
||||
.position(|f| f.rel_path == "Alien (1979).nfo")
|
||||
.unwrap();
|
||||
// The target already has its own NFO; that entry is skipped and never copied.
|
||||
let target = fx.dst_dir.path().join("Alien (1979)");
|
||||
std::fs::create_dir_all(&target).unwrap();
|
||||
std::fs::write(target.join("Alien (1979).nfo"), b"mine").unwrap();
|
||||
let partial = partial_dir(fx.dst_dir.path(), "job1");
|
||||
prepare_partial(&partial).await.unwrap();
|
||||
let p = puller();
|
||||
for (idx, entry) in manifest.files.iter().enumerate() {
|
||||
if idx == nfo {
|
||||
continue;
|
||||
}
|
||||
let url = format!("{}/files/{idx}", fx.base);
|
||||
p.pull_verified(&url, entry, &part_path(&partial, idx), &mut |_| {})
|
||||
.await
|
||||
.unwrap();
|
||||
}
|
||||
promote(&partial, &target, &manifest, &[nfo]).await.unwrap();
|
||||
assert_eq!(std::fs::read(target.join("Alien (1979).nfo")).unwrap(), b"mine");
|
||||
assert!(target.join("Alien (1979).mkv").exists());
|
||||
// And it's still idempotent.
|
||||
promote(&partial, &target, &manifest, &[nfo]).await.unwrap();
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn bandwidth_limit_is_applied() {
|
||||
let fx = fixture().await;
|
||||
|
||||
Reference in new issue
Block a user