Jump to content

Including LastAccessedDate to API content records


ReichJordan

Recommended Posts

ReichJordan

The ASK -
It would be outstanding if we could add a LastAccessedDate to the API calls for EMBY.
One possible location could be GetItems, FIelds=LastAccessedDate. 
I do see that there is a Last Played Date that is recorded per an individual playing the content. This should make this a relatively "trivial" addition by defaulting the field to False and writing the Last Played Date to it anytime anyone plays the content. If you want to take it a step further, anytime anyone plays the content continuously for longer than X minutes.
The distinction here is a global last accessed date independent of each user's current Last Played Date.

The WHY -
One of the staples of content management is the ability to determine an item's last access date as it determines the relevance of an item. Most of us do not have unlimited storage, which means if something has never been accessed or played in two years, it is evident that no one cares to have it on there; as such, it should be removed. This could also be helpful data to display internally for those not leveraging API calls. While PLEX did not have this data natively, the ability to pipe Tautulli into the system did allow you to have the data accessible in a programmatic way.

The WORKAROUND - 
The only way I can see to accomplish this today (natively) would be to pull a list of all users. All of their individual last played data, combine, clean up the data, restrict to a date/time window of interest, compare with the entire list, and remove the difference. This, unfortunately, will likely be the path I head down as my need is more immediate. But what could essentially be a single line or two of code to accomplish has now become a multi-series set of loops to build a dataset that can be used for this purpose.

I appreciate your consideration, and if I am missing something blatant, please let me know.

Edited by ReichJordan
Link to comment
Share on other sites

Hi, well I don’t think we should add a value that merely duplicates the last played date. If we’re going to add something like this then I think it should be updated anytime the user plays or even pulls up the detail screen for it.

  • Agree 1
Link to comment
Share on other sites

11 hours ago, Luke said:

I don’t think we should add a value that merely duplicates the last played date

The way I read this request, it doesn't really do that.  It rolls that date up to the item level instead of the user level...

  • Agree 1
Link to comment
Share on other sites

ReichJordan

Thanks for the feedback!

Yes, in this case, I am not interested in data stored for each user about when they last played the item. But a more global variable that indicates when anyone last accessed the item itself. The trigger that reveals when that data is written is less important to me concerning whether they played, opened, finished, etc.

To my awareness. No data stored in Emby today clearly (and easily) indicates this. Although, I am always happy to be wrong :).

  • Thanks 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...