* Check for Unlinked Media problems

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
tatewise
Megastar
Posts: 27078
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Check for Unlinked Media problems

Post by tatewise » 19 Jan 2015 23:52

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.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

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

Re: Check for Unlinked Media problems

Post by tatewise » 21 Jan 2015 11:03

In case it helps the attached is an update of Plugin to V1.8 January 2015
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

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

Re: Check for Unlinked Media problems

Post by Jane » 21 Jan 2015 16:58

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.
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: 27078
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Check for Unlinked Media problems

Post by tatewise » 21 Jan 2015 17:18

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.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

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

Re: Check for Unlinked Media problems

Post by Jane » 22 Jan 2015 12:19

I have uploaded this one to the Plugin Store, plus the Ancestor and Descendants by Generation plugin I did the other day.
Jane
My Family History : My Photography "Knowledge is knowing that a tomato is a fruit. Wisdom is not putting it in a fruit salad."

avatar
fugu68
Gold
Posts: 28
Joined: 26 Oct 2018 02:21
Family Historian: V6.2
Location: United Kingdom

Re: Check for Unlinked Media problems

Post by fugu68 » 22 Feb 2019 06:30

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?
Andrew Slater: researching Slater and Lewis.

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

Re: Check for Unlinked Media problems

Post by Jane » 22 Feb 2019 08:53

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.
Jane
My Family History : My Photography "Knowledge is knowing that a tomato is a fruit. Wisdom is not putting it in a fruit salad."

avatar
fugu68
Gold
Posts: 28
Joined: 26 Oct 2018 02:21
Family Historian: V6.2
Location: United Kingdom

Re: Check for Unlinked Media problems

Post by fugu68 » 22 Feb 2019 09:17

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?
Andrew Slater: researching Slater and Lewis.

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

Re: Check for Unlinked Media problems

Post by tatewise » 22 Feb 2019 12:13

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.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

avatar
fugu68
Gold
Posts: 28
Joined: 26 Oct 2018 02:21
Family Historian: V6.2
Location: United Kingdom

Re: Check for Unlinked Media problems

Post by fugu68 » 22 Feb 2019 19:35

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
Andrew Slater: researching Slater and Lewis.

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

Re: Check for Unlinked Media problems

Post by tatewise » 22 Feb 2019 20:12

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?
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

avatar
fugu68
Gold
Posts: 28
Joined: 26 Oct 2018 02:21
Family Historian: V6.2
Location: United Kingdom

Re: Check for Unlinked Media problems

Post by fugu68 » 23 Feb 2019 00:34

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.
Andrew Slater: researching Slater and Lewis.

Post Reply