Page 1 of 2
Check for Unlinked Media
Posted: 02 Oct 2012 11:52
by gerrynuk
Jane,
I have just downloaded this plugin (V1.0) and when I run it I get the following error message:
ID:6505
Check for Unlinked Media
Posted: 02 Oct 2012 12:52
by Jane
Strange, that's just returning from the file list of the item is a file or a directory. Do you have any symbolic links in your media folder?
Any chance you can add a print at line 55 so you get and try running the plugin from the editor
Code: Select all
print(filename)
if attr.mode == 'file' then
and see if there is any thing different about the file it stops on.
Check for Unlinked Media
Posted: 02 Oct 2012 23:06
by johnmorrisoniom
I have just tried the plug-in with no problems.
How would I 'tweek ' it so that I can Move suspect files to another folder, rather than delete them.
Check for Unlinked Media
Posted: 03 Oct 2012 12:08
by Jane
Please try this one I have added the Move Files, and trapped for the attribute problem
https://www.dropbox.com/s/3tngzbagv02f0 ... dia.fh_lua
Check for Unlinked Media
Posted: 03 Oct 2012 12:59
by johnmorrisoniom
Hi Jane,
New one works fine at listing the files, but I get an error when I try moving them.
But the file is at the top of the list in the result set.
Check for Unlinked Media
Posted: 03 Oct 2012 16:24
by Jane
Ah I see what the problem is I have left the folder structure in and it does not exist in the folder you are moving to.
Can you try downloading it again, the link should be the same. V1.2
Check for Unlinked Media
Posted: 03 Oct 2012 17:15
by johnmorrisoniom
Thanks Jane,
V 1.2 worked very well, and renaming the files by adding the original path to the name is a good idea.
Check for Unlinked Media
Posted: 03 Oct 2012 18:01
by Jane
Thanks John,
I have released it to the plugin store, along side one to check for duplicate media records, where either they are linked to the same file or a file with identical content.
So perhaps you might like to give me some feedback on that one if you have a moment.
http://www.family-historian.co.uk/plugi ... try?id=273
Check for Unlinked Media
Posted: 03 Oct 2012 19:30
by johnmorrisoniom
On first run I got a message saying md5 required
On clicking OK I got another error.
and the run was aborted.
Check for Unlinked Media
Posted: 03 Oct 2012 21:16
by Jane
Ok, that's tied in with loading the md5 package. I'll have a look in the morning.
if you add require 'luacom' near the end on the line after require 'lfs'
and run it you will get an error, but if you then run it again it should work.
Check for Unlinked Media
Posted: 03 Oct 2012 21:24
by roy
Jane
I have justdownloaded this plug in and it does not work for me as intended.
I do not get the option window but go straight to
'Do you want to delete 232 unlinked files? etc.'
It wants to delete ALL of my multimedia files (they are all in fact linked).
Window 7. Media in subfolders in Media folder.
I exported Gedcom file to a new project together with linked media. (media now in MEDIA folder not subfolders - same number/media files as in original) and ran plug in again. Still on option window, but said all files linked.
Roy
Check for Unlinked Media
Posted: 03 Oct 2012 22:08
by johnmorrisoniom
The extra line makes the plugin work, with the md5 message only appearing on first run.
It did crash when a broken link was found. But the file was in the unlinked media folder, so moved it back, and repaired the link. Ran the plugin again and found thirty sets of duplicates, half of which had different file names.
Very useful plugin.
Check for Unlinked Media
Posted: 04 Oct 2012 09:51
by Jane
Roy, Did your original project show the files in the media folder on the Work With External File Links or show the whole path.
If you could run the list option and save the result set for me I might be able to work out why it did not work along with a copy of the paths in the media records.
Check for Unlinked Media
Posted: 04 Oct 2012 12:53
by Jane
Hi Roy,
I have done some experiments and am pretty sure the problem is you have media in the media folder linked using long path names.
Please try remapping all the media to the media folder using the Work With External File Links tool.
In the meantime I have modified the plugin to handle incorrectly mapped data, which I will upload to the plugin store later.
Check for Unlinked Media
Posted: 04 Oct 2012 19:07
by roy
Hello Jane.
I think I have followed what you say, but I am unsure why this would mean I did not get the options or option window displayed.
As all the media is in the media folder, I am unsure how I could remap this.
Here are a few snips showing my folder structure etc.

This is the list of files that would have been deleted:


Hope this gives some clues
Thanks
Roy
Check for Unlinked Media
Posted: 04 Oct 2012 19:35
by johnmorrisoniom
from what you are saying, you are still on vers 1.0 of the plugin, there is a updated version available which starts with an option screen to:
A: List
B: delete
C: Move
your files
Check for Unlinked Media
Posted: 04 Oct 2012 20:02
by Jane
As John says, try using the latest version. Also if you scroll down on the External links tool, do you have any files which show as the G: rather than in the Project folder?
Check for Unlinked Media
Posted: 05 Oct 2012 17:48
by roy
Jane
I think I have now identified the problem.
If I renamed the project it all worked ok.
I have now identified that the problem only occurs if there is a'-' in the project name.
My problem project has a hypnen. If I remove it, all is fine. That was the only change.
Easy once its found.
Roy
Check for Unlinked Media
Posted: 05 Oct 2012 18:55
by Jane
Thanks Roy, I'll add a fix when I get a minute.
Check for Unlinked Media
Posted: 05 Oct 2012 19:15
by Jane
Please can you try 1.4, which is on the dropbox link and see if that works better with the hyphened file.
Check for Unlinked Media
Posted: 05 Oct 2012 19:30
by tatewise
Jane, the following 'magic' pattern characters can all also appear in file names, and perhaps should be catered for just like hyphen (-):
Check for Unlinked Media
Posted: 05 Oct 2012 20:04
by Jane
Thanks Mike, I used the strPlainText function from the Search and Replace plugin.
Check for Unlinked Media
Posted: 06 Oct 2012 09:21
by tatewise
Jane, your new Plugin Code Snippet
Convert String To Pattern For Plain Text Searching should be merged with my original
Plain Text Substitution Code Snippet.
Check for Unlinked Media
Posted: 06 Oct 2012 15:33
by Jane
Opps missed your one. I have deleted mine.
Check for Unlinked Media
Posted: 15 Oct 2012 12:27
by gerrynuk
Jane said:
Strange, that's just returning from the file list of the item is a file or a directory. Do you have any symbolic links in your media folder?
Any chance you can add a print at line 55 so you get and try running the plugin from the editor
print(filename)
if attr.mode == 'file' then
and see if there is any thing different about the file it stops on.
Jane,
Sorry but I have only just found time to re-test the plugin. I downloaded the latest version (1.5) but still get an error message when I click on List Unlinked media:
As you have updated the plugin since my first post is it still possible to run the test you describe?