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

Angela angela.schmid at wolke7.net
Fri Nov 7 01:01:30 UTC 2014


> >> On 05/11/14 14:18, Roger Siddons wrote:
> > For every 100 pictures it takes 3 seconds. So for the 28x4, it also
> > takes around 3 seconds.
> 
> > How about a remote FE, is a NFS-alike connection needed or is it
> > possible to receive pictures via a service API?
> 
> Remote FE's will use the same internal protocol as local FE's. The service
API
> will serve pics to clients. No NFS needed. That's the point of the
changes.
> 
> > IMHO, when a NFS-alike connection still is needed, accessing a
> > directory is much faster than SQL (sure the "old" gallery calls SQL to
> > get rotating information), but synchronizing doesn't have to be done.
> > It is different for MythVideo, as Directory Browse Mode is slower to
> > retrieve a complete gallery, meaning it has to scan the whole tree at
> > once. In the gallery we only have a tree view, or are any other views
> > (e.g. based on labels, which would be kept in the DB) desirable?
> 
> Sounds a good idea. We'd have to preserve the tags between scans, ie. do a
> proper synchronise rather than dump & rebuild.

What I meant was, when NFS is needed, instead of using SQL we could read the
directory tree instead.
What I understand now, is that a remote FE uses the service API to get the
pictures, so the implementation from the "old" gallery cannot be used
anymore.

To precise my DB statement: when reading the directory tree was on option, a
DB isn't needed if only a tree view is offered. Any other view, would need
the DB explicitly having specific attributes.
I don't need another view or filtering, etc.

> I was planning some schema changes so mail me off-list with what you need
> in the db.

For each top directory in the SG I got an errormessage:
DB Error (MSqlQuery):
Query was:
INSERT INTO gallery_directories (filename, name, path, parent_id, dir_count,
file_count, hidden ) VALUES (?, ?, ?, ?, ?, ?, ?);
Bindings were:
:DIRCOUNT=33, :FILECOUNT=0, :FILENAME="2008", :HIDDEN=0, :NAME="2008",
:PARENT_ID=0, :PATH=NULL
Driver error was [2/1048]:
QMYSQL3: Unable to execute statement
Database error was:
Column 'path' cannot be null


> On Wed, 05 Nov 2014 15:49:54 -0000, Paul Harrison <mythtv at sky.com> wrote:
>> The problem seems to be the call to GalleryViewHelper::LoadTreeData() 
>> which causes a swarm of SQL queries and Service API calls. Some 
>> directories are taking 30 seconds to load here.

I am not a fan from x4 thumbnails, on my 27" PC I use them but on the TV
where you sit further away, they are rather small.
However, the process could be optimized. Instead of calling 4x the API. The
gallery needs the information from the theme, if it should generate x4
thumbnails and give this information to the Service API. The BE generates
for the directory a x4 thumbnail, which gets saved in the cache, with _x4
appended. Honors theme changes. To emphasize, the BE gets an ID pointing to
a directory and generates the thumb, instead of the FE collecting data for
pictures from subdirectories. GenThumbForDirectory()

The many SQL queries might get called, because at any time data needs to be
known from the subdirectories.
A datamodel, with a tree-like view in gallery_directories (parent_id) or one
table with directories and files having a parent_id and a type (dir/file)
could speed up loading. 

<personal>
I was informed yesterday that I have to complete a certification until
12.12, for which I need up to 5 hours daily (also weekends). I am really
sorry, I cannot spend much time atm anymore.
I will be reading your conversation and when you have some patches I can
quickly check them.

Angela




More information about the mythtv-users mailing list