TVDatabase problem (1 Viewer)

debaser_uk

Portal Pro
June 15, 2006
69
0
NE Lincs, UK
Home Country
United Kingdom United Kingdom
Hi,

I have a slight problem with my tvDatabase, specifically the recording and the recorded tables where new records are not getting an Id (IdRecording, IdRecorded) - the field is null. When a recording is finished If I use the cleanup option the record stays in the table. Where or how does MP generate the id fields for these tables and can i fix it without re-installing??? I really really don't want to re-install (yet!).

At the moment I'm cleaning the records myself out of the database - it works but obviously is a major pain in the neck!

Hope someone can help me out on this!

Thanks in advance.

PS When I last re-installed MP I exported my recording and recorded tables and imported them into my new, empty tables and since then this has happened so I've obviously borked it myself. So feel free to point at me and laugh!
 

scoop

Retired Team Member
  • Premium Supporter
  • November 14, 2004
    614
    7
    Hi,

    The ID comes from recording.idRecording which is the primary key for that table. For SQLite this is a special (non-typeless, unlike all the other datatypes) datatype which functions as an AUTOINCREMENT feature. So, inserting NULL into the recording/recorded table should result into a unique next value. Judging by the information you give, this functionality somehow got lost in your TVDatabase.

    Now you can delete the TVDatabase (and loose all tv channels, groups, program info etc.) by deleting the TVDatabaseV21.db3 from the database directory.

    If you don't want that, you can also try to drop and recreate the two tables which hopefully brings back the AUTOINCREMENT functionality:
    Code:
    DROP TABLE recording;
    DROP TABLE recorded;
    CREATE TABLE recording ( idRecording integer primary key, idChannel integer, iRecordingType integer, strProgram text, iStartTime integer, iEndTime integer, iCancelTime integer, bContentRecording integer, priority integer, quality integer, episodesToKeep integer);
    CREATE TABLE recorded ( idRecorded integer primary key, idChannel integer, idGenre integer, strProgram text, iStartTime integer, iEndTime integer, strDescription text, strFileName text, iPlayed integer);

    Kind regards,
    Michel
     

    debaser_uk

    Portal Pro
    June 15, 2006
    69
    0
    NE Lincs, UK
    Home Country
    United Kingdom United Kingdom
    Thanks Michel,

    I guessed that it was probably autoincrement or something like that and that it had failed somehow. I will export the current data and re-create the table and hopefully all will be well.

    Cheers,

    Neil.
     

    Users who are viewing this thread

    Top Bottom