"metadata_item_views" inaccurate

Server Version#: 1.19.3.2740
Player Version#: Multiple/Various (Apple TV, Roku, Chrome)

Was trying out Plex Dash app and casually observed user streaming a particular show. Later, went to look at stats for the week and noticed that user did not show up at all for that day, but do have several entries for earlier in the week. I later kept the dash open all day and observed multiple users start/stop programs.

None of the viewers who watched only a partial program appear in “metadata_item_views”.

Some of the viewers do not appear despite watching entire programs. The only record I found of the missing completed shows was a single entry in Plex Transcoder Statistics.log for the latest session, earlier views by that user were nowhere to be found.

It appears as though entries to “metadata_item_views” are only created after viewing and if enough of a program is viewed, rather than making an entry at the start of viewing and tracking starts/stops

This is correct.

The item is marked as viewed when:

  1. “Mark as viewed” selected manually
  2. Enough of the item has been viewed.

This is the part where the bug lies. Since observing the first time, I have now watched multiple users view multiple entire programs and never be cataloged in “metadata_item_views”. The threshold monitoring is flawed somehow. The latest specific instance I observed was with an AppleTV client version 2.17 running on TVOS 13.4.

The others were Roku and Chrome (web) but the Plex Transcoder Statistics.log files were overwritten before I thought to capture those data.

“Enough” means “less than 5 minutes remaining”.

May I ask why you’re placing all stock in “metadata_item_views” ?

Viewstate isn’t always stored there.

FWIW, the instances in question were at the credits… ~2 mins or less left…no dice.

I haven’t gone through the entire database and logs, but from what I could figure so far, this is where the dashboard is pulling data for populating viewing history on the dashboard. I had been using the dashboard to casually keep track of various family members viewing time and wanted to find out why it was not accurate.

Is this not correct?

Is there additional view-state information I can pull from the database on a per user basis? I’m happy to write my own queries, etc…just not sure what’s where yet.

It is hardly critical but it would be nice to know that the data that is being collected is accurate.

I know PMS maintains viewstate / partial viewstate information in there but I don’t know the database internals well enough to know where it is.

I"m sure there’s a schema spec somewhere but I don’t know that either.

This is one of those times when I unfortunately have to say “Engineering has full control”. I do have a level of control over linux packaging but that’s where my visibility ends.

From the business perspective, I really doubt they’re going to disclose the schema either.

No worries.

I was able to pop the sqllite db in a viewer and find my way around. I’m pretty sure that “metadata_item_views” is the only place who’s-watched-what is stored…I only spent 20 mins or so, but the DB is pretty well laid out and I don’t see it hiding elsewhere.

Please let whoever works on that aspect that something isn’t right. Maybe tracking anything that has been watched beyond than 20% should count rather than “5 mins from the end”. That would be more of an honest metric. In any case, it isn’t doing it correctly. My observed cases all watched entire programs and never recorded as a viewing.

Not a high priority for me, but someone should care. If you guys are collecting voluntary stats on this, you are missing out on a lot of unrecorded viewer hours.

Thanks for looking into it.
Cheers

I would like to see Plex track view and watched.
Can’t remember cause it’s been so long but Tautulli has a setting for duration. I have it set for the lowest possible to log all items viewed, even for 2 seconds.

I looked at Taudulli a while back but it seemed like overkill for my purposes. Literally the only thing I want beyond what is in the standard plex app is accurate reporting of viewing times. What do I care if someone finished a show? That’s just silly. I want to know what the usage rate is in general for everyone, so I can have an idea how much the server is actually being used; and more specifically for the kids, who are only supposed to be watching during certain hours and a certain amount. I only really check once in a while when I want to see how the server is holding up (8 year old system running off a stack of USB2 drives)

It’s just weird to me that it is setup this way to begin with. I can’t imagine being the guy who wrote the usage tracking which only works kindof and said “Yep. That looks good. Job done.” I recently poked around the forums a bit and found this issue has been around for ages.

I understand wanting to work on the new-and-hot PVR or other features, but sheesh…let’s nail down the fundamentals too. :wink:

You do make a valid point. I too don’t really care.
I’m sure having known what was watched gives admins a way of knowing when to delete stuff off their servers…

That’s an interesting point.

We don’t delete anything other than daily news programs that get nuked after two weeks whether anyone has watched them or not, and a couple weekly programs that get dusted out every other year similarly.

Does anyone actually keep tabs on users and then “figure out” if others are done viewing to delete things? Do folks run super close on disk space? I just keep adding disks…lol

I’m sure some do just with Tautulli(this feature is rather new to Plex). I bet more will use Plex in the years to come to do this.

There are also requests for allowing PMS to automatically delete items that have been watched by the admins and other specified users.

I did a little more digging out of curiosity. It appears as though the total viewing times on the dashboard may be accurate, just the viewing history isn’t. At the moment I have one viewer who has watched multiple hours of TV last week but only one episode shows up under their viewing history. I spoke to them and now know what they actually watched and the total time sounds about right.

I didn’t think someone decided to watch the same episode 5 times in a week. That would be weird. XD

It still would be nice to know what people are watching. I have no worries about inapprorpriate content, as there isn’t any on our server, but your prior comment did get me to thinking if there is some utterly undesired content on there that I could clean out. No point in wasting space on things nobody is interested in.

Maybe I’ll revisit Tautulli. I fired up a docker instance a while back but removed it when I found out it had no mechanism to import the already existing viewing history…pretty weak-tea for a tool whose primary pupose is tracking stats.

Maybe I’ll just write my own exporter and monitor…heh.

I could be wrong, but plex only recently (within the last year or so) started keeping stats in the database.

So tautulli originally didn’t have anything to import, tautulli (previously plexpy) was the only tool to track anything, which is why it has its own internal tracking db and must be running to track anything.

whether this behavior will change is entirely up to the tautulli devs.

I’m afraid that is not correct. I have stats all the way back to 2013. This was why I thought Tautulli would be neat. I assumed it would import what was there and I could have a nice pretty historical analysis. Statistical data on a go-forward basis is ok I suppose…just not interesting enough for me to roll out a separate tool. I’d rather just dump out the db info and magic it into console-viewable stats, which is simple enought and I’ll punch out this weekend if I can find a couple hours.

Tautulli can’t import the history Plex has because it’s missing most of the information that Tautulli tracks… and isn’t tracking the same thing anyway. Plex tracks when an item is marked watched, whether that is by somebody actually watching it, or just marking it as watched in the UI. Tautulli tracks what your server is actually playing to clients, in far more detail than Plex keeps.

1 Like

I am probably thinking of when plex actually starting exposing stats in the dashboard.

from tautulli faq


Q: Do I need to keep Tautulli running to record history?

A: Yes. Tautulli cannot “see” your Plex activity if it isn’t running, or retroactively import old history.

Q: Can Tautulli import history from before it was installed?

A: No, unless you had PlexWatch or Plexivity installed previously and import the database, Tautulli can only start logging history after it is installed.

Although Plex does keep some information in their database, it is nowhere near detailed enough to build the level of history that Tautulli keeps, the above tools keep enough information to build partial records from.

Thanks @Arcanemagus, that makes it a bit clearer. I’ll check it out from github and see if there is a way I can munge the historical data in easily and maybe give it a go afterall. No point in re-inventing the wheel.

If there was a way to import the data we would already support that. When I said that Plex doesn’t store most of the data Tautulli does, I meant it.

Gotcha.

I have Tautulli up now and see what you mean. Looks like a useful tool. Thanks for all your efforts here.

Small note: Details for setting up behind a mapped directory for SSL reverse proxy on apache were nowhere to be found. It took a little effort to work out. If you want to include them somewhere:

For Example:

  1. modify /opt/Tautulli/config.ini:
    http_root = /tautulli
    http_host = 127.0.0.1

  2. modify /etc/apache2/sites-enabled/myApacheSSLWhatever.conf and include the following under your Location or wherever you have proxy deets setup:
    ProxyRequests Off
    ProxyPreserveHost On
    ProxyPass /tautulli/ http://127.0.0.1:8181/tautulli/
    ProxyPassReverse /tautulli/ http://127.0.0.1:8181/tautulli/

Assuming the /tautulli is where you want to find it.