stash
stash copied to clipboard
Track watch activity for scenes.
This pull request adds activity-tracking support for videos. Stash will now remember where you left off in a video and will resume from that position when you return to the video. Scene cards will now include a progress bar to show users how far into each video they are. Users can also now sort scenes by recently played to see what video they last watched.
I added a config option to tell Stash to always start a video from the beginning for users who might not want resume functionality.
Fixes #2769 Fixes #633
My latest push contains changes to address feature #633. This pull request now tracks watchTime and viewCount and provides options to filter and sort by those new fields. A config option was also created to allow users to set an ignore interval to delay tracking until a set amount of time has passed.
There is still a bug with sorting by View Count that I need to address which I will look into tomorrow. Some debug code also needs to be cleaned out in typescript files.
If I interpret your Code correctly, this would make it relatively easy to add a filter for already started videos, as well as a sorting by 'last watched'. I think both would be a great addition to the project, so I'd be thankful if you consider adding those to the request (or create a separate one of course).
Sorry about the duplicates. Github just broke for some reason, gave me back timeouts but obviously still posted them after...
I see you asked the same comment 3 times. Can you please remove 2 of them to remove unnecessary bloat from this pull request?
To answer the question, this change already has a sort option to sort by recently viewed scenes. I didn’t add a filter for filtering on watch progress but that should be painless to do so I can include it.
Awesome, thank you!
Hey, this looks great! Sorry, I'm new to Stash but will it be possible with this addition of this recently played data for me to import the played data I have stored in a different organizing program? I'm still working on the necessary plugin but I would like to transfer data such as Scene X - played 21.34 Aug 12 2022, 17.59 Feb 14 2022, 18.43 Dec 25 2021 etc. Or at least could this pull be set up to enable such info (I guess it's multiple dates played attached to a scene) to be included and open to plugins in the future? Thanks much!
You should be able to update the activity data via graphql mutations so a script can be written to import your data. However, to keep things simple, this change does not track all the dates an event occurred on. It only keeps track of the date of the most recent activity and increments the play count and duration accordingly. Storing this info by the date of each occurrence is something I'm looking into, but I likely won't have time to get in with this change since it would touch code that I need more time to become more familiar with.
I'm just now seeing your feedback. Thanks for going through this. I'll start working my way through your comments soon.
there's a stale cache issue when clicking the scenes button from the player. I had to refresh before the scene displayed the correct resume time in the scenes list
I don't think the caching issue you're seeing is new to this change. I've been noticing that Stash doesn't always properly refresh when navigating to a page that has been visited earlier. I'm not yet clear on how this is handled in React/Stash.
Can you please merge or rebase against the develop
branch. I've tried to do it, but haven't been able to restore functionality.
I should be able to do this tomorrow. I’ve been busier than usual lately, but things should start to slow down tomorrow.
I've taken care of the merge.
Currently missing code to export the new fields.
The export logic is there. I just ran the function now to be sure it works. Here is a snapshot of the output:
I'm finding that the resume time gets reset when I navigate to a scene page without playing. I assume this is not expected behaviour?
This should be fixed now.
I cleaned up the backend code a bit and added unit tests.
Thanks!