change a package


I'd like to tinker with the dedup package to see if I can change the format of the proposed name to include to the programme name, which will make the media list more meaningful when using Flatten.

I have downloaded the dedup package and can see the control file and dedup.old file with the code. The dedup file seems to be pointing to ../var/mongoose/html/dedup/dedup which doesn't exist. Anyway I can see the code in /mod/bin/dedup but obviously won't change that version.

The code in dedup seems to be some scripting language? Do I need to compile the file or by the looks of it does it just run?

Next step after that would be to set it up as a cron job.

Thanks very much.
You really need an answer from af123, However until he turns up I can say that the path you say doesn't exist also needs to start with /mod e.g. /mod/var/mongoose/html/dedup. The scripting language is Jim a form of TCL
The dedup package started as a self-contained thing (it was one of the first packages available!) but now it's just a wrapper around the dedup code that's built into the webif package. That's why the only thing in there now is a pointer to the web interface code. The previous version of the script is there as dedup.old as you've noticed but it isn't anywhere near as robust as the new version.

Dedup is written in a scripting language called Jim which is a variant of TCL. It's an interpreted language so it just runs without compilation.

If you're looking to change the names it comes up with then that code is in /mod/webif/html/dedup/normalise.jim

The next version of the web interface will be able to automatically dedup selected folders in the background - still not a lot of use for users of flatten.

I do have plans to enhance dedup to make it more flexible but won't get around to it for a few weeks at least due to other commitments.
Thanks af123, will look at the normalise.jim file. May come back if I don't understand the format of the Series info.
Ok, i've created something which seems to work. One thing which isn't fully functional is determining when there is a duplicate.
I'm creating a filename/prog name of "title: synopsis", so for normal programmes there would only be true duplicates the episode info is usually unique, but it doesn't quite work when the programme info is fairly fixed, such as the News say. A duplicate found then will almost certainly just be a new program.
[$ts get synopsis] - to get the episode info
[$ts get title] - to get the programme name
Are the other data items of the .hmt file documented anywhere, such as the crid?
Look at /mod/webif/lib/ts.class. The variables and methods are in there.
Unfortunately the CRID isn't stored in the HMT file.
Ok, I have created a dedupforflatten script I can share if anyone, using flatten, is interested.

It renames the file and programme title to "title: episode name", so giving the user more info of the programme in the media list.
As I only want to rename a file once (to avoid multiple concatenation of the title) I first check if a file is in it's original state otherwise I set the status to 'nothing' and assume it's already been renamed (by the script or manually).
I have assumed that the original filename state has the date and time in numerics, so I strip off alphas and special characters and check the length of what is left, if it's under 12 then I set the status to nothing.
I know this is a bit crude but it seems to work ok. Is there a more sophisticated way of checking whether a file is in it's original state?
I've set the script up in a startup script outputting to a log file (viewable on the web-if diagnostics page) to see what is going on.