Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Help]: Custom Rules #545

Open
0lsn opened this issue Nov 10, 2024 · 1 comment
Open

[Help]: Custom Rules #545

0lsn opened this issue Nov 10, 2024 · 1 comment
Labels
question Further information is requested

Comments

@0lsn
Copy link

0lsn commented Nov 10, 2024

Hello i wanted to ask if there is somewhere a collection for custom rules that can i read up on. I want to define my own in the custom section. Howeveri am really not sure what the correct syntax is and what are the current capabilties and limitations are.

Help would be greatly appreicated. thanks :)

@0lsn 0lsn added the question Further information is requested label Nov 10, 2024
@av0c4do
Copy link

av0c4do commented Dec 25, 2024

I've looked all over for this and never found much, so here's what I've cobbled together on my own:

You can mix and match the sample expressions in Expression Builder using "&&" (AND) and "!" (NOT) to create just about any custom search imaginable. Some examples:

Example 1: I have two copies of the same series, but they were encoded in different resolutions/quality. I want to select everything that isn't the best quality for deletion.

`arg.ItemInfo.IsBestSize && !arg.ItemInfo.IsBestBitRateKbs && !arg.ItemInfo.IsBestFrameSize`

will select everything that is not the largest file, does not have the highest bitrate, and is not the largest resolution.

Example 2: I have a drive filled with folders that have duplicates within each folder, but not across multiple folders. I don't want to scan each folder individually, I'd rather scan the whole drive and then focus on the largest folders for dedup.

`arg.ItemInfo.Path.Contains("folder_name") && arg.ItemInfo.IsBestSize && !arg.ItemInfo.IsBestBitRateKbs`

will select only items in folder_name (useful for not accidentally selecting results in a folder I wasn't focused on) that are not the largest file and do not have the highest bitrate.

A couple other things to note:

  • IsBestSize() will only return one item: the file with the lowest size (which is best per VDF rules). If you have more than two copies of a video to dedup, using just IsBestBitRateKbs() should select everything that isn't the largest, assuming that the resolution and FPS are the same.

  • It can be confusing to remember what VDF considers "best". All of the IsBest() functions will return items where the data property is green in the results. !IsBest() will return items where the data property is red.

  • Writing a long query directly in Expression Builder can be annoying as the text box doesn't extend or wrap text for long queries. I usually write what I need in notepad and then copy/paste the query into Expression Builder.

  • Path.Contains() is case sensitive. "folder_name" will not return the same results as "Folder_Name" or "folder name"

  • HEVC can deliver the same quality as H264 at much lower sizes and bitrates, which will cause problems with the examples above. If you have dupes that encoded with different codecs, make sure to add Format() to your query:

    arg.ItemInfo.Format("hevc") or arg.ItemInfo.Format("h264")

Every search workflow will be dependent on your data set and your priorities, so it's impossible to list every potentially useful combination. But hopefully this gives you an idea on how to get started :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants