bookmark.db
5 participantes
Página 7 de 8.
Página 7 de 8. • 1, 2, 3, 4, 5, 6, 7, 8
Re: bookmark.db
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
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- Mensajes : 2260
Fecha de inscripción : 09/12/2009
Edad : 52
Localización : Malaga
Re: bookmark.db
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.
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.
Re: bookmark.db
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.
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- Mensajes : 2260
Fecha de inscripción : 09/12/2009
Edad : 52
Localización : Malaga
Re: bookmark.db
Hi Victor, thanks a lot! I tested it and it works correctly even with the czech filenamesvic1972 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
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
Re: bookmark.db
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:
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
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- Mensajes : 2260
Fecha de inscripción : 09/12/2009
Edad : 52
Localización : Malaga
Re: bookmark.db
Hi Victor,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
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
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 ...
- 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
Re: bookmark.db
Thanks for the prompt and accurate response
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
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- Mensajes : 2260
Fecha de inscripción : 09/12/2009
Edad : 52
Localización : Malaga
Re: bookmark.db
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
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- Mensajes : 2260
Fecha de inscripción : 09/12/2009
Edad : 52
Localización : Malaga
Re: bookmark.db
Hi Victor and pc3,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
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
- Código:
"WHERE fKey = (SELECT fValue FROM tHarmony WHERE fKey = 'RecentFilenameNumber') || 'm')
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
Re: bookmark.db
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)
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- Mensajes : 2260
Fecha de inscripción : 09/12/2009
Edad : 52
Localización : Malaga
Re: bookmark.db
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.
Good job, good afternoon and good luck.
pc3- Mensajes : 45
Fecha de inscripción : 10/10/2010
Re: bookmark.db
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
Is red button working find for you 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
Is red button working find for you people?
vic1972- Mensajes : 2260
Fecha de inscripción : 09/12/2009
Edad : 52
Localización : Malaga
Re: bookmark.db
Hi Victor,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
Is red button working find for you people?
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
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
Re: bookmark.db
ahhh hi
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
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- Mensajes : 2260
Fecha de inscripción : 09/12/2009
Edad : 52
Localización : Malaga
Re: bookmark.db
Well, auto repairing has been already implemented at the beginning (see Autorecovery* triggers). In fact, I also used it for your bookmark.db 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 Maybe it is connected with manner of processing the triggers in such environment, who knows ...vic1972 escribió:ahhh hi
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
George2005- Mensajes : 112
Fecha de inscripción : 26/10/2010
Edad : 49
Localización : Olomouc - Czech Republic
Re: bookmark.db
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.
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- Mensajes : 2260
Fecha de inscripción : 09/12/2009
Edad : 52
Localización : Malaga
Re: bookmark.db
Well, actually it's enough to restore the 3rd record for 9999 set onlyvic1972 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.
George2005- Mensajes : 112
Fecha de inscripción : 26/10/2010
Edad : 49
Localización : Olomouc - Czech Republic
Re: bookmark.db
Hey!!
Hope you are having nice holidays guys
Here in Malaga is quite 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
Byeee
Hope you are having nice holidays guys
Here in Malaga is quite 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
Byeee
vic1972- Mensajes : 2260
Fecha de inscripción : 09/12/2009
Edad : 52
Localización : Malaga
Re: bookmark.db
Hi Victor,vic1972 escribió:Hey!!
Hope you are having nice holidays guys
Here in Malaga is quite 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
Byeee
well, holidays are gone
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
George2005- Mensajes : 112
Fecha de inscripción : 26/10/2010
Edad : 49
Localización : Olomouc - Czech Republic
Re: bookmark.db
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
I have simplified into, in a text editor, just for my understanding:
Could you add some comments, or explain in your own words.
thanks so much.
regards
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- Mensajes : 2260
Fecha de inscripción : 09/12/2009
Edad : 52
Localización : Malaga
Re: bookmark.db
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
George2005- Mensajes : 112
Fecha de inscripción : 26/10/2010
Edad : 49
Localización : Olomouc - Czech Republic
Re: bookmark.db
Much clear now, thanks.
Would it be feasible and interesting to have the AutoRecoveryHandle executed every time?
even if it is not needed....
Would it be feasible and interesting to have the AutoRecoveryHandle executed every time?
even if it is not needed....
vic1972- Mensajes : 2260
Fecha de inscripción : 09/12/2009
Edad : 52
Localización : Malaga
Re: bookmark.db
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 ). 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.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....
George2005- Mensajes : 112
Fecha de inscripción : 26/10/2010
Edad : 49
Localización : Olomouc - Czech Republic
Re: bookmark.db
G E T . W E L L . S O O N !!!!!!!!!!!!!!!!!!
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
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');
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- Mensajes : 2260
Fecha de inscripción : 09/12/2009
Edad : 52
Localización : Malaga
Re: bookmark.db
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:
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- Mensajes : 2260
Fecha de inscripción : 09/12/2009
Edad : 52
Localización : Malaga
Página 7 de 8. • 1, 2, 3, 4, 5, 6, 7, 8
Página 7 de 8.
Permisos de este foro:
No puedes responder a temas en este foro.