Page 1 of 1
Check for Unlinked Media problems
Posted: 19 Jan 2015 23:52
by tatewise
The recent posting
Unlinked media (12206), prompted an inspection of this Plugin.
Unless I am mistaken, it appears to have a number of coding errors.
1. Absolute Media Paths
Both
buildmedialist() and
addlocalmedialist(medialist) try to cater for
File Links with full absolute paths instead of relative paths.
On lines 97 & 114
local mediafolder = rootfolder..'\\Media\\' is used later in
strlc = strlc:gsub(mediafolder,'').
But that removes the
Media\\ part of the path that should be retained to match the
strlc created in
buildfilelist().
I have tested this by creating a full absolute path in a
Multimedia File Link, which gets falsely listed as
Unlinked Media.
Then after changing both lines 97 & 114 to
local mediafolder = rootfolder..'\\' it is handled correctly and not listed.
2. Copy Files Pattern
In
copyFiles(filelist,dir) the
local mediafolder = rootfolder..'\\media\\' is later used in
v:gsub(mediafolder,'').
But this may fail if 'magic pattern symbols' are in the
mediafolder path and needs to use
strPlainText(mediafolder).
3. Redundant Parameter
In the
mainfunction() the call on line 63 to
deleteFiles(filelist,dir) has a redundant 2nd parameter
dir.
Re: Check for Unlinked Media problems
Posted: 21 Jan 2015 11:03
by tatewise
In case it helps the attached is an update of Plugin to V1.8 January 2015
Re: Check for Unlinked Media problems
Posted: 21 Jan 2015 16:58
by Jane
Thanks Mike, sorry I have this on my To-Do list, but family problems mean I have not had much time over the last week or so.
Re: Check for Unlinked Media problems
Posted: 21 Jan 2015 17:18
by tatewise
Sorry to hear that. I had noticed you were not as active as usual.
I hope those problems are resolved before too long. Best wishes.
Re: Check for Unlinked Media problems
Posted: 22 Jan 2015 12:19
by Jane
I have uploaded this one to the Plugin Store, plus the Ancestor and Descendants by Generation plugin I did the other day.
Re: Check for Unlinked Media problems
Posted: 22 Feb 2019 06:30
by fugu68
I am gradually tidying up a migration from v3 to v6, and know that I have quite a few unlinked media items in my media folder, and thought this plug-in would help (as did the very helpful 'Find Duplicate Media plugin).
However, when I run it, and click 'List Unlinked Media', it immediately returns 'No Unlinked Files found', which I know is not the case.
Any suggestions as to what I might try?
Re: Check for Unlinked Media problems
Posted: 22 Feb 2019 08:53
by Jane
Can you just confirm what you mean by unlinked? In this plugin it reports media in the media folder not media links which are broken.
To repair broken links try the Auto Repair option in Tools>External File links.
Re: Check for Unlinked Media problems
Posted: 22 Feb 2019 09:17
by fugu68
Thanks for the reply, Jane.
I have a number of media files in the Media folder (and sub-folders thereof) that are not linked to any media record in my project. I assume this is what the plugin should detect? Is that correct?
Re: Check for Unlinked Media problems
Posted: 22 Feb 2019 12:13
by tatewise
Andrew, Media files can also be linked to what are known as Local Media Objects instead of Media records.
Try using Edit > Find and Search for a filename you think is unlinked, with only Other Fields ticked.
The results will refer to the innards of a Record Type other than a Media record.
The Type column (if you make it wider) will say Local Multimedia Object File.
Having discovered such Local Media Objects we can decided how to rectify them.
( I have a Plugin that will convert them to Media Records )
One question is how did they get there as it is quite difficult to create them in FH.
Are you perhaps looking at a Project that was imported from some other product?
Or maybe FH V3 was more adept at creating Local Media Objects.
Re: Check for Unlinked Media problems
Posted: 22 Feb 2019 19:35
by fugu68
Hi Mike,
I tried searching for one of the unlinked files with Edit > Find and it doesn't show up at all. I guess that means they really are unlinked, but not sure why the plugin is not showing them.
Andrew
Re: Check for Unlinked Media problems
Posted: 22 Feb 2019 20:12
by tatewise
I can assure you that all the files must be linked if the Plugin says they are.
Can you please post exactly what filename you searched for.
Do NOT include the folder path ~ just search for the filename part ~ or even a unique fragment of the filename.
Do NOT tick Match case nor Match whole word.
Are you sure the files in question are within the Media folder of the Project in question, and not the Media folder of some other Project?
Re: Check for Unlinked Media problems
Posted: 23 Feb 2019 00:34
by fugu68
Solved it - user error, as you suspected. (I had 2 similarly named projects, and had the other one open in error.)
Plugin does exactly what it says on the tin, and will be very helpful.