* Testing for Check and Repair Media Links

For users to report plugin bugs and request plugin enhancements; and for authors to test new/new versions of plugins, and to discuss plugin development (in the Programming Technicalities sub-forum). If you want advice on choosing or using a plugin, please ask in General Usage or an appropriate sub-forum.
Post Reply
User avatar
Jane
Site Admin
Posts: 8441
Joined: 01 Nov 2002 15:00
Family Historian: V7
Location: Somerset, England
Contact:

Testing for Check and Repair Media Links

Post by Jane » 05 Oct 2012 09:24

I have created a new plugin to check and try and fix problems with media links in a Project File as follows
  • broken links with a search to find and copy the media to the media folder
  • finds media outside of the media folder and copies it to the media folder
  • media in the media folder, but listed with full paths are corrected to direct to the media folder
It first passes through the file looking for problems and then offers to fix them, if you say no it will simply list the problems for you.

When copying files in it prompts each file with in the media folder so you can choose a folder with it if you want.

It can be downloaded from:
https://www.dropbox.com/s/9jf8csn46vqzx ... nks.fh_lua


NOTE As this is new plugin and it makes changes to your Project data and media folder, please ensure you work on a copy and make a full backup before using it.

ID:6506
Jane
My Family History : My Photography "Knowledge is knowing that a tomato is a fruit. Wisdom is not putting it in a fruit salad."

User avatar
davidm_uk
Megastar
Posts: 740
Joined: 20 Mar 2004 12:33
Family Historian: V7
Location: St Albans, Hertfordshire, UK

Testing for Check and Repair Media Links

Post by davidm_uk » 06 Oct 2012 13:49

Just tied running the plugin and immediately got error message:

Image

Seems to be the same error as reported in the other topic 'Check for Unlinked Media'

David
David Miller - researching Miller, Hare, Walker, Bright (mostly Herts, Beds, Dorset and London)

User avatar
Jane
Site Admin
Posts: 8441
Joined: 01 Nov 2002 15:00
Family Historian: V7
Location: Somerset, England
Contact:

Testing for Check and Repair Media Links

Post by Jane » 06 Oct 2012 15:31

I think I found that one, can you try downloading it again.

Same place.
Jane
My Family History : My Photography "Knowledge is knowing that a tomato is a fruit. Wisdom is not putting it in a fruit salad."

User avatar
davidm_uk
Megastar
Posts: 740
Joined: 20 Mar 2004 12:33
Family Historian: V7
Location: St Albans, Hertfordshire, UK

Testing for Check and Repair Media Links

Post by davidm_uk » 06 Oct 2012 15:59

Thank you Jane, works fine now and found a few errors which I've now corrected.

[smile][smile]
David Miller - researching Miller, Hare, Walker, Bright (mostly Herts, Beds, Dorset and London)

User avatar
Jane
Site Admin
Posts: 8441
Joined: 01 Nov 2002 15:00
Family Historian: V7
Location: Somerset, England
Contact:

Testing for Check and Repair Media Links

Post by Jane » 07 Oct 2012 09:53

Thanks David, I'll probably pop it in the Plugin Store later in the week.
Jane
My Family History : My Photography "Knowledge is knowing that a tomato is a fruit. Wisdom is not putting it in a fruit salad."

User avatar
mezentia
Superstar
Posts: 277
Joined: 12 Jan 2007 21:14
Family Historian: V7
Location: Stourbridge

Testing for Check and Repair Media Links

Post by mezentia » 25 Jan 2013 20:41

Hi Jane

I've just downloaded the latest version of your plugin, and it stops with the following error:

An error has occurred - plugin failed to complete
Line 82: C:UsersDavidAppDataLocalTemp~fhA809.tmp:205: attempt to index local 'attr' (a nil value)
No changes have been made to data records.

in the function buildfilelist()

User avatar
Jane
Site Admin
Posts: 8441
Joined: 01 Nov 2002 15:00
Family Historian: V7
Location: Somerset, England
Contact:

Testing for Check and Repair Media Links

Post by Jane » 28 Jan 2013 08:09

Line 82 does not make sense to me as I look at the code, the only place attr is used is in the yield tree function which is line 289. Can you put a debug on line 295, and see if there is anything strange about the file it's on when it stops.

Thanks
Jane
My Family History : My Photography "Knowledge is knowing that a tomato is a fruit. Wisdom is not putting it in a fruit salad."

User avatar
tatewise
Megastar
Posts: 27080
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Testing for Check and Repair Media Links

Post by tatewise » 28 Jan 2013 10:46

'attr' is also used on lines 327 & 328
   local attr = lfs.attributes(strfromfile)
   lfs.touch(strtofile,attr['modification'],attr['access'])
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

User avatar
Jane
Site Admin
Posts: 8441
Joined: 01 Nov 2002 15:00
Family Historian: V7
Location: Somerset, England
Contact:

Testing for Check and Repair Media Links

Post by Jane » 28 Jan 2013 11:31

Mike, I think by the time it's got there it has already got the attr values once.
Jane
My Family History : My Photography "Knowledge is knowing that a tomato is a fruit. Wisdom is not putting it in a fruit salad."

User avatar
mezentia
Superstar
Posts: 277
Joined: 12 Jan 2007 21:14
Family Historian: V7
Location: Stourbridge

Testing for Check and Repair Media Links

Post by mezentia » 28 Jan 2013 19:29

Ooops [oops]

My apologies Jane, I posted in the wrong thread. The fault I got was with the Check for Unlinked Media, not the Check and Repair Media Links. Didn't spot the error until I tried to go to a non-existent line number! Check and repair media works ok :) just some 400+ links to fix now.

User avatar
tatewise
Megastar
Posts: 27080
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Testing for Check and Repair Media Links

Post by tatewise » 28 Jan 2013 21:30

Not sure if it is the cause of the problem but in the two Plugins the function dirtree(dir) contain two slightly different versions of local function yieldtree(dir).
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

User avatar
Jane
Site Admin
Posts: 8441
Joined: 01 Nov 2002 15:00
Family Historian: V7
Location: Somerset, England
Contact:

Testing for Check and Repair Media Links

Post by Jane » 29 Jan 2013 17:59

Sorry been to Wales today for work, but I will try and take a look tomorrow.
Jane
My Family History : My Photography "Knowledge is knowing that a tomato is a fruit. Wisdom is not putting it in a fruit salad."

User avatar
Jane
Site Admin
Posts: 8441
Joined: 01 Nov 2002 15:00
Family Historian: V7
Location: Somerset, England
Contact:

Testing for Check and Repair Media Links

Post by Jane » 30 Jan 2013 08:42

David please can you try

https://www.dropbox.com/s/3tngzbagv02f0 ... dia.fh_lua

I have changed it to use the same logic as the Repair version does.
Jane
My Family History : My Photography "Knowledge is knowing that a tomato is a fruit. Wisdom is not putting it in a fruit salad."

Post Reply