mirror of
https://github.com/crunchy-labs/crunchy-cli.git
synced 2026-01-21 04:02:00 -06:00
Don't remove the subtitles if the video is detected to be identical
This commit is contained in:
parent
cdf054ff58
commit
21a5782825
1 changed files with 6 additions and 5 deletions
|
|
@ -298,10 +298,11 @@ impl Execute for Archive {
|
||||||
|
|
||||||
video_paths.push((download_video(&ctx, primary, false).await?, primary));
|
video_paths.push((download_video(&ctx, primary, false).await?, primary));
|
||||||
for additional in additionally {
|
for additional in additionally {
|
||||||
|
let identical_video = additionally
|
||||||
|
.iter()
|
||||||
|
.all(|a| a.stream.bandwidth == primary.stream.bandwidth);
|
||||||
let only_audio = match self.merge {
|
let only_audio = match self.merge {
|
||||||
MergeBehavior::Auto => additionally
|
MergeBehavior::Auto => identical_video,
|
||||||
.iter()
|
|
||||||
.all(|a| a.stream.bandwidth == primary.stream.bandwidth),
|
|
||||||
MergeBehavior::Audio => true,
|
MergeBehavior::Audio => true,
|
||||||
MergeBehavior::Video => false,
|
MergeBehavior::Video => false,
|
||||||
};
|
};
|
||||||
|
|
@ -312,8 +313,8 @@ impl Execute for Archive {
|
||||||
video_paths.push((path, additional))
|
video_paths.push((path, additional))
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove subtitles of deleted video
|
// Remove subtitles of forcibly deleted video
|
||||||
if only_audio {
|
if matches!(self.merge, MergeBehavior::Audio) && !identical_video {
|
||||||
subtitles.retain(|s| s.episode_id != additional.episode_id);
|
subtitles.retain(|s| s.episode_id != additional.episode_id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue