LG MS450H MS400H
¿Quieres reaccionar a este mensaje? Regístrate en el foro con unos pocos clics o inicia sesión para continuar.

bookmark.db

5 participantes

Página 7 de 8. Precedente  1, 2, 3, 4, 5, 6, 7, 8  Siguiente

Ir abajo

bookmark.db - Página 7 Empty Re: bookmark.db

Mensaje  vic1972 Jue Feb 10, 2011 8:58 pm

Hello George,
I have changed the link functions, and the touch functions,
as you know these commands handle with files.
My testing are fine, but please, have a testing with your special filenames in czec, just in case.
You can download using the service numeric number.

Also, i have put in .ini at the end two parameters to configure, I think as it is right now it is working fine.

regards
vic1972
vic1972

Mensajes : 2260
Fecha de inscripción : 09/12/2009
Edad : 52
Localización : Malaga

Volver arriba Ir abajo

bookmark.db - Página 7 Empty Re: bookmark.db

Mensaje  Keltek Vie Feb 11, 2011 1:26 am

Victor, I realize you start sqlite3 issuing command "/tmp/hdd/root/custom/bin/sqlite3". You should first check this binary is available.
I think you first check this command exist and then perform the greps and then perform the sqlite3. And how did you assure the /tmp/hdd/root is mounted in the moment you issue the command? There can be some delays in some circumstances on different configuration to be this binary available.
Keltek
Keltek

Mensajes : 291
Fecha de inscripción : 10/03/2010
Edad : 47
Localización : Praha - Czech Republic

http://www.fozona.cz/

Volver arriba Ir abajo

bookmark.db - Página 7 Empty Re: bookmark.db

Mensaje  vic1972 Vie Feb 11, 2011 5:24 pm

Hi, thanks for the tip.
Yes, that is considered.
That execution is done after 30seconds, as i have a thread with this sleep,
then i do this kind of operations that needs all filesystem to be ready.
vic1972
vic1972

Mensajes : 2260
Fecha de inscripción : 09/12/2009
Edad : 52
Localización : Malaga

Volver arriba Ir abajo

bookmark.db - Página 7 Empty Re: bookmark.db

Mensaje  George2005 Sáb Feb 12, 2011 1:02 am

vic1972 escribió:Hello George,
I have changed the link functions, and the touch functions,
as you know these commands handle with files.
My testing are fine, but please, have a testing with your special filenames in czec, just in case.
You can download using the service numeric number.

Also, i have put in .ini at the end two parameters to configure, I think as it is right now it is working fine.

regards
Hi Victor, thanks a lot! I tested it and it works correctly even with the czech filenames cheers
Btw: Several times I have encountered the problem with the incorrect Power Off (ie "Off" message remained on display so I had to reset the machine) but I think that it is the common problem which is just solving by Keltek & evr ...


George2005

Mensajes : 112
Fecha de inscripción : 26/10/2010
Edad : 49
Localización : Olomouc - Czech Republic

Volver arriba Ir abajo

bookmark.db - Página 7 Empty Re: bookmark.db

Mensaje  vic1972 Jue Feb 17, 2011 6:18 pm

Hello George,
I think we might need some checking in the triggers.

Let me explain, yesterday, I was not able to restart any execution in the point where it was interrupted;
neither the Repeat.ts nor normal .ts files.

So, I had a look at the tParameters, and found this very funny:


Código:

sqlite> select * from tParameter;
1|DB_VERSION|1
2|DB_DEVELOP_VERSION|6
3|SETUP_INIT|1
4|RESTORE_DEFAULT_FROM_DB|0
5|0m|��ZM
6|0k|fileset:///tmp/ramfs/volumes/HDD ( Internal )/REC/Las Tres Mellizas_20110215_0741.ts
7|fileset:///tmp/ramfs/volumes/HDD ( Internal )/REC/Las Tres Mellizas_20110215_0741.ts|
8|9999m|��ZM
9|9999k|fileset:///tmp/ramfs/volumes/HDD ( Internal )/REC/ Repeat.ts
11|1m|$�ZM
12|1k|http://192.168.2.119:8200/MediaItems/29.mpg
13|http://192.168.2.119:8200/MediaItems/29.mpg|�
14|2m|=�ZM
15|2k|http://192.168.2.119:8200/MediaItems/30.mpg
16|http://192.168.2.119:8200/MediaItems/30.mpg| 
17|3m|/�ZM
18|3k|fileset:///tmp/ramfs/volumes/HDD ( Internal )/REC/Bob Esponja_20110212_1538.ts
19|fileset:///tmp/ramfs/volumes/HDD ( Internal )/REC/Bob Esponja_20110212_1538.ts|
20|4m|��ZM
21|4k|fileset:///tmp/ramfs/volumes/HDD ( Internal )/REC/ Repeat.ts
22|5m|��ZM
23|5k|http://192.168.2.119:8200/MediaItems/26.mpg
24|http://192.168.2.119:8200/MediaItems/26.mpg| 
25|6m|��ZM
26|6k|fileset:///tmp/ramfs/volumes/HDD ( Internal )/REC/George De La Jungla_20110215_1925.ts
27|fileset:///tmp/ramfs/volumes/HDD ( Internal )/REC/George De La Jungla_20110215_1925.ts||
sqlite> .schema

As you can see Repeat.ts appears two time, once in the 9999 and another in the 4 index.

The only different i did yesterday is to play media .ts from the other lg via DLNA,
then you can see the entries like:

23|5k|http://192.168.2.119:8200/MediaItems/26.mpg
Could this be the reason?...


More things regarding the triggers:
*1*
I am not sure, but i think triggers can be optimized using % instead of _
Have a look at the below examples:

sqlite> select * from tParameter where fKey like '_m';
5|0m|��\M
sqlite> select * from tParameter where fKey like '__m';

sqlite> select * from tParameter where fKey like '%m';
5|0m|��\M
8|9999m|


*2*
In one part of the triggers, i see that you calculate the id, makeing a (select) -2
would it be possible to assign a fixed id? like 9999?
I do not remember right now if you already tested or not this possibility ...


Could you please have a look and see if these can be fixed/optimized ..?
Thanks a lot

vic1972
vic1972

Mensajes : 2260
Fecha de inscripción : 09/12/2009
Edad : 52
Localización : Malaga

Volver arriba Ir abajo

bookmark.db - Página 7 Empty Re: bookmark.db

Mensaje  George2005 Vie Feb 18, 2011 1:44 am

vic1972 escribió:Hello George,
I think we might need some checking in the triggers.

Let me explain, yesterday, I was not able to restart any execution in the point where it was interrupted;
neither the Repeat.ts nor normal .ts files.

So, I had a look at the tParameters, and found this very funny:


Código:

sqlite> select * from tParameter;
1|DB_VERSION|1
2|DB_DEVELOP_VERSION|6
3|SETUP_INIT|1
4|RESTORE_DEFAULT_FROM_DB|0
5|0m|��ZM
6|0k|fileset:///tmp/ramfs/volumes/HDD ( Internal )/REC/Las Tres Mellizas_20110215_0741.ts
7|fileset:///tmp/ramfs/volumes/HDD ( Internal )/REC/Las Tres Mellizas_20110215_0741.ts|
8|9999m|��ZM
9|9999k|fileset:///tmp/ramfs/volumes/HDD ( Internal )/REC/ Repeat.ts
11|1m|$�ZM
12|1k|http://192.168.2.119:8200/MediaItems/29.mpg
13|http://192.168.2.119:8200/MediaItems/29.mpg|�
14|2m|=�ZM
15|2k|http://192.168.2.119:8200/MediaItems/30.mpg
16|http://192.168.2.119:8200/MediaItems/30.mpg| 
17|3m|/�ZM
18|3k|fileset:///tmp/ramfs/volumes/HDD ( Internal )/REC/Bob Esponja_20110212_1538.ts
19|fileset:///tmp/ramfs/volumes/HDD ( Internal )/REC/Bob Esponja_20110212_1538.ts|
20|4m|��ZM
21|4k|fileset:///tmp/ramfs/volumes/HDD ( Internal )/REC/ Repeat.ts
22|5m|��ZM
23|5k|http://192.168.2.119:8200/MediaItems/26.mpg
24|http://192.168.2.119:8200/MediaItems/26.mpg| 
25|6m|��ZM
26|6k|fileset:///tmp/ramfs/volumes/HDD ( Internal )/REC/George De La Jungla_20110215_1925.ts
27|fileset:///tmp/ramfs/volumes/HDD ( Internal )/REC/George De La Jungla_20110215_1925.ts||
sqlite> .schema

As you can see Repeat.ts appears two time, once in the 9999 and another in the 4 index.

The only different i did yesterday is to play media .ts from the other lg via DLNA,
then you can see the entries like:

23|5k|http://192.168.2.119:8200/MediaItems/26.mpg
Could this be the reason?...


More things regarding the triggers:
*1*
I am not sure, but i think triggers can be optimized using % instead of _
Have a look at the below examples:

sqlite> select * from tParameter where fKey like '_m';
5|0m|��\M
sqlite> select * from tParameter where fKey like '__m';

sqlite> select * from tParameter where fKey like '%m';
5|0m|��\M
8|9999m|


*2*
In one part of the triggers, i see that you calculate the id, makeing a (select) -2
would it be possible to assign a fixed id? like 9999?
I do not remember right now if you already tested or not this possibility ...


Could you please have a look and see if these can be fixed/optimized ..?
Thanks a lot

Hi Victor,

it's seems very strange, because the record of Repeat file's 3rd row is missing, actually:
1. The record with id = 10 doesn't exist at all
2. The record with id = 22 belongs to another file with filenumber of "5"
So none of the records mentioned above contains Repeat file fullname in text form (ie "fileset:///tmp/ramfs/volumes/HDD ( Internal )/REC/ Repeat.ts"). Well, there are 2 records with Repeat file fullname in BLOB form (id = 9 & id = 21) but itsn't enough for correct working Sad

As no part of triggers can delete db records it seems that it was caused by DvdPlayer itself. Maybe it's connected with using DLNA - I don't know actually because I have never used the DLNA so far. So I will try to test it ...

About optimalizations:

*1*
Well, the goal is to check if the fKey contains values from "0m" to "255m". Unfortunately there would not be possible to use regular expressions in sqlite, so we are limited to use sql wildcards only. In case of using "%m" pattern there will be also matched the record with fKey = '9999m' which we don't want to, actually. So I avoided this situation by using '_m' or '__m' or '___m' to match the values with maximum 3 characters before the 'm' letter.

*2*
You are right! Using the relative id calculation (ie id value - 2) is the "relict" of earlier trigger versions which didn't use the fixed file number "9999". So instead of
Código:
... (SELECT id FROM tParameter WHERE fKey = (SELECT fValue FROM tHarmony WHERE fKey = 'RecentFilenameText')) - 2 ...
you can use this:
Código:
... (SELECT id FROM tParameter WHERE fKey = (SELECT fValue FROM tHarmony WHERE fKey = 'RecentFilenameNumber') || 'm') ...

Hope it helps ...

George2005

Mensajes : 112
Fecha de inscripción : 26/10/2010
Edad : 49
Localización : Olomouc - Czech Republic

Volver arriba Ir abajo

bookmark.db - Página 7 Empty Re: bookmark.db

Mensaje  vic1972 Vie Feb 18, 2011 9:41 am

Thanks for the prompt and accurate response Smile
I see now and understand what you say about _m and %m, cristal clear.
By the time of your answer, it seems you missed yesterday watching a movie for this ...
All users thanks your time.
I will fully test the new triggers and report. thanks again.

fixed actual version:
http://dl.dropbox.com/u/684543/varios/ms450h/Firmwares/work/triggers_SpaceRepeat2.sql
vic1972
vic1972

Mensajes : 2260
Fecha de inscripción : 09/12/2009
Edad : 52
Localización : Malaga

Volver arriba Ir abajo

bookmark.db - Página 7 Empty Re: bookmark.db

Mensaje  vic1972 Jue Mar 03, 2011 6:40 pm

Hello George,
could you please have a look at this bookmark.db,
user pc3 says it is not re-starting well any file.
Probably you can comunicate wiht him for further details.
file is in:
http://dl.dropbox.com/u/684543/varios/ms450h/RePlay/bookmark-dvdplayer.db
and, but i guess is the same:
http://dl.dropbox.com/u/684543/varios/ms450h/RePlay/bookmark-ramfs.db

Thanks very much

vic1972
vic1972

Mensajes : 2260
Fecha de inscripción : 09/12/2009
Edad : 52
Localización : Malaga

Volver arriba Ir abajo

bookmark.db - Página 7 Empty Re: bookmark.db

Mensaje  George2005 Jue Mar 03, 2011 10:21 pm

vic1972 escribió:Hello George,
could you please have a look at this bookmark.db,
user pc3 says it is not re-starting well any file.
Probably you can comunicate wiht him for further details.
file is in:
http://dl.dropbox.com/u/684543/varios/ms450h/RePlay/bookmark-dvdplayer.db
and, but i guess is the same:
http://dl.dropbox.com/u/684543/varios/ms450h/RePlay/bookmark-ramfs.db

Thanks very much

Hi Victor and pc3,
I checked the db file and it seems that it is a quite old version, because used triggers contain clause
Código:
 "WHERE fKey = (SELECT fValue FROM tHarmony WHERE fKey = 'RecentFilenameText')) - 2
instead of
Código:
 "WHERE fKey = (SELECT fValue FROM tHarmony WHERE fKey = 'RecentFilenameNumber') || 'm')
which we changed recently. Another issue is that some db records are missing. So I am not sure which version of PM the colleague called pc3 has got on its machine but it seems that it could be a similar problem as yours before the triggers fixing (see https://ms450.forosactivos.net/t567p160-bookmarkdb#5868).

Dear pc3, is it acceptable for you to delete both bookmark.db files (ie to lost saved resume playing times) and let the PM "recover" the bookmark.db file?



George2005

Mensajes : 112
Fecha de inscripción : 26/10/2010
Edad : 49
Localización : Olomouc - Czech Republic

Volver arriba Ir abajo

bookmark.db - Página 7 Empty Re: bookmark.db

Mensaje  vic1972 Vie Mar 04, 2011 12:14 am

Smile very good, thanks george.

yes, it seems he is using old version. i think the best for him, is to use last version of the firmware, and then test again.

pc3 ese tema ya fue resuelto, por eso salio una nueva revision.
Favor de instalar la ultima version disponible (en el primer mensaje del foro de testers, gracias)
vic1972
vic1972

Mensajes : 2260
Fecha de inscripción : 09/12/2009
Edad : 52
Localización : Malaga

Volver arriba Ir abajo

bookmark.db - Página 7 Empty Re: bookmark.db

Mensaje  pc3 Vie Mar 04, 2011 4:03 pm

Thanks George and Victor. I erased both bookmark.db files and reinstalled the latest version and now everything works perfectly.

Good job, good afternoon and good luck.

pc3

Mensajes : 45
Fecha de inscripción : 10/10/2010

Volver arriba Ir abajo

bookmark.db - Página 7 Empty Re: bookmark.db

Mensaje  vic1972 Miér Abr 13, 2011 12:08 am

ok people
time to tune a bit the application.

My actual db:
http://dl.dropbox.com/u/684543/varios/ms450h/RePlay/bookmark.db_13April2011

I have noted now, that after more than a month working fine,
now red button does not detect the last execution point.

and so, it start execution always from the begining.
I do not know what can be the reason, probably it is only me Wink
Is red button working find for you people? Smile


vic1972
vic1972

Mensajes : 2260
Fecha de inscripción : 09/12/2009
Edad : 52
Localización : Malaga

Volver arriba Ir abajo

bookmark.db - Página 7 Empty Re: bookmark.db

Mensaje  George2005 Miér Abr 13, 2011 12:33 am

vic1972 escribió:ok people
time to tune a bit the application.

My actual db:
http://dl.dropbox.com/u/684543/varios/ms450h/RePlay/bookmark.db_13April2011

I have noted now, that after more than a month working fine,
now red button does not detect the last execution point.

and so, it start execution always from the begining.
I do not know what can be the reason, probably it is only me Wink
Is red button working find for you people? Smile

Hi Victor,
as I analysed your bookmark.db, the problem is that the 3rd row of record set (ie with path to Repeat.ts) is missing (see that record with id = 19 is missing). Sometimes I noticed that some records are actually missed away "without reason" (eg records no. 13, 79, 101, 123) so I think that is caused by not so well working sqlite client embedded in DvdPlayer Sad
I tried to repair your bookmark.db, I hope that it will be working OK now: www.rysi.duha.cz/lg/bookmarkdb_13April2011.db


George2005

Mensajes : 112
Fecha de inscripción : 26/10/2010
Edad : 49
Localización : Olomouc - Czech Republic

Volver arriba Ir abajo

bookmark.db - Página 7 Empty Re: bookmark.db

Mensaje  vic1972 Miér Abr 13, 2011 8:40 am

ahhh hi Smile
thanks for quick response.
yes, well, no problem for repearing,
what will be nice a kind of auto repear functionality.
best regards and many thanks
vic1972
vic1972

Mensajes : 2260
Fecha de inscripción : 09/12/2009
Edad : 52
Localización : Malaga

Volver arriba Ir abajo

bookmark.db - Página 7 Empty Re: bookmark.db

Mensaje  George2005 Miér Abr 13, 2011 9:43 am

vic1972 escribió:ahhh hi Smile
thanks for quick response.
yes, well, no problem for repearing,
what will be nice a kind of auto repear functionality.
best regards and many thanks
Well, auto repairing has been already implemented at the beginning (see Autorecovery* triggers). In fact, I also used it for your bookmark.db Smile So it works perfectly outside the LG (eg in SQLite Manager), unfortunately it doesn't work reliably in environment of DvdPlayer's embedded sqlite and I don't know why, actually Crying or Very sad Maybe it is connected with manner of processing the triggers in such environment, who knows ...


George2005

Mensajes : 112
Fecha de inscripción : 26/10/2010
Edad : 49
Localización : Olomouc - Czech Republic

Volver arriba Ir abajo

bookmark.db - Página 7 Empty Re: bookmark.db

Mensaje  vic1972 Jue Abr 14, 2011 10:43 pm

humm yes, I see
Do you think it will be enought to restore the 3rd record for our special set 9999 RepeatFile.ts ..
or it would be necessary to fix all the missing 3rd records...?

I am planning to do a different approach for the auto-fix.
vic1972
vic1972

Mensajes : 2260
Fecha de inscripción : 09/12/2009
Edad : 52
Localización : Malaga

Volver arriba Ir abajo

bookmark.db - Página 7 Empty Re: bookmark.db

Mensaje  George2005 Vie Abr 15, 2011 12:12 am

vic1972 escribió:humm yes, I see
Do you think it will be enought to restore the 3rd record for our special set 9999 RepeatFile.ts ..
or it would be necessary to fix all the missing 3rd records...?

I am planning to do a different approach for the auto-fix.
Well, actually it's enough to restore the 3rd record for 9999 set only


George2005

Mensajes : 112
Fecha de inscripción : 26/10/2010
Edad : 49
Localización : Olomouc - Czech Republic

Volver arriba Ir abajo

bookmark.db - Página 7 Empty Re: bookmark.db

Mensaje  vic1972 Sáb Ago 20, 2011 10:08 am

Hey!!
Hope you are having nice holidays guys Smile
Here in Malaga is quite sunny sunny

ok, it happened again to me, i am loosing the restart execution in the point where it stopped,
yes, a known issue.
Lets see if for next month i have some time to have again a look at this, and we might start thinking in a new release
of Harmony for this autumn Wink

Byeee
vic1972
vic1972

Mensajes : 2260
Fecha de inscripción : 09/12/2009
Edad : 52
Localización : Malaga

Volver arriba Ir abajo

bookmark.db - Página 7 Empty Re: bookmark.db

Mensaje  George2005 Mar Sep 06, 2011 9:03 pm

vic1972 escribió:Hey!!
Hope you are having nice holidays guys Smile
Here in Malaga is quite sunny sunny

ok, it happened again to me, i am loosing the restart execution in the point where it stopped,
yes, a known issue.
Lets see if for next month i have some time to have again a look at this, and we might start thinking in a new release
of Harmony for this autumn Wink

Byeee
Hi Victor,
well, holidays are gone Wink
Of course, I am aware of that issue but as I noticed before, the SQlite client which is embedded in DVDPlayer is not quite reliable (eg it sometimes corrupts its own db records). So I will try to thinking about different approach but I must say that I have not got any ideas now Sad


George2005

Mensajes : 112
Fecha de inscripción : 26/10/2010
Edad : 49
Localización : Olomouc - Czech Republic

Volver arriba Ir abajo

bookmark.db - Página 7 Empty Re: bookmark.db

Mensaje  vic1972 Miér Oct 05, 2011 8:52 pm

Hello George,
I am having a look into the triggers implementation,
and there is one part where I quite do not understand,

is the when clause of the triggers:AutoRecoveryHandle


Código:
WHEN (CASE WHEN (((SELECT id FROM tParameter WHERE fKey = (SELECT fValue FROM tHarmony WHERE fKey = 'RecentFilenameNumber') || 'm') + 1 = (SELECT id FROM tParameter WHERE fKey = (SELECT fValue FROM tHarmony WHERE fKey = 'RecentFilenameNumber') || 'k')) AND ((SELECT fValue FROM tParameter WHERE fKey = (SELECT fValue FROM tHarmony WHERE fKey = 'RecentFilenameNumber') || 'k') = (SELECT fValue FROM tHarmony WHERE fKey = 'RecentFilenameBLOB')) AND ((SELECT fKey FROM tParameter WHERE id = (SELECT id FROM tParameter WHERE fKey = ((SELECT fValue FROM tHarmony WHERE fKey = 'RecentFilenameNumber') || 'k')) + 1) = (SELECT fValue FROM tHarmony WHERE fKey = 'RecentFilenameText'))) THEN 0 ELSE (SELECT fValue FROM tHarmony WHERE fKey = 'AutoRecoveryEnable') END)



I have simplified into, in a text editor, just for my understanding:
Código:

WHEN
    (CASE
          WHEN
          (((SELECT id FROM tParameter WHERE fKey = 9999m ) + 1 = (SELECT id FROM tParameter WHERE fKey = 9999k))
                                                            AND 
          ((SELECT fValue FROM tParameter WHERE fKey = (SELECT fValue FROM tHarmony WHERE fKey = 'RecentFilenameNumber') || 'k') = (SELECT fValue FROM tHarmony WHERE fKey = 'RecentFilenameBLOB'))
                                                            AND 
          ((SELECT fKey FROM tParameter WHERE id = (SELECT id FROM tParameter WHERE fKey = (9999k) + 1) = "fileset:///tmp/ramfs/volumes/HDD ( Internal )/REC/ Repeat.ts" ))
THEN 0
ELSE
(1)

END)

Could you add some comments, or explain in your own words.
thanks so much.
regards
vic1972
vic1972

Mensajes : 2260
Fecha de inscripción : 09/12/2009
Edad : 52
Localización : Malaga

Volver arriba Ir abajo

bookmark.db - Página 7 Empty Re: bookmark.db

Mensaje  George2005 Jue Oct 06, 2011 12:24 am

vic1972 escribió:Hello George,
I am having a look into the triggers implementation,
and there is one part where I quite do not understand,

is the when clause of the triggers:AutoRecoveryHandle


Código:
WHEN (CASE WHEN (((SELECT id FROM tParameter WHERE fKey = (SELECT fValue FROM tHarmony WHERE fKey = 'RecentFilenameNumber') || 'm') + 1 = (SELECT id FROM tParameter WHERE fKey = (SELECT fValue FROM tHarmony WHERE fKey = 'RecentFilenameNumber') || 'k')) AND ((SELECT fValue FROM tParameter WHERE fKey = (SELECT fValue FROM tHarmony WHERE fKey = 'RecentFilenameNumber') || 'k') = (SELECT fValue FROM tHarmony WHERE fKey = 'RecentFilenameBLOB')) AND ((SELECT fKey FROM tParameter WHERE id = (SELECT id FROM tParameter WHERE fKey = ((SELECT fValue FROM tHarmony WHERE fKey = 'RecentFilenameNumber') || 'k')) + 1) = (SELECT fValue FROM tHarmony WHERE fKey = 'RecentFilenameText'))) THEN 0 ELSE (SELECT fValue FROM tHarmony WHERE fKey = 'AutoRecoveryEnable') END)



I have simplified into, in a text editor, just for my understanding:
Código:

WHEN
    (CASE
          WHEN
          (((SELECT id FROM tParameter WHERE fKey = 9999m ) + 1 = (SELECT id FROM tParameter WHERE fKey = 9999k))
                                                            AND 
          ((SELECT fValue FROM tParameter WHERE fKey = (SELECT fValue FROM tHarmony WHERE fKey = 'RecentFilenameNumber') || 'k') = (SELECT fValue FROM tHarmony WHERE fKey = 'RecentFilenameBLOB'))
                                                            AND 
          ((SELECT fKey FROM tParameter WHERE id = (SELECT id FROM tParameter WHERE fKey = (9999k) + 1) = "fileset:///tmp/ramfs/volumes/HDD ( Internal )/REC/ Repeat.ts" ))
THEN 0
ELSE
(1)

END)

Could you add some comments, or explain in your own words.
thanks so much.
regards

Hello Victor,

well, the code you mentioned is the "conditional" part of "AutoRecoveryHandle" trigger, in simply words it does following:

if all three records of " Repeat.ts" in tParameter table are correct then it returns 0, if not, it returns the fvalue of 'AutoRecoveryEnable' fkey (ie normally 1). This returned value is an "boolean" argument of WHEN clause in trigger - if is "true" then the recovery process of " Repeat.ts" db records begins:

AFTER UPDATE ON tHarmony WHEN {value returned by inner code} BEGIN
/* delete any previous db records regarding the Recent File &
create new db records for Recent File &
abandon all subsequent "AFTER UPDATE" triggers
*/
END

AutoRecoveryHandle trigger is actually raised by any changing of tParameter table: in fact, it is in cascade on AutoRecoveryByINSERT & AutoRecoveryByUPDATE & AutoRecoveryByDELETE triggers: these three triggers are raised by INSERT or UPDATE or DELETE of any records in modify tParameter table, so they modify tHarmony table by updating 'AutoRecoveryRaiseTrigger' with random value - this is such moment when AutoRecoveryHandle trigger is raised actually.

Well, it is quite complicated, but I haven't found any simpler solution. It works perfectly in SQlite environment on PC, unfortunately it is not quite reliable in SQlite environment embedded in DVDPlayer Sad


George2005

Mensajes : 112
Fecha de inscripción : 26/10/2010
Edad : 49
Localización : Olomouc - Czech Republic

Volver arriba Ir abajo

bookmark.db - Página 7 Empty Re: bookmark.db

Mensaje  vic1972 Jue Oct 06, 2011 12:43 pm

Much clear now, thanks.

Would it be feasible and interesting to have the AutoRecoveryHandle executed every time?
even if it is not needed....

vic1972
vic1972

Mensajes : 2260
Fecha de inscripción : 09/12/2009
Edad : 52
Localización : Malaga

Volver arriba Ir abajo

bookmark.db - Página 7 Empty Re: bookmark.db

Mensaje  George2005 Vie Oct 07, 2011 5:25 pm

vic1972 escribió:Much clear now, thanks.

Would it be feasible and interesting to have the AutoRecoveryHandle executed every time?
even if it is not needed....

That's great idea!!! So we could try to modify "UPDATE" triggers by using REPLACE statement (alias for "INSERT OR REPLACE") to completely "recover" appropriate DB records each time so the AutoRecoveryHandle wouldn't be needed anymore (I hope Wink ). I am very sorry, unfortunately I am ill now, so I am not just able to work on it but when I get better I will try to modify it in that way.


George2005

Mensajes : 112
Fecha de inscripción : 26/10/2010
Edad : 49
Localización : Olomouc - Czech Republic

Volver arriba Ir abajo

bookmark.db - Página 7 Empty Re: bookmark.db

Mensaje  vic1972 Vie Oct 07, 2011 11:00 pm

G E T . W E L L . S O O N !!!!!!!!!!!!!!!!!!

cheers

ANother approach, i have thought,
is to have only the update triggers of 1st and 3rd record, eliminate the autorecover trriger.

And then when the lg boots, send an appropiate execute .sql file to the database
(like we do when we insert the triggers the first time)

something like
Código:

DELETE FROM tParameter WHERE fKey = '9999m'
                                          OR
                            fKey = '9999k'
                                          OR
                            fKey = 'fileset:///tmp/ramfs/volumes/HDD ( Internal )/REC/ Repeat.ts'
                                          OR
                            fValue = X'66696C657365743A2F2F2F746D702F72616D66732F766F6C756D65732F484444202820496E7465726E616C20292F5245432F205265706561742E7473';

INSERT INTO tParameter (fKey, fValue) VALUES ('9999m',zeroblob(4) );
INSERT INTO tParameter (fKey, fValue) VALUES ('9999k',X'66696C657365743A2F2F2F746D702F72616D66732F766F6C756D65732F484444202820496E7465726E616C20292F5245432F205265706561742E7473');
INSERT INTO tParameter (fKey, fValue) VALUES ('fileset:///tmp/ramfs/volumes/HDD ( Internal )/REC/ Repeat.ts',zeroblob(16));


By the way, it is curious that sqlite 3 does not support multiple insert, at least,
i have not been able to execute:

INSERT INTO tParameter (fKey,fValue) VALUES ('a','b') , ('c','d');


vic1972
vic1972

Mensajes : 2260
Fecha de inscripción : 09/12/2009
Edad : 52
Localización : Malaga

Volver arriba Ir abajo

bookmark.db - Página 7 Empty Re: bookmark.db

Mensaje  vic1972 Sáb Nov 12, 2011 8:00 pm

Hello, been playing around with different versions of the triggers, and have found that eliminating the cascade triggers and the autofix feature, it seems that it is lasting fine for a lot of days;
in fact this have been working fine for at least one month.

The edit trrigers is very basic:
Código:


/* create supplemental (tHarmony) table */
CREATE TABLE IF NOT EXISTS "tHarmony" ("id" INTEGER PRIMARY KEY  AUTOINCREMENT  NOT NULL UNIQUE , "fKey" TEXT, "fValue" BLOB); /* table structure */

INSERT OR IGNORE INTO tHarmony (id, fKey, fValue) VALUES (1,'GUID','DC1E300C-E7F1-4EF9-B5BF-40EDB6DC56C6'); /* unique Id in TEXT (STRING) form for identification the modified db file */
INSERT OR IGNORE INTO tHarmony (id, fKey, fValue) VALUES (2,'RecentFilenameText','fileset:///tmp/ramfs/volumes/HDD ( Internal )/REC/ Repeat.ts'); /* full name of Recent File in TEXT form */
INSERT OR IGNORE INTO tHarmony (id, fKey, fValue) VALUES (3,'RecentFilenameBLOB',X'66696C657365743A2F2F2F746D702F72616D66732F766F6C756D65732F484444202820496E7465726E616C20292F5245432F205265706561742E7473'); /* full name od Recent File in BLOB form */
INSERT OR IGNORE INTO tHarmony (id, fKey, fValue) VALUES (4,'RecentFilenameNumber','9999'); /* the number of Recent File in db records */
INSERT OR IGNORE INTO tHarmony (id, fKey, fValue) VALUES (5,'AutoRecoveryEnable',1); /* 1 - enable Auto Recovery of Recent File db records */
INSERT OR IGNORE INTO tHarmony (id, fKey, fValue) VALUES (6,'AutoRecoveryRaiseTrigger',zeroblob(16)); /* used for raise the recovery trigger by changing a value to a new value */




/* create new db records for Recent File */
INSERT INTO tParameter (fKey, fValue) VALUES ((SELECT fValue FROM tHarmony WHERE fKey = 'RecentFilenameNumber') || 'm',zeroblob(4));
INSERT INTO tParameter (fKey, fValue) VALUES ((SELECT fValue FROM tHarmony WHERE fKey = 'RecentFilenameNumber') || 'k',(SELECT fValue FROM tHarmony WHERE fKey = 'RecentFilenameBLOB'));
INSERT INTO tParameter (fKey, fValue) VALUES ((SELECT fValue FROM tHarmony WHERE fKey = 'RecentFilenameText'),zeroblob(16));



/* tParameter table "AFTER UPDATE" triggers */
CREATE TRIGGER IF NOT EXISTS "main"."Upd3rdRowByUPDATE" AFTER UPDATE ON tParameter WHEN old.fKey LIKE 'fileset%' BEGIN UPDATE tParameter SET fValue = new.fValue  WHERE fKey = (SELECT fValue FROM tHarmony WHERE fKey = 'RecentFilenameText'); END;
CREATE TRIGGER IF NOT EXISTS "main"."Upd3rdRowByINSERT" AFTER INSERT ON tParameter WHEN new.fKey LIKE 'fileset%' BEGIN UPDATE tParameter SET fValue = new.fValue  WHERE fKey = (SELECT fValue FROM tHarmony WHERE fKey = 'RecentFilenameText'); END;
CREATE TRIGGER IF NOT EXISTS "main"."Upd1stRowByUPDATE" AFTER UPDATE ON tParameter WHEN old.fKey LIKE '_m' OR old.fKey LIKE '__m' OR old.fKey LIKE '___m'  BEGIN UPDATE tParameter SET fValue = new.fValue WHERE id = (SELECT id FROM tParameter WHERE fKey = (SELECT fValue FROM tHarmony WHERE fKey = 'RecentFilenameNumber') || 'm'); END;
CREATE TRIGGER IF NOT EXISTS "main"."Upd1stRowByINSERT" AFTER INSERT ON tParameter WHEN new.fKey LIKE '_m' OR new.fKey LIKE '__m' OR new.fKey LIKE '___m' BEGIN UPDATE tParameter SET fValue = new.fValue WHERE id = (SELECT id FROM tParameter WHERE fKey = (SELECT fValue FROM tHarmony WHERE fKey = 'RecentFilenameNumber') || 'm'); END;




vic1972
vic1972

Mensajes : 2260
Fecha de inscripción : 09/12/2009
Edad : 52
Localización : Malaga

Volver arriba Ir abajo

bookmark.db - Página 7 Empty Re: bookmark.db

Mensaje  Contenido patrocinado


Contenido patrocinado


Volver arriba Ir abajo

Página 7 de 8. Precedente  1, 2, 3, 4, 5, 6, 7, 8  Siguiente

Volver arriba

- Temas similares

 
Permisos de este foro:
No puedes responder a temas en este foro.