Programatically/Command-Line Cleanup of Recordings DB? (1 Viewer)

revs

MP Donator
  • Premium Supporter
  • February 1, 2007
    1,274
    72
    The Sauce of Worcester
    Home Country
    Wales Wales
    Before I go writing a load of unnecessary code - does there exist, or is there an easy way to programmatically remove invalid entries from the recordings DB? (via either a small utility, command line, or SQL script)

    Background: I have a few small pythng scripts that compress film recordings to MP4, then lookup their name on IMDb (based on name and the actors names found in the epg xml file), and then once the MP4 is created I delete the ts file. So I now need to remove the entry in the recordings database (as the film is now in Moving Pictures)
     

    Guzzi

    Retired Team Member
  • Premium Supporter
  • August 20, 2007
    2,161
    747
    AW: Programatically/Command-Line Cleanup of Recordings DB?

    I'm sure it can be done with some scripting - you might want to check to code that does cleanup/does the same in the TVS configuration tool.
    For submitting the SQL request you will require a sql client .....
     

    revs

    MP Donator
  • Premium Supporter
  • February 1, 2007
    1,274
    72
    The Sauce of Worcester
    Home Country
    Wales Wales
    hi,

    i am looking for exactly the same. any hints? :)

    thanks,
    nicx...

    I managed to do it using the SQLCMD.exe command line tool. I use it with the ComSkip launcher, so that one comskip (and mp4 encoding) is done, it runs SQLCMD which in turn does a "Delete from recording where file = " and then the filepath (or something like that!
     

    nicx

    Portal Pro
    February 1, 2006
    387
    12
    Stuttgart
    Home Country
    Germany Germany
    hi,

    i am looking for exactly the same. any hints? :)

    thanks,
    nicx...

    I managed to do it using the SQLCMD.exe command line tool. I use it with the ComSkip launcher, so that one comskip (and mp4 encoding) is done, it runs SQLCMD which in turn does a "Delete from recording where file = " and then the filepath (or something like that!

    but how should i know the filepath of the file? i want to delete all files which are now more located in the tv-recording folder... how is this working with the button "remove invalid entries"? which is the parameter i should filter for in the sql command?

    nicx...

    I'm sure it can be done with some scripting - you might want to check to code that does cleanup/does the same in the TVS configuration tool.
    For submitting the SQL request you will require a sql client .....

    how/where can i check this code? i am no developer ;)

    nicx...
     

    revs

    MP Donator
  • Premium Supporter
  • February 1, 2007
    1,274
    72
    The Sauce of Worcester
    Home Country
    Wales Wales
    I'm not sure what your setup is, but i programatically move files via a command line option, so adding the SQLCMD command is easy (as mediaportal sends through the filename/path).

    Are you manually moving recordings? what is it you do with them?
     

    nicx

    Portal Pro
    February 1, 2006
    387
    12
    Stuttgart
    Home Country
    Germany Germany
    i am just deleting this files from other clients and other software. they are not moved but deleted on the harddisk.
     

    disaster123

    MP Donator
  • Premium Supporter
  • May 14, 2008
    3,558
    434
    Home Country
    Germany Germany
    AW: Programatically/Command-Line Cleanup of Recordings DB?

    You can use my episodescanner todo this :) just disable the episodestuff in config. It supports also cleaning of recordingdb.
     

    nicx

    Portal Pro
    February 1, 2006
    387
    12
    Stuttgart
    Home Country
    Germany Germany
    Re: AW: Programatically/Command-Line Cleanup of Recordings DB?

    You can use my episodescanner todo this :) just disable the episodestuff in config. It supports also cleaning of recordingdb.

    great, thank you!

    nicx...
     

    Guzzi

    Retired Team Member
  • Premium Supporter
  • August 20, 2007
    2,161
    747
    AW: Programatically/Command-Line Cleanup of Recordings DB?

    You can use my episodescanner todo this :) just disable the episodestuff in config. It supports also cleaning of recordingdb.

    hmmm, good idea, didn't think of this (probably because of the warning, that something might accidentially get deleted I immideately disabled this function). Will check this, cause I think this is very useful for averybody who changes their recordingdirectories from outside MP (recoding, moving, etc.).
     

    Users who are viewing this thread

    Top Bottom