Personal Video Database

English => Development => Scripts and Templates => Topic started by: VVV_Easy_Programing on January 28, 2017, 08:10:45 pm

Title: Some usefull SQL scripts in PVD
Post by: VVV_Easy_Programing on January 28, 2017, 08:10:45 pm
Hello,
there are sometimes that the script is not a good tool for arrange PVD. Happily we have the possibility of use SQL scripts.

First you must start  PVD in Debug Mode (viddb.exe -debug) and then you have in Menu->Help->SQL where you can run a SQL Script (tick the box if the script have several lines).

I publish two examples easy to understand:
1) Now I have problems with IMDB[EN] and the original title (give me a false string 'var ....'). I can solve easily the problem running:
                  update MOVIES set "origtitle"="title" where "origtitle"='var ue_t0=window.ue_t0||+new Date();';
or
                  update MOVIES set "origtitle"="title" where SUBSTR("origtitle",1,3) = 'var';

2) Some strange chars appears in the people IMDB url. I use:
                  update PEOPLE set "url"=replace("url",'?ref_=tt_ov_dr', '/');
                  update PEOPLE set "url"=replace("url",'?ref_=tt_ov_wr', '/');

I anime to all to publish here their own SQL scripts for PVD.
Title: Re: Some usefull SQL scripts in PVD
Post by: Ivek23 on December 22, 2023, 09:00:47 pm
Use this SQL script if you are missing this part in the imdb url: www.

Quote
update MOVIES set "url"=replace("url",'http://imdb', 'http://www.imdb');

Instructions on how to use the SQL script are in the first post.

Here you have some more similar SQL scripts.

Quote
update MOVIES set "url"=replace("url",'http://httpbin.org/response-headers?key=http://www.imdb', 'http://www.imdb');

Quote
update MOVIES set "url"=replace("url",'http://httpbin.org/response-headers?key=https://', 'http://');

Quote
update MOVIES set "url"=replace("url",'http://httpbin.org/response-headers?key=', '');
Title: Re: Some usefull SQL scripts in PVD
Post by: afrocuban on December 22, 2023, 11:03:00 pm
I have this problem with some urls from the times IMDb script wasn't updated for a long time before _2b:


Code: [Select]
http://www.imdb.comhttps://www.imdb.com

So I guess this should help?


Code: [Select]
update MOVIES set "url"=replace("url",'http://www.imdb.comhttps://www.imdb.com', 'https://www.imdb.com');
Title: Re: Some usefull SQL scripts in PVD
Post by: afrocuban on December 22, 2023, 11:20:10 pm
Related to http://www.videodb.info/forum_en/index.php/topic,4134.msg21969.html#msg21969 (http://www.videodb.info/forum_en/index.php/topic,4134.msg21969.html#msg21969)

The query has to be
Code: [Select]
update PEOPLE set "url"=replace("url",'http://imdb', 'http://www.imdb');
Title: Re: Some usefull SQL scripts in PVD
Post by: Ivek23 on December 23, 2023, 08:29:08 am
Related to http://www.videodb.info/forum_en/index.php/topic,4134.msg21969.html#msg21969 (http://www.videodb.info/forum_en/index.php/topic,4134.msg21969.html#msg21969)

The query has to be
Code: [Select]
update PEOPLE set "url"=replace("url",'http://imdb', 'http://www.imdb');

Of course, I just gave the movies as an example, but you can decide for yourself what you need it for.