Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

First step towards played sync #4881

Merged
merged 13 commits into from
May 7, 2023
Merged

Conversation

sephrat
Copy link
Contributor

@sephrat sephrat commented Mar 9, 2023

This PR is a first step towards syncing played states from media servers to Ombi.
The long-term goal for this PR and future PRs is the following:

  • Sync episodes and movies played status for every user, for every media server
  • Show this information along with the requests to know if the user who made the request (and possibly other users) has watched it.

The current development progress for this PR is:

  • Cache Emby movie played state in Ombi
  • Enhance the requests API with "played" state
  • Display played state in the requests list
  • Allow to toggle this feature on/off (default: off), as this is highly experimental

Out of scope features for this PR (other PRs will follow):

  • Episode sync
  • Plex and Jellyfin sync

Some technical documentation:

  • Refactored EmbyContentSync to reuse parts of code for EmbyPlayedSync
  • Created a new table UserMoviePlayed in ExternalDb to cache played state

Let me know what you think of this and my plans!

@sephrat sephrat marked this pull request as ready for review March 11, 2023 16:40
@sephrat
Copy link
Contributor Author

sephrat commented Mar 11, 2023

I'm ready for a review.

There is now a new column in the requests list:
image
A tooltip on the column header explains its meaning:
image
I also used a tooltip to show some additional information on the checkbox.
image

The sync is done in the existing Emby sync jobs (full sync and recently added).

@sephrat
Copy link
Contributor Author

sephrat commented Mar 11, 2023

Also I forgot to mention, I couldn't get the migrations to work with Mysql. I'm getting this error:

$ dotnet ef migrations add MovieUserPlayed --context Ombi.Store.Context.MySql.ExternalMySqlContext --startup-project ../Ombi
Build started...
Build succeeded.
Unable to create an object of type 'ExternalMySqlContext'. For the different patterns supported at design time, see https://go.microsoft.com/fwlink/?linkid=851728

Same command with Sqlite context worked fine, I can't figure out what I'm doing wrong. Hopefully it's just a button to press on your side to make this happen.

@tidusjar
Copy link
Member

tidusjar commented Apr 6, 2023

Regarding that error, you need to make your database.json file point to a MySQL database. It will then work

@sephrat
Copy link
Contributor Author

sephrat commented Apr 6, 2023

Thanks, done!

@tidusjar tidusjar merged commit 9cfb10b into Ombi-app:develop May 7, 2023
@sephrat sephrat deleted the played-sync branch May 17, 2023 07:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants