NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public Add-ons (3rd party plugins, utilities and skins) v
« Previous 1 … 10 11 12 13 14 … 20 Next »
Imagegrablite - get it to (re)run on all oid's in database as a batch?

 
  • 0 Vote(s) - 0 Average
Imagegrablite - get it to (re)run on all oid's in database as a batch?
jksmurf
Offline

Posting Freak

HK (DMBTH)
Posts: 3,590
Threads: 410
Joined: Jul 2005
#1
2014-05-10, 04:03 AM
Is there any way to get Imagegrablite to do this?

i.e. get it to run or rerun on all oid's in database as a batch?

Cheers

k.
ASUS STRIX X470-F AMD 2700x 4GHz | Win10Prox64 | 32GB | NVIDIA GEforce GT1030 Fanless | WinTV DMB-TH | WinTV HVR-1280 | Hauppauge Colossus | AC86U/AC68U | USB-UIRT | RPi4 Libreelec | Sony Bravia LCD X9000F Android TV |
JavaWiz
Offline

Posting Freak

Jacksonville, FL. USA
Posts: 2,522
Threads: 141
Joined: Dec 2006
#2
2014-05-10, 05:00 PM
Try this,
  • Copy below block into a text file. Name it GetIGL.cmd
  • Review the bolded entries, make sure they match your locations
  • Review the IGL parameters, Make sure they match your needs.
  • Run it!


Code:
@Echo off
:BEGIN

[B]    SET SQLITE="c:/users/public/NPVR/Scripts/Utilities/sqlite3.exe"
    SET DB="c:/Users/Public/NPVR/npvr.DB3"
    SET IGLite="c:/program files/npvr/ImageGrabLite.exe"[/B]

    SET SQL=Select oid, filename from SCHEDULED_RECORDING WHERE status=2;

    ::-----------------------------------------------------------
    :: Generate the SQL script response file
    Echo .echo off                               >  sqlscript.scr
    Echo .output stdout                         >> sqlscript.scr
    Echo %SQL%                                  >> sqlscript.scr

    ::@ECHO ON
    :: type sqlscript.scr
    ::-----------------------------------------------------------
    :: Execute the script
    %SQLITE% %DB% < sqlscript.scr > tmp.fil
    @ECHO OFF

    for /f "tokens=1,2 delims=|" %%a in (tmp.fil) do Call :GetIGL_Data %%a "%%b"
    GoTo :ENDJOB


:GetIGL_Data
    Set oid=%1
    Set fileName=%2
    Echo Getting IGL Data for:
    Echo    OID: %oid%  - FileName: %fileName%
[B]    %IGLite% --oid %oid% --rename --zap2it[/B]
    Echo.
    GoTo :EOF
    
:ENDJOB
    Echo.
JavaWiz
Offline

Posting Freak

Jacksonville, FL. USA
Posts: 2,522
Threads: 141
Joined: Dec 2006
#3
2014-05-10, 05:52 PM
Even better, from another post, build the target batch file right from the SQL execution as in this example-

Code:
@Echo off
:BEGIN
    SET SQLITE="c:/users/public/NPVR/Scripts/Utilities/sqlite3.exe"
    SET DB="c:\Users\Public\NPVR\npvr.DB3"
    SET IGLite="c:/program files/npvr/ImageGrabLite.exe"

    SET SQL=SELECT '%IGLite% --nfo --zap2it --oid ', oid ^
            FROM Scheduled_Recording WHERE status=2 AND filename NOT LIKE '%.S%';

    ::-----------------------------------------------------------
    :: Generate the SQL script response file
    Echo .echo off         >  sqlscript.scr
    Echo .mode columns    >> sqlscript.scr
    Echo .output stdout   >> sqlscript.scr
    Echo %SQL%              >> sqlscript.scr
    
    ::-----------------------------------------------------------
    :: Execute the script
    Echo @Echo on                  > GetIGL_Generated.cmd
    %SQLITE% %DB% < sqlscript.scr >> GetIGL_Generated.cmd
    Echo.
    SET /P runIt=RunGeneratedScript(y/n)?
    if "%runIt%"=="y"  Call GetIGL_Generated.cmd
jksmurf
Offline

Posting Freak

HK (DMBTH)
Posts: 3,590
Threads: 410
Joined: Jul 2005
#4
2014-05-11, 12:45 AM
Cheers JW !

Both work well.

... haven't seen you for a long time :-)

k.
ASUS STRIX X470-F AMD 2700x 4GHz | Win10Prox64 | 32GB | NVIDIA GEforce GT1030 Fanless | WinTV DMB-TH | WinTV HVR-1280 | Hauppauge Colossus | AC86U/AC68U | USB-UIRT | RPi4 Libreelec | Sony Bravia LCD X9000F Android TV |
jam_zhou
Offline

Senior Member

Posts: 632
Threads: 179
Joined: Sep 2005
#5
2014-05-27, 01:36 PM
these scripts should be put in the wiki, or at least stickied.
E6400, 2 GB RAM ,500 GB + 250 GB HD, PVR150+ Adaptec 3610, RW 2 + HIP, Antec 2480 w/ mini ninja ...still using v 0.99
jam_zhou
Offline

Senior Member

Posts: 632
Threads: 179
Joined: Sep 2005
#6
2014-06-05, 12:37 PM
I used the script from Post #3 and while it works, I want to know how it works.

Does it go through all the files and brute force changes them all? Does it have intelligence and only attempts to rename those that need it? The reason I'm asking is because I want to use this to do a batch rename during the night. If it just brute force changes all the names then when the db gets big, it can take a while. If it's selective then it should run rather quickly.

Also, I've noticed that this script or IGL has a slight rename issue where if it's date based then it'll add an extra "." like showname.2014-04-02..mp4. I've attached a jpg to illustrate. It's not a problem for NPVR but funny looking when you look at the files.
E6400, 2 GB RAM ,500 GB + 250 GB HD, PVR150+ Adaptec 3610, RW 2 + HIP, Antec 2480 w/ mini ninja ...still using v 0.99
Graham
Offline

Posting Freak

UK
Posts: 4,058
Threads: 102
Joined: Dec 2005
#7
2014-06-05, 02:14 PM
jam_zhou Wrote:The reason I'm asking is because I want to use this to do a batch rename during the night.
Apologies if I am missing the point ... I have imagegraplite in my postprocessing.bat and it renames the recording file when the recording ends.
jam_zhou
Offline

Senior Member

Posts: 632
Threads: 179
Joined: Sep 2005
#8
2014-06-05, 02:25 PM
A couple of reasons.

1. conflicts with comskip - there are workarounds, but I don't feel comfortable with them
2. I'm not sure what would happen if I'm watching a show and it suddenly gets renamed.

Number 2 is my main concern.
E6400, 2 GB RAM ,500 GB + 250 GB HD, PVR150+ Adaptec 3610, RW 2 + HIP, Antec 2480 w/ mini ninja ...still using v 0.99
Graham
Offline

Posting Freak

UK
Posts: 4,058
Threads: 102
Joined: Dec 2005
#9
2014-06-05, 02:28 PM
jam_zhou Wrote:I want to know how it works.
The line in the script

Quote:SET SQL=SELECT '%IGLite% --nfo --zap2it --oid ', oid ^
FROM Scheduled_Recording WHERE status=2 AND filename NOT LIKE '%.S%';

is saying create a line containing the text igl.exe (or whatever you have set iglite as) --nfo blah and the value in the oid column of the scheduled-recording table for each row in the scheduled recording table where its a recording (status = 2) and the file name is not in format (not like) anything .S anything. The script creates a script file containing one line for each recording that matches the "where" and then runs the script file. You can change the "where" clause based on
http://www.w3schools.com/sql/sql_like.asp
http://www.w3schools.com/sql/sql_wildcards.asp

Do you have files called sqlscript.scr and GetIGL_Generated.cmd left over when the script runs? These are created by the script as it goes along.
Good Luck.
jam_zhou
Offline

Senior Member

Posts: 632
Threads: 179
Joined: Sep 2005
#10
2014-06-05, 03:16 PM
Graham,

thanks for explaining that. So, it tries to discriminate, but in my screen capture above, it'll try to rename it again (though to the same name).

The way I'm going I'm thinking of using postprocessing.bat to create a list like GetIGL_Generated.cmd which the script creates.

I'll run this new .bat file to rename then run my video transcoding.

This will mitigate and hopefully eliminate and race or conflict conditions all this post processing can cause.

My worry is that something will happen and corrupt my database...which is why I'll be making a backup of the database before any renames.
E6400, 2 GB RAM ,500 GB + 250 GB HD, PVR150+ Adaptec 3610, RW 2 + HIP, Antec 2480 w/ mini ninja ...still using v 0.99
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)

Pages (2): 1 2 Next »


Possibly Related Threads…
Thread Author Replies Views Last Post
  Update NPVR Database with UniqueID element using NextTool ChrisHammond56 7 1,975 2022-08-18, 03:29 AM
Last Post: sub
  imageGrabLite update mvallevand 20 13,655 2020-04-04, 02:42 AM
Last Post: jksmurf
  IRSS and channel-changing batch files Len_Lekx 5 3,511 2018-07-18, 08:12 PM
Last Post: Len_Lekx
  Help with batch file CDinger 4 3,404 2017-12-06, 04:34 AM
Last Post: CDinger
  ImageGrabLite "Read Error Object reference not set to an instance of an object." mjccox 6 5,097 2017-04-11, 07:07 AM
Last Post: rinomasaya
  IGL database lock error ttfitz 2 2,775 2017-03-16, 11:25 PM
Last Post: gEd
  imageGrabLite episode rename (Super Why) sosuke3 4 3,353 2016-11-24, 10:38 PM
Last Post: sosuke3
  XmltvExtras - TV Listings database not found jumbleknot 1 3,440 2016-10-11, 10:58 AM
Last Post: bja91
  UpdateEPG Batch File for Using GuidePlus GWCowling323 1 3,109 2016-10-07, 10:49 AM
Last Post: Graham
  ImageGrabLite and the ampersand ttfitz 8 4,845 2016-05-26, 11:56 PM
Last Post: JavaWiz

  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Designed by D&D, modified by NextPVR - Powered by MyBB

Linear Mode
Threaded Mode