-
-
Notifications
You must be signed in to change notification settings - Fork 404
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Media servers + newsletter refactoring #4463
Conversation
sephrat
commented
Jan 10, 2022
•
edited
Loading
edited
- Merge common code between Plex, Emby and Jellyfin
- Repository
- Content
- Episode
- Make use of this in NewsletterJob to remove duplicate code
- Save absolute URL for Plex content in DB (be consistent with Emby and Jellyfin)
Oh man this has made my day! This is something I've wanted to do for a long time but never had the time to do it! Update: Code looking good so far :) |
I just hit a major milestone. I can now focus on actually refactoring the newsletter. |
@@ -79,66 +79,6 @@ public static void CheckForUnairedEpisodes(SearchTvShowViewModel search) | |||
log.LogError(e, "Exception thrown when attempting to check if something is available"); | |||
} | |||
|
|||
if (epExists != null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why was all of this removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
git diff is a bit stupid, the last bits of this method are still there after the part I removed (l.142/82).
If you were asking about the whole section being removed: the Plex/Jellyfin/Emby methods were merged into a single one which takes IMediaServerEpisode as an input.
I think it's in a good shape now. I've reassessed the scope of this PR, see my edited OP. |
No need to recalculate it + Plex URL was broken due to an earlier change
Looks like we have some unit test failures :( I'm planning to do some testing around this soon |
Oops, didn't see that one. Pretty sure it works in productive mode though, I've simplified the URL part when merging Plex with Emby and Jellyfin: they're calculated once upon sync. The tests probably only need to be rewritten to check the URL on sync, not on availability check. I'll look into it. |
That makes sense for new syncs, but what about existing synced data? |
Fair point. It can easily be fixed by forcing a full resync, but I guess it'd be better not to break this. I'll see what I can do. For the record, this is only relevant for Plex - Emby and Jellyfin syncs already store the full URL in the database. |
If there's nothing simple, then we can just recommend a clear and full resync. It would be a very temporary issue. |
URLs are now fetched from database directly
Solves URL for media synced before absolute URL was saved in PlexServerContent
I've removed the tests since I could not find a simple way to migrate them into sync tests (sorry), and it's not AvaibilityRule's responsibility anymore. |
I've been testing this and awesome work! Almost ready to merge it 🤞 |