Jump to content

Reset Play Status On Media Removal


Recommended Posts

DarkStar1977
Posted
37 minutes ago, Luke said:

That would not mitigate that. They would still lose watch data.

No, if this task is disabled by default.

Meaning that this can be implemented but not scheduled, only users want to use it will create a schedule.

And A warning like "By running this task, all deleted media watch history will be lost" and a confirmation Popup "Are you sure you want to continue?" may be enough

  • Agree 1
HouseOfCards
Posted
4 hours ago, DarkStar1977 said:

It's a great idea and your approach of "deleting content" and "reading it" is at least a way to make this appears as the first items on every library "My Media" is presenting.

Definetly you will need a script, and sorry I cannot help on that.

Thanks, yes...  It's much more complicated and this is the only way I found to accomplish it, minus the play state when re-adding things.

Because, for example, a batch of additions for "September 11th" might add movies about September 11th, TV documentaries, podcasts...  It's pretty flexible like this, in that I can add (on September 1, for instance) all different types of media which revolves around September 11... not just movies.  Tough to set up initially, but flexible. 

I'm looking into the scripting thing. 

Posted (edited)
6 hours ago, HouseOfCards said:

Since I run two servers, I really just need to run a script once a month (on one server) to reset the play status of any items not in the library anymore. 

you are unraid right with userscripts?
i am not good at bash/shell but you could write a script
i have never checked that plugin, i personally would prefer to use the rest api to use any language that i feel comfortable in

which fetches all the items, does a quick check if they are the correct files and mark them as unplayed
if you go to the dahsboard of your server and scroll down you find a button called api, it has openapi docs

this is for example a snippet of my api wrapper for python

def get_user_played(self, user_id):
  # Why if querying movie, episode and serie it does not return all series? ...
  items = []
  url = self._url_builder(
    f"/Users/{user_id}/Items", recursive=True, Filters="IsPlayed", IncludeItemTypes="Movie,Episode"
  )
  items += self._get_request(url)["Items"]
  url = self._url_builder(
    f"/Users/{user_id}/Items", recursive=True, Filters="IsPlayed", IncludeItemTypes="Series"
  )
  items += self._get_request(url)["Items"]

  return items

do your filtering to get the items you want to mark unplayed based on directory, parent/library
after that you would then use this endpoint probably to mark items as unwatched
/emby/Users/USER_ID/PlayedItems/ITEM_ID/Delete

you would probably want to run this part of the script before the file movement happens

Edited by TZTZoro
HouseOfCards
Posted
On 10/17/2024 at 1:16 PM, GrimReaper said:

I agree, seems like an omission, multi-select should be available regardless of My Media or My Media (small). @Luke

So I followed this, multi-selected movies, and marked everything played.  Then I went to repeat the option and there is no option to mark everything un-played.  I thought marking it all played would fix that, but no.  Now I have marked everything played and have to undo them one by one. 

There is no "Mark Unplayed" anywhere in the three...dot menus.

Happy2Play
Posted
2 minutes ago, HouseOfCards said:

So I followed this, multi-selected movies, and marked everything played.  Then I went to repeat the option and there is no option to mark everything un-played.  I thought marking it all played would fix that, but no.  Now I have marked everything played and have to undo them one by one. 

There is no "Mark Unplayed" anywhere in the three...dot menus.

Sorry I don't follow.

Multi-select and mark all played or from Home screen mark library as played.

image.thumb.png.6393f572ac4fa66ba01d04b653f4e94e.png

to mark all as unplayed enter library select all again ie enable multi-select on first item, hold SHIFT, and select last item.

image.thumb.png.6ce05ed001b55b332e4239ffa32c5193.png

Happy2Play
Posted (edited)

Or learn the api and rest per library id to POST to change entire library PLAYED or DELETE to change UNPLAYED but both options above and here are a per user operation.

image.png.98fe658267bf9fd2472cd5cef8fbdc28.png

Or even this POST endpoint to clear the library id played status.

image.thumb.png.9b798052ce3cb59cc8c57dcc9a95da66.png

Edited by Happy2Play
  • Like 1
HouseOfCards
Posted
12 minutes ago, Happy2Play said:

Sorry I don't follow.

Multi-select and mark all played or from Home screen mark library as played.

image.thumb.png.6393f572ac4fa66ba01d04b653f4e94e.png

to mark all as unplayed enter library select all again ie enable multi-select on first item, hold SHIFT, and select last item.

image.thumb.png.6ce05ed001b55b332e4239ffa32c5193.png

I don't have that.  Not with either server, any user, selecting single or multiple libraries.

 

Screenshot_20241021_215113.png

Happy2Play
Posted
Just now, HouseOfCards said:

I don't have that.  Not with either server, any user, selecting single or multiple libraries.

 

Screenshot_20241021_215113.png

You can Mark everything as played via the Home screen library options but can not mark unplayed the same way and something @Lukeneeds to look at as it worked a one point in time but now you have to enter library once you have marked as played and multi-select (enable multi-select on first item, hold SHIFT, select last time) and then select unplayed.

  • Thanks 2

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...