Page 1 of 1
Treat MKV and MP4 as same file and overwrite if new file is better than previous
Posted: 07 Oct 2023, 05:49
by Movieaholic
Hi
I use amc script to sort out my media but i spend alot of my time deleting duplicates of files that are there because the i have downloaded either a mkv or mp4 version of the file is there a way to treat those the same and only overwrite the current file if the new file is better quality?
Re: Treat MKV and MP4 as same file and overwrite if new file is better than previous
Posted: 07 Oct 2023, 05:58
by rednoah
e.g. find duplicates:
Shell: Select all
filebot -script fn:duplicates /path/to/files
e.g. find and delete duplicates:
Shell: Select all
filebot -script fn:duplicates /path/to/files --action delete
Find Duplicate Movie or Episode Files
EDIT:

If you are not yet aware of
Metadata and Extended Attributes please make sure to read up on that as well.
Re: Treat MKV and MP4 as same file and overwrite if new file is better than previous
Posted: 07 Oct 2023, 07:17
by Movieaholic
Thats exactly what i was looking for thanks

Re: Treat MKV and MP4 as same file and overwrite if new file is better than previous
Posted: 07 Oct 2023, 09:35
by Movieaholic
I gave this a try and it worked mostly, on the odd occasion the 1080p version file will be bigger than the 4k version is there a way to skip that file if this is the case so i can manually look at it and decide for myself?
Re: Treat MKV and MP4 as same file and overwrite if new file is better than previous
Posted: 07 Oct 2023, 10:08
by rednoah

The default quality metric will prioritize video resolution over file size
(i.e. 4K always beats 2K) so what you're asking for is default behaviour?

Unless you're saying you want to keep the bigger 2K file over the smaller 4K file? You could provide your own
"quality function" that decides which is better, but you won't get any kind of
"let me decide" on the command-line, unless you do
"find duplicates" and then write your own code to work with the results.
Re: Treat MKV and MP4 as same file and overwrite if new file is better than previous
Posted: 07 Oct 2023, 11:14
by Movieaholic

Unless you're saying you want to keep the bigger 2K file over the smaller 4K file?
Yeah It doesn't happen very often but it does happen, was just interested to know if there was a way to skip this duplicate match for manual inspection later?
Re: Treat MKV and MP4 as same file and overwrite if new file is better than previous
Posted: 07 Oct 2023, 11:18
by rednoah
Movieaholic wrote: ↑07 Oct 2023, 11:14
Yeah It doesn't happen very often but it does happen, was just interested to know if there was a way to skip this duplicate match for manual inspection later?
Unfortunately, this corner case is not supported. There is always one best file and the script does not implement special behaviours for multiple best files or no best files.
Re: Treat MKV and MP4 as same file and overwrite if new file is better than previous
Posted: 07 Oct 2023, 11:23
by Movieaholic
OK thank you
Re: Treat MKV and MP4 as same file and overwrite if new file is better than previous
Posted: 07 Oct 2023, 11:36
by rednoah
FileBot r10089 (latest revision; not latest stable release; at time of writing) improves support for this kind of use case via custom post-processing scripts. See
Custom Post-Processing Scripts › Delete duplicates for example.
Re: Treat MKV and MP4 as same file and overwrite if new file is better than previous
Posted: 09 Oct 2023, 05:39
by Movieaholic
After playing with this a bit it seems im not sure quite how it works/ doing something wrong it worked exactly as expected for movies but for tv shows not so much
https://tinypic.host/image/filebot.SjVNE
https://tinypic.host/image/plex.SjGfQ

Re: Treat MKV and MP4 as same file and overwrite if new file is better than previous
Posted: 09 Oct 2023, 06:00
by rednoah

Do files have
xattr metadata?
Re: Treat MKV and MP4 as same file and overwrite if new file is better than previous
Posted: 09 Oct 2023, 07:40
by Movieaholic
I see why its not working the mkv files were originally name with TheMovieDB and the mp4 with TheTVDB so it views it as 2 different shows. Thanks
Re: Treat MKV and MP4 as same file and overwrite if new file is better than previous
Posted: 09 Oct 2023, 07:51
by rednoah
Ah, yes. If database / ID is different, then the "logical duplicates" detection wouldn't work.