MediaConch icon indicating copy to clipboard operation
MediaConch copied to clipboard

Check only files matching regex in target dir?

Open kgrons opened this issue 8 years ago • 11 comments

Is there a way to create a rule in a policy to only check files based on, e.g., filename parameters?

When I receive files from a digitization vendor, all files are in 1 directory. I only want to run a specific policy against files ending in "_pm" or beginning with "555". Is there a way in the GUI or with the CLI to do this?

NB: I used path/to/dir/*_pm.mov in the command but MediaConch ignored the regex after the final / and ran the policy against all the files.

kgrons avatar Feb 07 '17 19:02 kgrons

There's no regex handling with mediaconch but would could do some scripting around it such as:

find . \( -name "555*" -o -name "*pm" \) | while read file ; do mediaconch -p whatever.xml "$file" ; done

dericed avatar Feb 07 '17 19:02 dericed

files ending in "_pm" or beginning with "555"

I expect that it works, this is pretty classic (relatively standard methods, actually sometimes the OS expands it directly), I'll check the reason it is not there. But complex regex is not expected to be supported (no regex engine in MediaConch), for more complex regex I would rely on external regex scripts;

JeromeMartinez avatar Feb 07 '17 21:02 JeromeMartinez

I was unable to recreate the original issue. The *_pm in the command matches files in a target directory as expected on the CLI. Thanks to @dericed for script help in the interim.

Is it possible, or desired from your perspectives, to add this 'filter' behavior to the GUI?

kgrons avatar Feb 10 '17 15:02 kgrons

@kgrons I have a similar situation, only our *_pm's are bagged. We're working on a script as well but I second the interest in GUI support!

genfhk avatar Mar 02 '17 14:03 genfhk

+1

On Thu, Mar 2, 2017 at 6:25 AM genfhk [email protected] wrote:

@kgrons https://github.com/kgrons I have a similar situation, only our *_pm's are bagged. We're working on a script as well but I second the interest in GUI support!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/MediaArea/MediaConch/issues/176#issuecomment-283666657, or mute the thread https://github.com/notifications/unsubscribe-auth/AI_8UW1p7cp1ZWgTNV8unKhun9fpeKErks5rhtFZgaJpZM4L58rt .

-- Kelly Haydon Preservation Manager Bay Area Video Coalition 415-558-2158 | [email protected] twitter/instagram: @bavcpreserve

Apply to the Preservation Access Program https://www.bavc.org/preserve-media/preservation-access-program today! Receive up to 70% off of our services thanks a ​generous

subsidy provided ​ ​ by the National Endowment for the Arts. Deadline is March 15th, 2017

Black Lives Matter! I stand with BLM!

metacynicv2 avatar Mar 02 '17 17:03 metacynicv2

This sounds like a feature worthy of sponsorship after the PREFORMA-funded phase of the project is complete.

Overall, though, this kind of nuanced file parsing seems best handled by wrapping mediaconch in a simple looping script, as Dave mentioned and wrote up above.

ablwr avatar Mar 02 '17 17:03 ablwr

@ablwr Yes! That'd be great to have it as an improvement on the roadmap. And do you mean wrap the GUI in a script? Sorry, am a little confused by the second part of your comment.

It works as expected in the CLI (that was my mistake in the original issue): "The *_pm in the command matches files in a target directory as expected on the CLI."

kgrons avatar Mar 02 '17 19:03 kgrons

No, I mean using the CLI version of mediaconch and wrapping it in a script is the best way to go for integration into workflows.

ablwr avatar Mar 02 '17 19:03 ablwr

So if I summarize correctly, you would like a regex filter in the GUI, right?

That'd be great to have it as an improvement on the roadmap

This is not part of the PREFORMA funding, so putting it in the roapmap will depend of a choice of the sponsors involved after PREFORMA (you? ;-) )

JeromeMartinez avatar Mar 02 '17 20:03 JeromeMartinez

Handling thousands of files is always going to be much better to do using the CLI though for performance reasons. @kgrons and @genfhk if you wrote a script, maybe you can share it??

ablwr avatar Mar 02 '17 20:03 ablwr

Handling thousands of files is always going to be much better to do using the CLI though for performance reasons.

I kindly disagree, there are some possibilities with GUI too. but this is more complex and not out of the box, UI is a complex thing to be adapted by project. So for now, right, MediaConch CLI is better for that (with batch you can select the files you want), but this could be also implemented in the GUI if there is a need (but with the limits of a GUI, never more hackable as a CLI, just need of less knowledge).

JeromeMartinez avatar Mar 02 '17 20:03 JeromeMartinez