set ALL episodes in all series as unwatched (reset database for new users) (1 Viewer)

dir

MP Donator
  • Premium Supporter
  • August 30, 2006
    408
    36
    Afghanistan Afghanistan
    Does anyone know of a quick way to reset the watched flag for all episodes in all series of a large collection? I have 350 series and 25000 episodes and have tried manually resetting series one at a time, either via the gui or via hte config util. Its going to take forever this way.

    I need to reset ALL episodes in ALL series at once - not one series at a time.

    I already know you can reset an entire series, or season, or episode at once - I'm asking to reset ALL series at once, and not one by one. (Please re-read this before you helpfully suggest what I've already said I've tried!)

    I've also tried exporting the watched flags to see if I could modify the file, but that doesn't work either.
     

    RoChess

    Extension Developer
  • Premium Supporter
  • March 10, 2006
    4,348
    1,828
    Country flag
    I've never looked into it, but Follw.it or Trakt might offer an easier "reset all" method on their website, which will then be synced back to your setup if you configured one of them in your MediaPortal setup.

    Otherwise there is always SQL.
     

    ltfearme

    Community Plugin Dev
  • Premium Supporter
  • June 10, 2007
    6,702
    7,087
    Sydney
    Australia Australia
    Country flag
    Quickest way will be a SQL set query on the database itself, there is no way to do this currently from with-in the Config/GUI. Let me know if you're not capable of doing this and I (or Rochess) will reply with detailed instructions.

    Note: If you're using trakt you may want to disable it or setup another account as it will re-sync your watched state to your local database.

    The trakt plugin can sync your unwatched states but only if you set them as unwatched in the MediaPortal GUI (not config or database), there is no quick way to un-watch them ALL from the website either.
     

    dir

    MP Donator
  • Premium Supporter
  • August 30, 2006
    408
    36
    Afghanistan Afghanistan
    I take your SQL challenge and shall apply myself to working out the syntax.
    something like [quickly googles]

    UPDATE table1 SET column1='Value2' WHERE column1='Value1';

    Now I just gotta work out what the column names are, the table name, the utility to allow me to modify a database, and the initial syntax for opening the db!

    Progress:table is 'local_episodes' and column is 'DateWatched'
     
    Last edited:

    dir

    MP Donator
  • Premium Supporter
  • August 30, 2006
    408
    36
    Afghanistan Afghanistan
    Ok, I hit a brick wall. I worked out the following:

    Tool to use to open / modify database: SQLITE3.exe
    commands used:
    .mode column
    .headers on
    .output blah.txt
    select * from local_episodes;
    .quit

    I examine the output and it shows:
    Code:
    EpisodeFilename														 OriginalComposite  CompositeID  SeriesID	SeasonIndex  EpisodeIndex  LocalEpisodeName  LocalImportProcessed  CompositeUpdated  AvailableSubtitles  OriginalComposite2  CompositeID2  EpisodeIndex2  videoWidth  videoHeight  FileDateAdded		FileDateCreated	  IsAvailable  DateWatched  ext		 VolumeLabel				  localPlaytime  VideoCodec	  VideoFormat  VideoFormatProfile  VideoBitrate  VideoFrameRate  VideoAspectRatio  AudioCodec  AudioFormat  AudioFormatProfile  AudioBitrate  AudioChannels  AudioTracks  TextCount  StopTime 
    ----------------------------------------------------------------------  -----------------  -----------  ----------  -----------  ------------  ----------------  --------------------  ----------------  ------------------  ------------------  ------------  -------------  ----------  -----------  -------------------  -------------------  -----------  -----------  ----------  ---------------------------  -------------  ---------------  -----------  ------------------  ------------  --------------  ----------------  ----------  -----------  ------------------  ------------  -------------  -----------  ----------  ----------
    \\mofo\Audio Video Media\TV\2 Broke Girls\Season 01\s01e01 - Pilot.mkv					 248741_1x1  248741	  1			1			 Pilot			 2					 1				 0													 0			  1920		1080		 2013-06-11 14:20:09  2012-12-18 23:17:50  2						 mkv		 \\mofo\Audio Video Media\TV  1319319		V_MPEG4/ISO/AVC  AVC		  High@L4.1		  12675000	  23.976		  1.778			 A_DTS	  DTS		  -1				  1509000	  6			  1			-1					
    \\mofo\Audio Video Media\TV\2 Broke Girls\Season 01\s01e02 - And the B					 248741_1x2  248741	  1			2			 And the Breakup  2					 1				 0													 0			  1920		1080		 2013-06-11 14:42:28  2012-12-18 23:44:39  2						 mkv		 \\mofo\Audio Video Media\TV  1286286		V_MPEG4/ISO/AVC  AVC		  High@L4.1		  8164000	  23.976		  1.778			 A_DTS	  DTS		  -1				  1509000	  6			  1			-1					
    \\mofo\Audio Video Media\TV\2 Broke Girls\Season 01\s01e03 - And Strok					 248741_1x3  248741	  1			3			 And Strokes of G  2					 1				 0													 0			  1280		720		  2013-06-11 15:02:31  2012-12-18 17:46:46  2						 mkv		 \\mofo\Audio Video Media\TV  1299299		V_MPEG4/ISO/AVC  AVC		  High@L4.1		  5657000	  23.976		  1.778			 A_DTS	  DTS		  -1				  1509000	  6			  1			-1					
    \\mofo\Audio Video Media\TV\2 Broke Girls\Season 01\s01e04 - And the R					 248741_1x4  248741	  1			4			 And the Rich Peo  2					 1				 0													 0			  1280		720		  2013-06-11 15:20:25  2012-12-18 18:08:58  2						 mkv		 \\mofo\Audio Video Media\TV  1293293		V_MPEG4/ISO/AVC  AVC		  High@L4.1		  5690000	  23.976		  1.778			 A_DTS	  DTS		  -1				  1509000	  6			  1			-1
    (I have no idea why the columns don't line up - they do in the output file and they do when I preview this forum posting. They just don't line up aftwards...) So the following may not seem clear from the table above, but its true:

    The 'DateWatched' column is blank for all 25000 episodes!

    What column is used in what table to indicate that an episode has been watched?
     
    Last edited:

    ltfearme

    Community Plugin Dev
  • Premium Supporter
  • June 10, 2007
    6,702
    7,087
    Sydney
    Australia Australia
    Country flag
    The watched flag gets persisted to the online_episodes table. I believe the column name is 'watched' as well.

    I dont have the database in front of me until tonight so I may be a little off with my names.
     
    Last edited:

    dir

    MP Donator
  • Premium Supporter
  • August 30, 2006
    408
    36
    Afghanistan Afghanistan
    Ah, thanks. Unfortunately I ran into a show-stopper.
    The online_episodes table was fine - I found and reset all episode watched flags to 0.
    However, the 'season' table contains two columns that hold info about watched status - 'UnwatchedItems' and 'EpisodesUnwatched'. There's also 'EpisodeCount' which contains the # of episodes in the season.

    UnwatchedItems is a binary value, so I assume it indicates whether there are any unwatched episodes in that season. That's easy enough to reset.
    'EpisodesUnwatched' however is harder - it needs to be reset back to the same value as 'EpisodeCount'. In other words:

    Season 3 of Bewitched:
    UnwatchedItems = 1
    EpisodeCount = 23
    EpisodesUnwatched = 4

    Somehow I need to be able to set 'EpisodeUnwatched' to "23". Undoubtedly its possible using advanced SQL syntax but its beyond my simple grasp!

    I assume the same sort of columns exist at the Series level as well.
     

    ltfearme

    Community Plugin Dev
  • Premium Supporter
  • June 10, 2007
    6,702
    7,087
    Sydney
    Australia Australia
    Country flag
    Yeah the other fields you mention are tricker, these are updated at the very end of an import.

    So you can either 'Run Import', go do the shopping and hope it's finished when you get back OR wait until tonight and I will post the SQL command to run on the season and series tables.
     

    dir

    MP Donator
  • Premium Supporter
  • August 30, 2006
    408
    36
    Afghanistan Afghanistan
    lol - no, I can't do a re-import as it takes hours and downloads several gigs of data. I'm doing this at a mate's house and he as a very very small monthly limit on his ISP plan.

    I found that I can resolve the previous issue via:
    sqlite> update season
    ....> set EpisodesUnwatched = EpisodeCount;

    And voila, that sets all EpisodesUnwatched to be the same as EpisodeCount.

    Now on to the series table.
     

    Users Who Are Viewing This Thread (Users: 0, Guests: 1)

    OP Similar threads Forum Replies Date
    A cursor.wav or click.wav set in keyboard and keys cause recordings to be set in upcoming episodes 1.20 2
    A "upcoming episodes" arrow key set recording - Ok/rtn doesn't work General Support 9
    da3dsoul [Request] An MVP Plugin example for custom settings in MP2 Plugin Development 2
    M.Hulot MP plays in Internal Blu-ray-Player-mode always first audio stream not the one I chosen in settings General Support 1
    R Correct setting for recordings on shared folder General 0
    J New computer with win10 and how will i set Mediaportal up ? Newcomers Forum 55
    M [fixed] [MP2-831] 12h time format shown in TV Guide with Swedish language settings Submit: Bug Reports 27
    joEhSuper Backup Setting - ErrorBackupFolder TV-Server 9
    Rob Hexenmeister [solved] Customising Fanart Handler settings Fanart Handler 3
    joecrow AMD Radeon Settings app. won't start after hibernation. General Support 0
    L [solved] Modifying programmed recording after setting it General 0
    B [solved] How to manually set MAC of TV Server for WOL Installation, configuration support 2
    X MadVR Settings Video & DVD 2
    J Resume from Standby Last Module TV Showing TV Server Settings Television (MyTV frontend and TV-Server) 2
    D Correct wake-on-lan settings General 3
    G MP Crashed during setting up recording. Newcomers Forum 1
    cbr954rr Overtake/overwrite settings for all clients Feature Requests 0
    cbr954rr Same settings on all Clients? General 6
    framug 1.22.0 BasicHome Editor settings for DefaultWide HD skin not kept when update 1.22 3
    N [Question] [MP2-493] Default culture not saved in settings MediaPortal 2 0
    cbr954rr Movie sets in films General 20
    D PC rebuild & MP2 upgrade - how to preserve database and settings? General 1
    cbr954rr Possibillity to export and import all client settings? General 0
    morpheus_xx [Finished] [MP2-802] TV-Settings availability in all TV screens MediaPortal 2 12
    N [will not fix] Changed settings do not take effect until MP2-Client is stopped and restarted. Submit: Bug Reports 4
    Similar threads

























    Top Bottom