[mythtv-users] MythGallery: selecting a favorite picture as directory thumb

Roger Siddons dizygotheca at ntlworld.com
Sun Oct 12 11:18:07 UTC 2014


On Sun, 12 Oct 2014 10:29:43 +0100, Angela <angela.schmid at wolke7.net>  
wrote:

>
> I didn't noticed the above code was not used. I have to use some debug
> statements to see the actual flow.
> Your patch would do something similar as the code above.
>
> When I want to implement a key and select it from MythTV, what I don't 
> like
> from the above code:
>
> Reason 1: is that pictures get renamed or a second file with something 
> like
> *highlight* is added. It overcomplicates programming, when a highlighted
> picture already exists.
>
> Reason 2: I keep my pictures synced (Beyond Compare) between a PC(editing
> and source for off-loaded backup) and MythTV Server (second backup), I 
> don't
> want changes of filenames or additions.
>
> Reason 3: When changing Themes it might be needed to drop the 
> .thumbcache's,
> as they might have a different size (another algorithm of mine, was to 
> copy
> the thumb of a favorite picture to the parent directory thumb)
>
> Reason 4: It also does not solve when I have the following structure 
> where I
> want to use a picture say from the second subdirectory for aparent-parent
> directory.
>
> 2003/200301 Egypt/20030101 Cairo
> 2003/200301 Egypt/20030101 Cairo/pic0001.tiff
> 2003/200301 Egypt/20030102 Abu Simbel
> 2003/200301 Egypt/20030102 Abu Simbel/want-this-pic.tiff
>
> I am thinking of another algorithm, which also works for highlighting
> directories (when they don't have pictures at that level):
>
> Within "2003/200301 Egypt/20030102 Abu Simbel/" at "want-this-pic.tiff" I
> press a key and a file ".directory.thumb.txt" with "want-this-pic.tiff"is
> written.
> As I go back to Within "2003/200301 Egypt/" the directory is reread and 
> code
> like above looks first for a file ".directory.thumb.txt" and uses the
> content as the filename, which is also checked if it exists, and thethumb
> is used/created, otherwise the original code with recursion is used to 
> find
> a picture.
> Within "2003/200301 Egypt/", I can press a key for directory "2003/200301
> Egypt/20030102 Abu Simbel" and ".directory.thumb.txt" is written with
> "20030102 Abu Simbel". The same applies when going back.
> At "2003/200301 Egypt/" the "want-this-pic.tiff" is used.
>
> I only need to take care I have a backup of all ".directory.thumb.txt".
>
> The code above sure has some parts which can be reused. Also my algorithm
> can sit nicely next to the *highlight* code.
>
> At the end of the month I have time to program my algorithm and would be
> pleased to hear other thoughts/algorithms.
>

Firstly, be aware that this plugin is deprecated  
https://code.mythtv.org/trac/changeset/9dadc429404358b0d247f259d99d017a4c6fdaeb/mythtv

A new core image manager has appeared in 0.28  
https://code.mythtv.org/trac/changeset/c1ba0b843608728b75df57fd0973466e86d9995d/mythtv

There's little info about it & I haven't worked out what it does yet, but  
you may wish to limit your effort on this.

That said;

1. Gallery already creates thumbcaches in the picture directories  
(depending on settings) so your ".directory.thumb.txt" should probably  
mirror that behaviour.

2. Storing the file within the thumbcache would be convenient. Does  
gallery ever delete the thumbcache itself ? If so, could you modify that  
so it cleared the thumbs instead, leaving the directory.thumb in place ?

2. Storing filenames seems wrong to me (unless you want them to be  
multi-platform compatible). Wouldn't it be better to create them as  
symbolic links ? There's no need for photo renaming/duplication.

3. Whichever, there will always be a problem with breakage due to file  
renaming/directory rearrangement unless you go for a hash key approach  
such as MythVideo.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.mythtv.org/pipermail/mythtv-users/attachments/20141012/9b7fd032/attachment.html>


More information about the mythtv-users mailing list