Manual Solution for problems re-importing after delete. (1 Viewer)

RoChess

Extension Developer
  • Premium Supporter
  • March 10, 2006
    4,434
    1,897
    Do *NOT* proceed if you do not know how to make a backup of your DB3 database.

    If you want to first see what will get deleted from the database then change the "DELETE FROM" part into "SELECT * FROM" and it will show you.

    Use at your own risk.

    That being said, I've done it multiple times myself to verify it is reproducable, and everything worked great.


    #1 - Make backup of your "TVSeriesDatabase4.db3" (always a good thing anyway)

    #2 - Download an SQLite tool, such as SQLite Browser.

    #3 - Make sure no instance of MP-TVSeries is running (otherwise bad things will happen), then File -> Open Database -> locate and open the "TVSeriesDatabase4.db3" file.

    #4 - Click on the "Execute SQL" tab, and copy and paste the following command:

    DELETE FROM local_episodes WHERE (SELECT COUNT(*) FROM local_series WHERE local_series.id = local_episodes.seriesid) = 0;

    and click on "Execute query" button.

    #5. Repeat for:

    DELETE FROM local_episodes WHERE originalcomposite = '';
    DELETE FROM online_series WHERE ID < 1; --Do not use if you want to keep hidden series
    DELETE FROM season WHERE SeasonIndex < 0; --Do not use if you want to keep hidden seasons​

    #6 - Save the database and close SQLite Browser

    #7 - Open MP-TVSeries config and re-run the import wizard, and everything should work again.
     

    CandyAndy

    MP Donator
  • Premium Supporter
  • December 29, 2008
    157
    3
    Darmstadt
    Home Country
    Germany Germany
    Hi RoChess

    Thankyou for the tutorial. it works fine, i have no problems.

    Perhaps a small improvement to your instructions, if someone does not not find the database in windows.

    Open Folder Options
    Select (dot) Show hidden files, folders, and drives (I think)

    Because i have a german version. :)

    many greetings
    CandyAndy
     

    randell

    Portal Member
    February 27, 2007
    19
    6
    Ft Worth, Texas
    Home Country
    United States of America United States of America
    Sorry, It didn't worked for me.

    :sorry:

    Edit: This worked for me:

    Check first:
    select * from local_episodes where originalcomposite = ''

    Delete:
    delete from local_episodes where originalcomposite = ''

    Save the file then close the browser and then fire up the configuration/import wizard and see if that helps.
     

    fischy667

    Super User
  • Team MediaPortal
  • Super User
  • May 5, 2010
    958
    283
    41
    Rostock
    Home Country
    Germany Germany
    Edit: This worked for me:

    Check first:
    select * from local_episodes where originalcomposite = ''

    Delete:
    delete from local_episodes where originalcomposite = ''

    Save the file then close the browser and then fire up the configuration/import wizard and see if that helps.

    Thanks, this lines worked for me!
     

    RoChess

    Extension Developer
  • Premium Supporter
  • March 10, 2006
    4,434
    1,897
    • Thread starter
    • Moderator
    • #6
    I went over my entire database with a fine comb, and the following queries cleaned things up for me nicely:

    DELETE FROM local_episodes WHERE originalcomposite = '';
    DELETE FROM online_series WHERE ID < 1;
    DELETE FROM season WHERE SeasonIndex < 0;

    Use at own risk, but that's what backups are for.
     

    fischy667

    Super User
  • Team MediaPortal
  • Super User
  • May 5, 2010
    958
    283
    41
    Rostock
    Home Country
    Germany Germany
    These lines are working, but with these lines series get deleted which I set manualy to "never ask again" for importation. :oops:
     

    RoChess

    Extension Developer
  • Premium Supporter
  • March 10, 2006
    4,434
    1,897
    • Thread starter
    • Moderator
    • #8
    These lines are working, but with these lines series get deleted which I set manualy to "never ask again" for importation. :oops:

    That would be the "DELETE FROM online_series WHERE ID < 1;" part, so just skip that one.

    It takes a lot more complicated SQL queries to filter out if you manually ignored the series, or if it was supposed to be deleted. So I decided to just remove them all, and on the next import u can just re-ignore them. It is not the idea to keep running the above SQL commands, but only once to correct a problem :)
     

    Knives03

    Portal Pro
    March 6, 2009
    103
    2
    Thanks as always RoChess. This helped me with an issue that I was having where some episodes from Man vs. Wild were not being detected by the importer, hence not allowing me to add them to the series.
     

    Users who are viewing this thread

    Top Bottom