Override existing file - different extension
Override existing file - different extension
Is it possible for the override command to overwrite existing file if the extension is different? At the moment when AMC is importing movie file i seem to have duplicates of the files with different extensions
Example
Gladiator\Gladiator.mvk
Gladiator\Gladiator.mp4
Gladiator\Gladiator..avi
I only wish to have one copy, preferably the latest and largest file size. I thought override handled this?
Example
Gladiator\Gladiator.mvk
Gladiator\Gladiator.mp4
Gladiator\Gladiator..avi
I only wish to have one copy, preferably the latest and largest file size. I thought override handled this?
Re: Override existing file - different extension
1.
2.
The amc script does not support those kind of "duplicate" checks. Conflict behaviour doesn't come into play if the file path is different.I thought override handled this?
2.
That might be conceivable as a separate script that detects and delete semantic duplicates.I only wish to have one copy, preferably the latest and largest file size.
Please read the FAQ and How to Request Help.
Re: Override existing file - different extension
Ah okay, so override only works if the file extension is the same?
Is this script something you are looking at developing? At the moment im using a file duplicator software to manually remove them each time
Is this script something you are looking at developing? At the moment im using a file duplicator software to manually remove them each time
Re: Override existing file - different extension
I guess this is already half of the solution:
Just add a few more lines to select the one you want, and the delete the others.
@see viewtopic.php?f=8&t=3791#p21206
Code: Select all
args.getFiles{ it.isVideo() }.groupBy{ it.metadata }.each{ m, fs ->
println "$m => $fs.name"
}
@see viewtopic.php?f=8&t=3791#p21206
Please read the FAQ and How to Request Help.
Re: Override existing file - different extension
You can play with something like this and see if it works for you:
Code: Select all
def args = '/Users/reinhard/Development/test/OUTPUT' as File
args.getFiles{ it.isVideo() }.groupBy{ it.metadata }.each{ m, fs ->
if (fs.size() > 1) {
println m
fs.toSorted(new VideoQuality()).eachWithIndex{ f, i ->
if (i == 0) {
println "[+] 1. $f"
} else {
println "[-] ${i+1}. $f"
// f.delete()
}
}
}
}
Please read the FAQ and How to Request Help.
Re: Override existing file - different extension
Cheers mate, will have a go
Re: Override existing file - different extension
Here's the other thread with the same issue: viewtopic.php?t=3791
Please read the FAQ and How to Request Help.
Re: Override existing file - different extension
thanks again!
-
- Posts: 1
- Joined: 19 Mar 2024, 17:26
Re: Override existing file - different extension
In case it could be helpful for anybody else, this is a simple post-processing script I am using to delete duplicates, in cases where the --action replace doesn't cut it.
This is only for absolute overriding and doesn't do any quality checks whatsoever.
Below is a sample output from using the script.
Groovy: Select all
{ source, target, metadata ->
def fileName = target.nameWithoutExtension
target.dir.listFiles { file ->
file != target && file.video && file.nameWithoutExtension == fileName
}.each { fileToDelete ->
trash(fileToDelete)
}
}
Below is a sample output from using the script.
Console Output: Select all
Lookup via [Westworld] [Westworld]
Fetching episode data for [Westworld]
* Westworld [296762] | 36 episodes | 1x01-10 .. 2x01-10 .. 3x01-08 .. 4x01-08
[MOVE] from [/library/downloads/complete/Westworld.S04.1080p.BluRay.x265-RARBG/Westworld.S04E01.1080p.BluRay.x265-RARBG.mp4] to [/library/library/shows/Westworld (2016)/Season 04/Westworld (2016) - S04E01 - The Auguries.mp4]
[MOVE] from [/library/downloads/complete/Westworld.S04.1080p.BluRay.x265-RARBG/Westworld.S04E02.1080p.BluRay.x265-RARBG.mp4] to [/library/library/shows/Westworld (2016)/Season 04/Westworld (2016) - S04E02 - Well Enough Alone.mp4]
[MOVE] from [/library/downloads/complete/Westworld.S04.1080p.BluRay.x265-RARBG/Westworld.S04E03.1080p.BluRay.x265-RARBG.mp4] to [/library/library/shows/Westworld (2016)/Season 04/Westworld (2016) - S04E03 - Années Folles.mp4]
[MOVE] from [/library/downloads/complete/Westworld.S04.1080p.BluRay.x265-RARBG/Westworld.S04E04.1080p.BluRay.x265-RARBG.mp4] to [/library/library/shows/Westworld (2016)/Season 04/Westworld (2016) - S04E04 - Generation Loss.mp4]
[MOVE] from [/library/downloads/complete/Westworld.S04.1080p.BluRay.x265-RARBG/Westworld.S04E05.1080p.BluRay.x265-RARBG.mp4] to [/library/library/shows/Westworld (2016)/Season 04/Westworld (2016) - S04E05 - Zhuangzi.mp4]
[MOVE] from [/library/downloads/complete/Westworld.S04.1080p.BluRay.x265-RARBG/Westworld.S04E06.1080p.BluRay.x265-RARBG.mp4] to [/library/library/shows/Westworld (2016)/Season 04/Westworld (2016) - S04E06 - Fidelity.mp4]
[MOVE] from [/library/downloads/complete/Westworld.S04.1080p.BluRay.x265-RARBG/Westworld.S04E07.1080p.BluRay.x265-RARBG.mp4] to [/library/library/shows/Westworld (2016)/Season 04/Westworld (2016) - S04E07 - Metanoia.mp4]
[MOVE] from [/library/downloads/complete/Westworld.S04.1080p.BluRay.x265-RARBG/Westworld.S04E08.1080p.BluRay.x265-RARBG.mp4] to [/library/library/shows/Westworld (2016)/Season 04/Westworld (2016) - S04E08 - Que Será, Será.mp4]
[CLEAN] Delete clutter files (/library/downloads/complete/Westworld.S04.1080p.BluRay.x265-RARBG)
[SCRIPT] Run Script (remove-duplicates.groovy)
[SCRIPT] TRASH /library/library/shows/Westworld (2016)/Season 04/Westworld (2016) - S04E01 - The Auguries.mkv (remove-duplicates.groovy)
[SCRIPT] TRASH /library/library/shows/Westworld (2016)/Season 04/Westworld (2016) - S04E02 - Well Enough Alone.mkv (remove-duplicates.groovy)
[SCRIPT] TRASH /library/library/shows/Westworld (2016)/Season 04/Westworld (2016) - S04E03 - Années Folles.mkv (remove-duplicates.groovy)
[SCRIPT] TRASH /library/library/shows/Westworld (2016)/Season 04/Westworld (2016) - S04E04 - Generation Loss.mkv (remove-duplicates.groovy)
[SCRIPT] TRASH /library/library/shows/Westworld (2016)/Season 04/Westworld (2016) - S04E05 - Zhuangzi.mkv (remove-duplicates.groovy)
[SCRIPT] TRASH /library/library/shows/Westworld (2016)/Season 04/Westworld (2016) - S04E06 - Fidelity.mkv (remove-duplicates.groovy)
[SCRIPT] TRASH /library/library/shows/Westworld (2016)/Season 04/Westworld (2016) - S04E07 - Metanoia.mkv (remove-duplicates.groovy)
[SCRIPT] TRASH /library/library/shows/Westworld (2016)/Season 04/Westworld (2016) - S04E08 - Que Será, Será.mkv (remove-duplicates.groovy)
Processed 8 files