Page 1 of 2

[Fixed in v7.1] TV Series episodes not always marked as watched and other errors

Posted: Sun Dec 03, 2023 8:39 am
by Manni
Hi there,

As I'm still getting issues with Series episode watching in the final build of CMC 7, I thought it would be a good idea to create a new thread to focus on this specifically and fix it.

I've recently created a new TV Series, The Bureau, with just one season. It's created in MM CM as a TV Series (not discs) with individual files for each episode.

After watching episode 1, I got the following error message:
Error after watching episode 1.jpg
Error after watching episode 1.jpg (742.71 KiB) Viewed 19666 times
The episode list was garbled as well. I had never got that error before, and haven't seen it since when watching the next 3 episodes. [EDIT: I since got it a few times while watching episodes 5-8].

However, none of the episodes was marked as watched after watching 99% of them (I pressed stop during the end credits, a few minutes at most before the end).

I tried with one of the episodes to pause it for 10-15 minutes, as was requested a while back. That made no difference.

In case it matters, my TV Series are on different shares:
4K UHD BD ones on the A4K server (two different shares). This is the server that holds the VM that contains the CCC server. The A4K server is set to go to sleep after about one hour (45 minutes after the drives are in standby, which takes around 15 min).
Bluray ones on the B2K server (one share, bdtv). That's the one that holds the series above.

Please let me know how you'd like to proceed to resolve this. I still have 6 episodes to watch in that same series, so I'm happy to do tests / provide logs etc.

Re: TV Series episodes not always marked as watched and other errors

Posted: Wed Dec 06, 2023 3:22 pm
by Manni
Pursuing my tests, I can confirm that I got similar errors when watching season two of the same series.
Also these issues (errors and episodes not marked as watched are not related to server sleep/WOL. the episodes are not marked as watched even if both servers are always on (slep disabled).

Re: TV Series episodes not always marked as watched and other errors

Posted: Thu Dec 07, 2023 10:35 am
by Manni
Also to confirm that the episodes are not marked as watched even if I let them play until the end and jRiver exits back to CMC.
Whatever I do, no matter how long I wait, the only way to get the episodes as watched is to mark them as watched manually (ESC).
Then they are remembered as being watched, so CCC is working.

Re: TV Series episodes not always marked as watched and other errors

Posted: Thu Dec 07, 2023 11:25 am
by Pauven
Hey Manni, I think I might have added some additional debugging for v7 to the PlayClick log.

Can you grab me some of those, that might reveal what's going on.

Re: TV Series episodes not always marked as watched and other errors

Posted: Thu Dec 07, 2023 12:45 pm
by Manni
Sure, will do tonight. Do I just enable debug log, play an episode until it stops, and send you the playclick once I'm back to CMC?

Re: TV Series episodes not always marked as watched and other errors

Posted: Thu Dec 07, 2023 12:57 pm
by Pauven
Yep, that's it.

And each playclick event is logged in a separate timestamped file (as long as they start 1 minute apart), so you can easily do multiple if you feel the need.

Re: TV Series episodes not always marked as watched and other errors

Posted: Thu Dec 07, 2023 1:30 pm
by Manni
OK, will do. I'll try to do a variety, some stopped when the end credits start, some going until the end of the episode. I'll send you the logs afterwards, I plan to watch 2-3 episodes tonight.

Re: TV Series episodes not always marked as watched and other errors

Posted: Thu Dec 07, 2023 8:36 pm
by Manni
Hi Paul,

As promised, I've emailed you a zip with the following logs:

1) Feature film "Booksmart", correctly marked as watched after playback
2) last three episodes of The Bureau Season 2, none of them marked as watched. I tried to pause the first one for a few minutes and I let it run until the end, so it clearly doesn't get the correct length. The others I stopped when the end credits started, definitely after 85% of the episode duration (default setting in CMC). It's litterally 1-2 minutes before the end (short end credits), out of 50+ minutes foe each episode.

I let plenty of time between each episode to allow CMC to mark them as watched, but it didn't happen (as the logs show). All the episodes I marked as watched manually are still marked as watched in MyMovies CM. I didn't mark as watch the last two manually, and they are still marked as "not watched" in CMC, a few hours after playback.

I also got an error after the playback of the last episode, after it returned focus to CMC and I tried to exit:
Series error after last episode playback.jpg
Series error after last episode playback.jpg (1.32 MiB) Viewed 19448 times

Re: TV Series episodes not always marked as watched and other errors

Posted: Fri Dec 08, 2023 11:37 am
by Pauven
Okay, I think we're really close to figuring this issue out. And I think it may be a source data issue.

First, here's how the episode time should look when shown in CMC:

image.png (63.68 KiB) Viewed 19364 times

Notice it clearly indicates 19 minutes and 33 seconds.

Next, look at how your Bureau episode length looks:

image.png (212.79 KiB) Viewed 19364 times

Missing the seconds isn't a huge deal, but that ~tilde in front, suggesting the episode is approximately 54 minutes, is bad. I don't remember programming a tilde to show, so that could be in your source data, or could be logic I've forgotten. And while to humans this is very readable, ~54 is not a number, it's a text string, and that would break my code that is looking for a number.

Next clue, the log:

Code: Select all

[22:20:26]    Focused has returned to CMC, playback ended
[22:20:26]      Executing Mi Casa Verde scene for Movie Playback Stop
[22:20:26]        Processing Episode Return - Automark Watched Threshold exceeded (3090s elapsed > 0sec Threshold)
[22:20:26]            Episode too short for Automark Watched processing, Logging Watch Event with Duration 51minutes
So CMC correctly sees that you played (or, at the very least, were in the player) for 3,090 seconds, 51 minutes and 30 seconds. And it compares that against 0 seconds to see if it is greater. Now, while 3090 is greater than 0, the problem is that it's a freaking 0!

The log also explains that the episode is too short for the Automark Watched processing. That's something I programmed, that if the duration is less than 5 minutes, I don't automatically mark anything as watched, as I assume it is bad data. And this is correct, 0 seconds is bad data.

Regarding the on-screen error after playback:

image.png (105.74 KiB) Viewed 19364 times

That could be a side effect of a failed math result. And the failed math is that the episode's runtime was a text string, ~54 or maybe ~54m, in My Movies, and CMC tried to multiply it to get seconds (i.e. ~54 * 60 = ERROR), which totally freaked out CMC and caused the display issues and pop-up error in addition to the episode not being flagged as watched. But I would have to investigate more to be sure.

The next question is, where is CMC pulling the episode length from? I'm going a bit from memory, here, but for disc based episodes, the length is pulled from the disc data. So the 19m33s runtime for TBBT S1E1 came from the disc. Since you're using file based episodes, that data is missing. So I think the ~54 is coming from the parent TV series data. For example, here's TBBT:

image.png (78.7 KiB) Viewed 19364 times

Notice it says the runtime is 30 minutes, which more represents the timeslot with commercials, and not the episodes actual length.

Now, perhaps you have ~54 in yours, instead of 54. Or perhaps I have CMC defaulting back to the parent data when the individual episode value is missing, and perhaps I prefix the tilde to indicate this.

So what have you got in MMCM?

Re: TV Series episodes not always marked as watched and other errors

Posted: Fri Dec 08, 2023 12:08 pm
by Pauven
Double-checked my code for displaying episode runtimes:

Code: Select all

        Runtime := MovieDB.Title[TitleIndex].Season[S].Episodes[EpisodeIndex].Runtime;
        if RunTime.IsEmpty then
          Runtime := '~' + MovieDB.Title[TitleIndex].SeriesInfo.OrigRunTime.ToString + 'm';

So, uhm... yeah. That tilde is all CMC, you won't find that in MMCM.

But this does give another clue. IsEmpty checks to see if the value is nothing, not 0 but literally an empty NULL value.

Which brings us back to the Mark Episode Watched logic. It's only looking at the Episode's Runtime value, which isn't 0 but nothing. This could cause the error you're seeing, and in best case scenario it will be interpreted as a zero, which disqualifies it for the automark watched logic.

So this likely means I need to enhance CMC's logic. One, I need to handle a null value here instead of throwing an error. Two, I need to grab the parent TV Series' average runtime value to use in it's place. And three, I probably need to adjust that value to account for commericals.

While your Bureau average episode value of 54 minutes is likely realistic, The Big Bang Theory's average runtime value of 30 minutes is way off. Assuming I skip credits at the end, I might only watch 18 minutes of a 20 minute episode. My default automark watched logic uses an 85% threshold, which is to account for not watching the end credits, but 85% of 30 minutes is still 25.5 minutes, so watching 18 minutes would never trigger the logic.

So I'm thinking I need to decrease the average runtime when I grab it from the parent. So 30 minutes needs to become more like 21 minutes, and 60 minutes more like 42 minutes. I'm thinking of multiplying by 70% to make this adjustment. That way, the automark logic will be checking to see if you watched 85% of 70% of the average runtime, or about 18 minutes of a half hour show, and 36 minutes of an hour long show.

This adjustment does backfire a bit on your Bureau series, since 54 minutes really is closer to an average episode runtime and not a scheduling timeslot. So 85% of 70% of 54 minutes would mean you'd only need to watch about 32 minutes for the episode to be marked watched.

I suppose I could make this new logic smarter, and only apply the 70% reduction if the average runtime is an increment of 30. So 30 and 60 minute shows would be reduced to 21 and 42 minutes to account for US commercial times. Anything else would retain the full value, so you'd have to watch the full 85% of 54 minutes, or about 46 minutes, to have the episode marked as watched.